c# 怎么用button更新DataGridView的数据到access
?
--------------------编程问答--------------------
写一个dataAdaper.update
--------------------编程问答--------------------
static private DataSet CreateCommandAndUpdate(
string connectionString,
string queryString)
{
DataSet dataSet = new DataSet();
using (OleDbConnection connection =
new OleDbConnection(connectionString))
{
connection.Open();
OleDbDataAdapter dataAdapter =
new OleDbDataAdapter();
dataAdapter.SelectCommand =
new OleDbCommand(queryString, connection);
OleDbCommandBuilder commandBuilder =
new OleDbCommandBuilder(dataAdapter);
dataAdapter.Fill(dataSet);
// Code to modify data in the DataSet here.
//Without the OleDbCommandBuilder this line would fail.
dataAdapter.Update(dataSet);
}
return dataSet;
}
--------------------编程问答--------------------
试一试
补充:.NET技术 , C#