Jump to content
  • Advertisement

Archived

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

ISOPimp

C# Updating a Table

This topic is 5839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
The DataTable has an AcceptChanges() method but it is supposed to be called by the Update() Method. I tried adding it anyway, and I get the same results.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!