Access different columns from LINQ resultset
Posted
by
Piyush
on Stack Overflow
See other posts from Stack Overflow
or by Piyush
Published on 2011-02-26T07:22:30Z
Indexed on
2011/02/26
7:24 UTC
Read the original article
Hit count: 130
I have a query which returns multiple columns from the database using LINQ
var donors = from d2 in db.Donors
where d2.Status == "Pending"
select new { donorID = d2.donorID, bloodGroup = d2.bloodGroup, contactNo = d2.contactMobile, status = d2.Status };
now I want to display the results in different Labels
accessing one column value from donors
resultset.
ex:
Label1.Text = donorID;
Label2.Text = bloodGroup;
...and so on
please help me achieve this.
© Stack Overflow or respective owner