.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> LINQ >> Post New QuestionBookmark and Share Subscribe to Forum

How to use LINQ in C#.Net

Posted By: Narayanan     Posted Date: April 16, 2012    Points:5   Category :LINQ
Hi,
I am new for LINQ Code.I am using following code in my Project.

I have a class file that is called "Student.cs".
List<Student> student = new List<Student>
{
new Student {StudentNo ="001" ,StudentName="ANAND" , age=10, Sex="MALE"},
new Student {StudentNo ="002" ,StudentName="BHAVANA" , age=10, Sex="FEMALE"},
new Student {StudentNo ="003" ,StudentName="CHANDRAN" , age=10, Sex="MALE"},
new Student {StudentNo ="004" ,StudentName="DINESH" , age=10, Sex="MALE"},
new Student {StudentNo ="005" ,StudentName="FATHIMA" , age=10, Sex="FEMALE"}
};
Student p = new Student();
p.age = 10; p.Sex = "male";
p.StudentName = "Hammad Ali";
p.StudentNo = "006";
student.Add(p);

how can i fetch the data from this code into datagrid view ?
Note: fetch the data via LINQ .

Responses
Author: Syed Shakeer Hussain             
Posted Date: May 15, 2012     Points: 20   

Hi,
Try with the below line of code

DataGrid.DataSource=Student;


Author: Sreeraj Nair Mungath             
Posted Date: July 05, 2012     Points: 20   

DataGrid.DataSource=Student; is not linq
go to msdn



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend