Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Undo empty row
Message
De
01/09/2007 03:21:34
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Undo empty row
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01251862
Message ID:
01251862
Vues:
51
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...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform