private void Form1_Load(object sender, EventArgs e)
{
da = new SqlDataAdapter("select * from record",@"database=student;server=arun-pc\mypc;integrated security=true");
da.Fill(ds,"record");
}
private void button1_Click(object sender, EventArgs e)
{
da.SelectCommand.CommandText = "select * from emp";
da.Fill(ds,"emp");
dataGrid1.DataSource = ds;
}
private void button2_Click(object sender, EventArgs e)
{
cb = new SqlCommandBuilder(da);
da.Update(ds.Tables[0]);
MessageBox.Show("updated")
}
我无法更新table[0]
,但我可以更新,但我table[1]
无法找到为什么会这样?