Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Iterate over columns in LINQ to SQL result
Message
General information
Forum:
ASP.NET
Category:
LINQ
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01362512
Message ID:
01362522
Views:
13
>Craig,
>
>I wasn't clear enough in my fist question. My first foreach loop works Ok, as does yours. What I really want is an inner foreach loop to step through the columns, something similar to:
>
>
>
>var _CSVTests = from cs in db.CSVTests
>                               select cs;
>
>foreach (CSVTest tst in _CSVTests)
>{
>       foreach (Column c in tst)
>           {
>                 Do something with the value of each column if it isn't null.
>           }
>}
>
>
>
>I know the "foreach (Column c in tst) " part is not proper. What is?
>
>How do I get a collection of columns for each "record" in my _CSVTests ?

If you set this up via a DBML then CSVTest will be automatically defined as an object based on the field names of the underlying table.
You can check the properties used by looking in the relevant *.designer.cs file
Previous
Reply
Map
View

Click here to load this message in the networking platform