// The above query will fetch all the matching records for Id =1 from the datatable "test".

The "If" condition check the results and copies it to the datatable.

var query = from p in dsTest.Tables["test"].AsEnumerable()
where p.Field("Id") == "1" select p;

if (query.Count() > 0) { dtTest = query.CopyToDataTable(); }

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/MxfyiUSdrPY/14375