Using Stored Procedure take values from text boxes and put into SQL Server 2005
Posted on 2006-05-11
I am developing a web page form which links into a SQL Server 2005 database.
The database has several stored procedures which get data out and into drop down lists which the web site uses. The stored procedures are simple SELECT statements basically.
I am now at the stage where I've created the whole page with all the controls i require and wish to post the data back into the database.
To simplify the explanation here is the situation...
Web site with a text box and a drop down list.
I have a button which i wish to press and the text from the web controls get pushed into the stored procedure and put into the database.
How do i go about doing this? I'm quite new to .NET and have only really used the wizard type functions on getting data out of my database so please be kind with the explanations.
A probably naive thought on how something like this might be accomplished is shown below (again, please no laughing, i know it's not going to be this easy!)
Call SQL.StoredProc1(TextBox.Text, DropDownList.SelectedItem)
Thank you for any help and sample code you can offer.