绑定是 binding = new Binding("Text", dsMain.Tables[0], "service_request", true);
binding.Format += new ConvertEventHandler(binding_Format);
groupBox1.DataBindings.Add(binding); void binding_Format(object sender, ConvertEventArgs e)
{
string val = dsMain.Tables[0].Rows[0]["service_request"].ToString(); switch (val) { case "A": { e.Value = "A"; this.radioButton1.Checked = true; this.radioButton2.Checked = false; this.radioButton3.Checked = false; break; } case "B": { e.Value = "B"; this.radioButton1.Checked = false; this.radioButton2.Checked = true; this.radioButton3.Checked = false; break; } case "C": { e.Value = "C"; this.radioButton1.Checked = false; this.radioButton2.Checked = false; this.radioButton3.Checked = true; break; }
}
//throw new Exception("The method or operation is not implemented.");
}
当我选择radioButton2为TRUE时,但是保存更新时 adapterMain.Update(dsMain); dsmain表 TABLE 就是不能把service_request字段 B保存进去 为什么
binding.Format += new ConvertEventHandler(binding_Format);
groupBox1.DataBindings.Add(binding); void binding_Format(object sender, ConvertEventArgs e)
{
string val = dsMain.Tables[0].Rows[0]["service_request"].ToString(); switch (val) { case "A": { e.Value = "A"; this.radioButton1.Checked = true; this.radioButton2.Checked = false; this.radioButton3.Checked = false; break; } case "B": { e.Value = "B"; this.radioButton1.Checked = false; this.radioButton2.Checked = true; this.radioButton3.Checked = false; break; } case "C": { e.Value = "C"; this.radioButton1.Checked = false; this.radioButton2.Checked = false; this.radioButton3.Checked = true; break; }
}
//throw new Exception("The method or operation is not implemented.");
}
当我选择radioButton2为TRUE时,但是保存更新时 adapterMain.Update(dsMain); dsmain表 TABLE 就是不能把service_request字段 B保存进去 为什么
/// 保存数据
/// </summary>
private void SaveData()
{
dsMain.Tables[0].NewRow();
dsMain.EndInit();
adapterMain.Update(dsMain); }
添加了一行,什么数据也没有