答案 0 :(得分:0)
最好的方法是将DataGridView绑定到DataBase。这将自动进行更新,这意味着两件事:
这样编码:
private void button1_Click(object sender, EventArgs e)
{
dataGridView1.DataSource = null; //clear its DataSource
dataGridView1.DataSource = oTable; //rebound with the DataSource
}
好source,How do I update changes in a datagridview back to the database?