各位大侠帮帮忙,我是菜鸟,现在在用C# dataTable更新数据库,做了很久还是错的,有没有代码共享一下,完全谢谢
各位大侠帮帮忙,我是菜鸟,现在在用C# dataTable更新数据库,做了很久还是错的,有没有代码共享一下,完全谢谢 --------------------编程问答-------------------- public DataSet CreateCmdsAndUpdate(string connectionString,string queryString)
{
using (OleDbConnection connection = new OleDbConnection(connectionString))
{
OleDbDataAdapter adapter = new OleDbDataAdapter();
adapter.SelectCommand = new OleDbCommand(queryString, connection);
OleDbCommandBuilder builder = new OleDbCommandBuilder(adapter);
connection.Open();
DataSet customers = new DataSet();
adapter.Fill(customers);
//code to modify data in dataset here
adapter.Update(customers);
return customers;
}
}
我用的是Oracle,你也可以改为sql server的
补充:.NET技术 , C#