Hi,

Strangely enough, I cannot get the RowUpdated and RowUpdating events of a SqlDataAdapter to fire. I have done the standard subscribing to the event, and connecting the event handlers. But nothing happens.

Any help would be greatly appeciated.
Thanks,
Mark


Within a procedure:
daPersonPhone.RowUpdated +=new SqlRowUpdatedEventHandler(OnRowUpdated);
daPersonPhone.RowUpdating +=new SqlRowUpdatingEventHandler(OnRowUpdating);


The event handlers:

private void OnRowUpdated(object sender, SqlRowUpdatedEventArgs e)
{
if (e.StatementType == StatementType.Insert)
{
if (e.RecordsAffected == 1)
{
int newOrderID = (int)e.Row["OrderID"];

DataRow newRow = dsOriginal.Tables["Phone"].Rows.Find(dummyPhoneID);
newRow["OrderID"] = newOrderID;
}
}
}

private void OnRowUpdating(object sender, SqlRowUpdatingEventArgs e)
{
if (e.StatementType == StatementType.Insert)
dummyPhoneID = (int)e.Row["PhoneID", DataRowVersion.Current];
}


**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...