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]
ますが、なぜそうなのかわかりません。