I'm having a very funny behaviour in my application.
My windows App running on XP sp2, has data from various table.
If I make changes to only 1 table on the form and click save, it gives an
error:
"Object reference not set to an instance of an object."
If I debug the code, it crashes on the line with "*" (I'm showing the code
above, so that it would give a better idea)
public void UpdateDataSet()
{
// Create a new dataset to hold the changes that have been made to the main
dataset.
ClientManagementPro.dsClientT objDataSetChanges = new
ClientManagementPro.dsClientT();
// Stop any current edits.
this.BindingContext[dvClient,"relClient-ClientAddress"].EndCurrentEdit();
this.BindingContext[dvClient,"relClient-ClientNote"].EndCurrentEdit();
this.BindingContext[dvClient,"relClient-Action"].EndCurrentEdit();
this.BindingContext[dvClient,"relClient-Child"].EndCurrentEdit();
this.BindingContext[dvClient,"relClient-Job"].EndCurrentEdit();
this.BindingContext[dvClient].EndCurrentEdit(); *
<------------------- It crashes here (mind u dvClient is the only thing
that is modified).
Now, after it gives that error, if I click save, it goes through just fine!
Again this only happens sometimes, if I edit the same fields on the same
tab, it works just fine.
I'm completely lost here and have no clue how to troubleshoot this, any
insights would be highly appreciated.
Thanks
HS
|