S
SftwDude
Is it possible to extract a single value from the results of a LINQ query
with out iterating over the results.
For example I have a table in SQL Server:
tblExample
Type int <--this is a key field
Descr nvarchar(5)
I would like to get the description (Descr) field something like this in C#:
string Description = from Example in db.tblExample where Example.Type = 1
select Example.Descr;
I know this query returns an IQueryable and the above query won't compile
because of type mismatch. Is there a way to get the string from the database
field using a LINQ query?
Thanks
with out iterating over the results.
For example I have a table in SQL Server:
tblExample
Type int <--this is a key field
Descr nvarchar(5)
I would like to get the description (Descr) field something like this in C#:
string Description = from Example in db.tblExample where Example.Type = 1
select Example.Descr;
I know this query returns an IQueryable and the above query won't compile
because of type mismatch. Is there a way to get the string from the database
field using a LINQ query?
Thanks