DataAdapter SQL InsertCommand using a stored procedure?

  • Thread starter Thread starter lkubler
  • Start date Start date
L

lkubler

Guest
Hi,

I'm looking for an example or tutorial on how to code an SQL DataAdapter in C# to pass parameters to a stored procedure that will insert a record into a table in the database.

I have the stored procedure and it works when I run it directly from SQL Management Studio. But my attempts to code it from an app aren't working. Not getting any error messages but it just doesn't insert anything so I must be doing something wrong in my code.

I have been trying to use the update method of the DataAdapter, but that takes a table as a parameter and just trying to take input from text boxes on a form. Or do I need to insert the data from the text boxes into a local DataTable just to make this work?

I can post relevant code examples of what I've tried if you'd like but I'm thinking there are examples out there, I just haven't found them yet.

Any thoughts?

Thanks in advance!

Continue reading...
 


Write your reply...
Back
Top