I implemented article "Inserting relational data using DataSet and
DataAdapter" from this link:
http://www.codeproject.com/cs/databa...onaladonet.asp In my code.
It has a perfect explanation; still I got stuck at one point.
Debugger shows, that it happens when I'm at this stage:
static void CustDataAdapter_OnRowUpdate(object sender,
OleDbRowUpdatedEventArgs e) { OleDbCommand custCmd = new
OleDbCommand("SELECT @@IDENTITY", e.Command.Connection); //right
after this line e.Row["CustID"] =
custCmd.ExecuteScalar(); e.Row.AcceptChanges(); }
This method defines the OleDbRowUpdatedEventHandler event, which comes
to solve the AutoNumber column issue.
I got a message box error:
Problem populating dataset Box: [System.NullReferenceException: Object
reference not set to an instance of an object at (object sender,
OleDbRowUpdatedEventArgs e) in [path to file name]
There is some more text below it, but this seems to be the main thing.
Why do I get NullReferenceException? What did I missed?
sea#