|
-
Apr 21st, 2004, 03:32 AM
#1
Thread Starter
New Member
INSERT stored procedure...
Hi guys!
Can u please help me how to conect the INSERT stored procedure to ASP web application.
I have a sample code here but it wont work. It wont add new rows to the database. Is there something wrong with this code?
SqlConnection1.Open()
SqlDataAdapter1.InsertCommand.Parameters(1).Value=TextBox1.Text
SqlDataAdapter1.InsertCommand.Parameters(2).Value = TextBox2.Text
SqlDataAdapter1.InsertCommand.Parameters(3).Value = TextBox3.Text
SqlDataAdapter1.InsertCommand.Parameters(4).Value = TextBox4.Text
SqlDataAdapter1.InsertCommand.Parameters(5).Value = TextBox5.Text
SqlDataAdapter1.InsertCommand.ExecuteNonQuery()
SqlConnection1.Close()
assuming that I have 5 parameters in stored procedure....
-
Apr 21st, 2004, 08:44 AM
#2
Frenzied Member
What's the error?
The array index may start at zero like Parameters(0)...not sure.
-
Apr 23rd, 2004, 11:08 AM
#3
Frenzied Member
Post the table schema, stored procedure text and your db connection string.
You're not giving enough detail for your problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|