private void Test()
{
DataTable dt = new DataTable();
foreach (DataRow row in ToArray(dt.Rows))
{
row.Delete();
}
}
DataRow[] ToArray(DataRowCollection collection)
{
DataRow[] result = new DataRow[collection.Count];
collection.CopyTo(result, 0);
return result;
}
You can also use a for-next loop...
Charles
http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/cd5d6063-9226-4f98-9220-7d6b1b53e710
No comments:
Post a Comment