Hi all,
I need to update an particular set of rows in a datatable.
Here is some sample code of what I want to do:
DataTable dt = (DataTable)Session["Table"];
foreach(DataRow dr in dt.Rows)
{
if(dr.RowState == DataRowState.Added)
//Do something
}
Instead, I could also do:
DataRow[] dr = dt.Select("","",DataViewRowState.Added);
if(dr.Length 0)
{
for(int i = 0; i < dr.Length; i++)
{
DataRow drCurrent = dr[i];
//Do Something
}
}
My question is: Is there a significant performance difference between
the two approaches? The datatable should only have a few records
(maximum 10).
Thanks in advance,
Ben
*** Sent via Developersdex http://www.developersdex.com ***