Hi,
I am getting the above exception when i my Adapters Update method is called.
The method below is the second of two methods that are called when the user
clicks the "Save" button. The first is a loop that checks each record of the
data grid and makes sure the data in the columns is correct, if everything
checks out ok then this method is called.
bool result = true ;
int j = bindingManager.Count ;
try {
BatchLstConnection.Open() ;
//These Details cannot be entered by the user so the system must set them.
for(int i = 0; i < j; i++) {
BatchLstDs.Tables["tblGLBatch"].Rows[i]["TDate"] = txtDate.Value ;
BatchLstDs.Tables["tblGLBatch"].Rows[i]["GLBatchID"] =
txtJournalBatchID.Text ;
BatchLstDs.Tables["tblGLBatch"].Rows[i]["Source"] = "GL" ;
BatchLstDs.Tables["tblGLBatch"].Rows[i]["Type"] = 40 ;
BatchLstDs.Tables["tblGLBatch"].Rows[i]["Split"] = false ;
BatchLstDs.Tables["tblGLBatch"].Rows[i]["SplitID"] = 0 ;
}
BatchLstAdapter.Update(BatchLstDs, "tblGLBatch") ;
}
catch(Exception e) {
MessageBox.Show(e.Message + e.GetType().FullName,
"InsertTransactionDetails", MessageBoxButtons.OK, MessageBoxIcon.Error) ;
result = false ;
}
finally {
BatchLstConnection.Close() ;
}
return result ;
Regards
Darryn
|