Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Undo empty row
Message
From
01/09/2007 03:21:34
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Undo empty row
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01251862
Message ID:
01251862
Views:
53
Hi,
I would like to loop thru datatable.rows and check for any empty row (certain fields are empty). If any, rejectchange.

I try the following code, it complaint "collection was modified". Any other wy to do this?
foreach(DataRow loRow in DataTable.Rows)
{
    if (loRow["MyField"] = string.Empty)
    {
        loRow.RejectChanges();
    }
}
Please advice.

Thank you
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Next
Reply
Map
View

Click here to load this message in the networking platform