Calling update after changes to a OracleDataTable throws an NullReferenceException Message="Object reference not set to an instance of an object."
VS2005.
OraDirect .net: 3.55.23.0
Oracle 10.
Insert Example:
DataRow _row = odtMail.NewRow();
_row["EMAILADDRESS"] = "[email protected]";
odtMail.Rows.Add(_row);
DataTable _changes = odtMail.GetChanges(DataRowState.Added);
if (_changes.Rows.Count > 0)
{
odtMail.Update();
odtMail.Connection.Commit();
}
Update Example:
DataRow _row = odtMail.Rows[0];
_row["EMAILADDRESS"] = "[email protected]";
DataTable _changes = odtMail.GetChanges(DataRowState.Modified);
if (_changes.Rows.Count > 0)
{
odtMail.Update();
odtMail.Connection.Commit();
}