D
Dan
I have created a C# app which allows editing of some database tables in a
form. The form has several controls (text boxes, list boxes, etc), bound to
a dataset with some tables into it; whenever the user requests a specific
record from a list, the connection is opened and data are retrieved for the
single record and all the related ("children") tables; the controls are
filled and user can edit them.
When the user wants to store its data into the source database, I do the
following:
1) call BindingContext[myDataSet, "SomeTable"].EndCurrentEdit() for each
table in the dataset
2) call Update for each data adapter
3) call AcceptChanges if nothing went wrong
Anyway, sometimes I get an "object reference not set to instance of an
object" exception from some of the instructions at (1), i.e. the requested
BindingContext is null. What I'm doing wrong here?
Thanx to all!
form. The form has several controls (text boxes, list boxes, etc), bound to
a dataset with some tables into it; whenever the user requests a specific
record from a list, the connection is opened and data are retrieved for the
single record and all the related ("children") tables; the controls are
filled and user can edit them.
When the user wants to store its data into the source database, I do the
following:
1) call BindingContext[myDataSet, "SomeTable"].EndCurrentEdit() for each
table in the dataset
2) call Update for each data adapter
3) call AcceptChanges if nothing went wrong
Anyway, sometimes I get an "object reference not set to instance of an
object" exception from some of the instructions at (1), i.e. the requested
BindingContext is null. What I'm doing wrong here?
Thanx to all!