Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
1.33/5 (3 votes)
See more:
please give me example linq to object in the c sharp language

thanks
Posted
Updated 30-Mar-12 0:51am
v2
Comments
Rajeev Jayaram 30-Mar-12 6:51am    
[Edited] - Spelling.

Have you even bothered using Google?
Here is an article directly from CP that should help you:
Using LINQ to Objects in C#[^]
 
Share this answer
 
 
Share this answer
 
HI..

The linq concept is emarge for the object initialization from .net 3

it has 2 main thing
a)linq to Object under this we have 2 main type
1)IEnumerable object
2)IQueriable object--this is use ful for the Remote data.

IEnumerable datatype are use to process InMemory data like from datatale
datatable=getdatatbalefromdatabase();

IEnumerable<datarow> Custname= from ad in datatable.AsEnumerable()
where ad.Field<string>("Cust_id") == 111
select ad;

Now you can use Custname in following ways

foreach (var item in Custname)
lbltest.Text = lbltest.Text + "-" + item.Cust_id;

Hope It will Help You

Thanks
 
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