Hi there guys,
I'm learning vb.net for the first time - at present i'm playing around with stored procedures. i created this procedure ti insert data into database - but i'm not sure how do i create the back end code and the parameters. I looked of on different tutorial still cannot find the answer. Can some one give me an example of how i could do the insertion through stored procedure:
Web form:
Thanks
I'm learning vb.net for the first time - at present i'm playing around with stored procedures. i created this procedure ti insert data into database - but i'm not sure how do i create the back end code and the parameters. I looked of on different tutorial still cannot find the answer. Can some one give me an example of how i could do the insertion through stored procedure:
VB.NET:
[SIZE=2][COLOR=#0000ff][SIZE=1]ALTER PROCEDURE [/SIZE][/COLOR][/SIZE][SIZE=1][dbo].[usp_InsertSupplierName][/SIZE]
[SIZE=1]@SupplierName [COLOR=#0000ff]ntext[/COLOR],[/SIZE]
[SIZE=1]@SupplierID [/SIZE][COLOR=#0000ff][SIZE=1]int [/SIZE]
[SIZE=1]AS[/SIZE]
[SIZE=1]SET NOCOUNT ON[/SIZE]
[SIZE=1]INSERT INTO [/SIZE][/COLOR][SIZE=1][dbo].[SupplierName] ([/SIZE]
[SIZE=1][SupplierName][/SIZE]
[SIZE=1]) [COLOR=#0000ff]VALUES [/COLOR]([/SIZE]
[SIZE=1]@SupplierName[/SIZE]
[SIZE=1])[/SIZE]
[COLOR=#0000ff][SIZE=1]SET [/SIZE][/COLOR][SIZE=1]@SupplierID = [COLOR=#0000ff]SCOPE_IDENTITY[/COLOR]()[/SIZE]
HTML:
<asp:TextBox ID="SupplierID" runat="server"></asp:TextBox><br />
<asp:textbox ID="SupplierName" runat="server"></asp:textbox>
<asp:Button ID="Submit" Text="Submit" runat="server" />
Thanks
Last edited by a moderator: