dionchen1
June 9th, 2003, 02:37 PM
Hi, all:
After I made the update to the database with ONLY the RowState = Deleted rows, I 'd like to AcceptChanges to those deleted row in my datatable. I used the following code to do that. Obviously, this code HAS problem, it changes the Collection while iterating through the collection. Does anyone know a way to AcceptChanges ONLY for rows with Deleted RowState?
**************
foreach( DataRow dr in dsMain1.Tables["LMCables"].Rows )
{
if ( dr.RowState.ToString() == "Deleted" )
{
dr.AcceptChanges();
}
}
****************
After I made the update to the database with ONLY the RowState = Deleted rows, I 'd like to AcceptChanges to those deleted row in my datatable. I used the following code to do that. Obviously, this code HAS problem, it changes the Collection while iterating through the collection. Does anyone know a way to AcceptChanges ONLY for rows with Deleted RowState?
**************
foreach( DataRow dr in dsMain1.Tables["LMCables"].Rows )
{
if ( dr.RowState.ToString() == "Deleted" )
{
dr.AcceptChanges();
}
}
****************