c#怎么把datatable写入mysql数据库
展开全部
OleDbCommand cm = new OleDbCommand();
cm.Connection = conn;
cm.CommandText = "SELECT * FROM " + strTable;
OleDbDataAdapter ad = new OleDbDataAdapter(cm);
OleDbCommandBuilder build = new OleDbCommandBuilder(ad);
int n = ad.Update(datable);
datable.AcceptChanges();
MessageBox.Show(string.Format("更新了{0}条记录!", n));
大概这样
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询