Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > SqlRowUpdatedEventHandler Delete Information
 

SqlRowUpdatedEventHandler Delete Information

I have a SqlDataAdapter SqlRowUpdatedEventHandlerevent fired when a row is updated:

------------------------

m_daEvents.RowUpdated += new SqlRowUpdatedEventHandler(m_daEvents_RowUpdated);

m_daEvents.Update(m_dsOEEdb , "Events");

-----------------------------------------------

In the event handler I want to get information regarding the deleted row. However, I get a DeletedRowInaccessibleException when I tried to read the row information

--------------------------------------------------------------.

void m_daEvents_RowUpdated(object sender, SqlRowUpdatedEventArgs e)

{

if (e.StatementType == StatementType.Delete)

m_log = String.Format(m_cstrDeleteRow, e.Row[eEventColumnName.RecrdID.ToString()].ToString());

}

Is there a way to access the row information for the deleted row in the event handler?

Thanks in advance

malkie  Tuesday, December 19, 2006 10:05 PM

The row information is available in both the row updating and row updated events.

I have the same error in the row updating event.
"Deleted row information cannot be accessed through the row.".

malkie  Wednesday, December 20, 2006 5:11 PM
The SqlDataAdapter's RowUpdating event passes the row as part of the SqlRowUpdatingEventArgs. Maybe use that event instead.
Ken Tucker  Wednesday, December 20, 2006 1:35 PM

The row information is available in both the row updating and row updated events.

I have the same error in the row updating event.
"Deleted row information cannot be accessed through the row.".

malkie  Wednesday, December 20, 2006 5:11 PM

You can use google to search for other answers

Custom Search

More Threads

• How to update DataGridView to access database in Visual Basic 2005
• Capturing GridView cell clicking
• Textbox Validating
• Printing rows of Datagridview
• Trying to disable tooltip for a bound button field in a datagridview
• Newbie: Data app tutorial
• Not able to change row color based on the type of data
• Lower case 'q' keystroke doesn't work inside a Custom Cell of Data Grid View control
• How can we doing like a menu (pic inside)
• Computed Columns in TableAdapters