0
我想從我的數據集更新我的數據庫。從數據集更新數據庫?
mydataadapter = new MySqlDataAdapter("SELECT * FROM table0; SELECT * FROM table1; SELECT * FROM table2;", con);
myda.Fill(dataset);
//......
// for example I'm doing a change like this
ds.Tables[2].Rows[1][3] = "S";
//Then updating the database
MySqlCommandBuilder com = new MySqlCommandBuilder(mydataadapter);
mydataadapter.Update(dataset, "table2");
然後返回該錯誤
TableMapping['table2'] or DataTable 'table2' didn't find by Update.
你有什麼建議嗎?
我做到了,沒有錯誤返回。但數據庫dosn't不會改變。我可以添加executabletenquery等:S – Ases 2010-04-20 19:58:04
MySqlCommandBuilder com = new MySqlCommandBuilder(mydataadapter); 不是嗎? – Ases 2010-04-21 18:32:02