DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Linq Query To Get Records And Copy To Datatable
// linq query to get records and copy to datatable
var query = from p in ds.Tables["Id"].AsEnumerable()
where p.Field<string>("ID") == "1" && p.Field<string>("Name") == "test" select p;
if (query.Count<DataRow>() > 0)
{
dt = query.CopyToDataTable<DataRow>();
}





