一定需要SqlCommandBuilder(sda)
SqlDataAdapter sda = new SqlDataAdapter("select * from Student", conn);
SqlCommandBuilder scb = new SqlCommandBuilder(sda);
DataSet ds = new DataSet();
sda.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
DataRow dr = ds.Tables[0].NewRow();
dr["id"] = 2013;
dr["name"] = "劉念";
dr["course"] = "高等數學";
dr["score"] = 100;
ds.Tables[0].Rows.Add(dr);
sda.Update(ds);
ds.AcceptChanges();