Thursday, February 25, 2010

Appling Linq on ADO.net

// Marking sql-like queries on datatable with linq

EnumerableRowCollection query =
from employee in employees.AsEnumerable()
where employee.Field("salary") > 20
orderby employee.Field("salary")
select employee;
foreach (DataRow emp in query)
{
Response.Write(emp.Field("LastName") + ": ");
Response.Write(emp.Field("salary") + "
");
}

No comments:

Post a Comment

 
Locations of visitors to this page