Click here to Skip to main content
15,918,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have used a code like :
XML
var st = (from s in db.specSheets where s.AccSlNo == int.Parse(Label1.Text) select s).First();
        descrip1.Text = st.descrip1+"<br/>"+st.descrip2;

What is the function of .First() method. Is it retrieve only one row or only the first element of the row? Please help me.
Posted

1 solution

The .First() method will return only the first row of your resultset.

http://msdn.microsoft.com/en-us/library/system.linq.enumerable.first.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900