Archived

This topic is now archived and is closed to further replies.

ISOPimp

C# Updating a Table

Recommended Posts

I am having problems updating a Microsoft.Data.Odbc.DataTable with new data. I want to be able to do this by using regular SQL commands, and I cannot find a decent example or information to get this working. Right now I have this
   //dt has been filled and named

Odbc.OdbcDataAdapter da = new Odbc.OdbcDataAdapter();
da.UpdateCommand = new Odbc.OdbcCommand("UPDATE " + dt.TableName + " SET Value = 0 WHERE Name=''PartLength''");
da.Update(dt);  
Simple, but I thought it would work. I get no errors when running this code, its just that when I do it the values in the datatable remain what they were prior to running it. If anyone knows how I can do this properly (so that the values actually update) please let me know. Also, I probably didn''t provide enough information so let me know what you need to answer the question. Thank you.

Share this post


Link to post
Share on other sites