how to save the DataSet after making changes to the database?

主宰稳场 提交于 2019-12-06 21:05:30

Try the TableAdapter.Update process shown in this article: How to: Update Records in a Database.

Also, please make sure you not only have the necessary access to the database you are trying to connect to, but also permission to update records in the desired table. You may have a SQL Server configuration problem that is preventing your code from updating.

Since it is odbc, you might use an OdbcDataAdapter; then call:

adapter.Update(myDS.Tables[TableName]);

disclaimer: personally, I never use DataSet for.... anything. YMMV.

Михайло Пилип

You should type two line after loop

myDS.AcceptChanges();
adapter.Update(myDS.Tables[TableName]);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!