BindingNavigator with multiple tables updating problem in Visual Studio 2010
I have 2 tables 'contract' and 'customer', they have fk relationship. I drag 'contact' onto form then do so with 'customer', both are details type. The data of 2 tables are sh开发者_如何学Cown on form accordingly. The problem is when I modify then click save button only data of 'contract' table is updated.
private void button67_Click(object sender, EventArgs e)
{
if (textBox81.Text == "")
{
MessageBox.Show("you must choose table name");
}
if (textBox81.Text != "")
{
connect();
cmd = new OleDbCommand("select * from " + textBox81.Text + " ", conn);
ds = new DataSet();
dp = new OleDbDataAdapter(cmd);
dp.Fill(ds,""+textBox81.Text+"");
cm = (CurrencyManager)this.BindingContext[ds];
textBox79.DataBindings.Add("text",ds,""+textBox81.Text+""+".ProdS_name");
textBox80.DataBindings.Add("text", ds, "" + textBox81.Text + "" + ".rate");
}
}
private void button58_Click(object sender, EventArgs e)
{
cm.Position++;
}
private void button59_Click(object sender, EventArgs e)
{
cm.Position= cm.Count - 1; ;
}
private void button61_Click(object sender, EventArgs e)
{
cm.Position=0;
}
精彩评论