Re: BindingContext problems

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Depesz (depmar_at_poczta.onet.pl)
Date: 04/01/04


Date: Thu, 1 Apr 2004 16:27:55 +0200


> private void btnAdd_Click(object sender, System.EventArgs e)
> {
> try
> {
> // Clear out the current edits
> this.BindingContext[objkategorieDataSet,"Kategoria"].EndCurrentEdit();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think here is my problem. When I click "Add" button and I change the
active control from DataGrid to Edit Box I receive an error that I try to
insert null value into my DataSet.But I dont know how to fix it.

> this.BindingContext[objkategorieDataSet,"Kategoria"].AddNew();
> }
> catch (System.Exception eEndEdit)
> {
> System.Windows.Forms.MessageBox.Show(eEndEdit.Message);
> }
> this.objkategorieDataSet_PositionChanged();
> }


Quantcast