May be duplicate binding to the DataBindings collection causes this error. Anyway one
solution is to clear Control.DataBindings before adding new binding:
this.txtAddress.DataBindings.Clear();
this.txtZipCode.DataBindings.Clear();
this.txtAddress.Text = string.Empty;
this.txtZipCode.Text = string.Empty;
this.txtAddress.DataBindings.Add("Text", myDtaTbl, "Address");
this.txtZipCode.DataBindings.Add("Text", myDtaTbl, "ZipCode");
No comments:
Post a Comment