0

我有 2 个表“合同”和“客户”,他们有 fk 关系。我将“联系人”拖到表单上,然后使用“客户”执行此操作,两者都是详细信息类型。2个表格的数据相应地显示在表格上。问题是当我修改然后单击保存按钮时,仅更新“合同”表的数据。

4

1 回答 1

0
 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;


    }
于 2012-02-06T18:04:48.590 回答