2011-09-17 11 views
0

私は2つのテーブル 'contract'と 'customer'を持っていますが、それらはfk関係にあります。フォーム上に「連絡先」をドラッグし、「顧客」と一緒にドラッグします。どちらも詳細タイプです。それに応じて2つのテーブルのデータがフォームに表示されます。問題は、私が[契約]テーブルのデータのみが更新されて保存ボタンをクリックして変更するときです。複数のテーブルを持つBindingNavigatorをVisual Studio 2010で更新する

答えて

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; 


    } 
関連する問題