1 using System.Windows.Forms;
2 using System.Data.OleDb;
3 using System.Data;
4
5 OleDbConnection connection = new OleDbConnection("");
6 OleDbCommand command = new OleDbCommand();
7 command.Connection = connection;
8 command.CommandType = CommandType.Text;
9 command.CommandText = "";
10 OleDbDataAdapter adapter = new OleDbDataAdapter(command);
11 DataTable dataTable = new DataTable();
12 DataGridView dgv1 = new DataGridView();
13 //fill
14 connection.Open();
15 adapter.Fill(dataTable);
16 dgv1.DataSource = dataTable;
17 //update
18 adapter.Update(dataTable);
19 connection.Close();
可以看看DataAdapter(OleDbDataAdapter,OracleDataAdapter等)。它有个Update方法,应该有用。