Click to See Complete Forum and Search --> : How do I update a table?


TBlob
March 10th, 2003, 08:23 PM
Hi,
I'm new to ADO.NET and am having difficulties updating a SQL Server table using ADO.NET. What I want to do is query a table, update a field in the row(s) that are returned, and then update the table with these changes.
Does anyone have some sample code for this?
Thanks.
Tom

ITGURU
March 17th, 2003, 05:29 AM
Hello,

You can update your database from your application by setting the value of the "InsertCommand", "UpdateCommand" and "DeleteCommand" property of SQLDBAdapter or oleDBDataAdapter and then execute following statement:

SQLDBAdapter.Update(yourDataSet, TableName)

For detail search for InsertCommand or any other property referred above for the Data Adapter in the MSDN or on the Microsoft Site.

Hope this will solve your problem.

hellomadhu
March 18th, 2003, 05:21 AM
hi

i can give u some sample code, give me ur mail id or mail me at
kovai_madhu@rediffmail.com

rgds
madhu