Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to enumerate DataColumns in a DataTable
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
How to enumerate DataColumns in a DataTable
Miscellaneous
Thread ID:
00722302
Message ID:
00722302
Views:
44
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
Next
Reply
Map
View

Click here to load this message in the networking platform