|
-
Dec 4th, 2013, 08:16 PM
#2
Re: Help deleting line in data table and passing to stored procedure to delete from t
No, no, no! You should NOT be using ExecuteNonQuery if you have a DataTable. You used a data adapter to populate the DataTable in the first place. Use the same data adapter to save the changes. Follow the CodeBank link in my signature below and check out my thread on Retrieving & Saving Data. It includes an example that uses a data adapter and explicitly creates its InsertCommand, UpdateCommand and DeleteCommand. Follow that example but, instead of assigning SQL code to the CommandText of each command, assign the name of the appropriate sproc and then set the CommandType to StoredProcedure.
By the way, it also demonstrates a much less verbose method of creating the data adapter in the first place.
Tags for this Thread
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
|