Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to enumerate DataColumns in a DataTable
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
How to enumerate DataColumns in a DataTable
Divers
Thread ID:
00722302
Message ID:
00722302
Vues:
45
All,

I was looking to parse through all of the Columns of a DataTable to see if the Column accepted nulls:
DataTable DT = MyDataSet.Tables[0];
foreach(DataColumn DC in DT)
{
  ColumnName[Col] = DC.ColumnName; 
  MaxLength[Col] =  DC.MaxLength;
  Nullable[Col] = DC.AllowDBNull;
}
But I get an
foreach statement cannot operate on variables of type 'System.Data.DataTable' because System.Data.DataTable' does not contain a definition for 'GetEnumerator', or it is inaccessible
Any workaround? How do I implement GetEnumerator on a DataTable?

TIA,
Doug
Douglas Osborne
Don't spend your life just wishing - http://www.AllGiftRegistry.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform