I am absolutely new to linq query, please help with this query, dataset has fields:
Name Value Client_owner.
I want to select Value if name == "searchtext"
DataTable results = (from d in ((DataSet)_MyDataset).Tables["Records"].AsEnumerable()
orderby d.Field<string>("Name") ascending
where d["Name"].ToString().ToLower().Contains(ProjectName.ToLower())
select d??).CopyToDataTable();
if _MyDataSet is a DataSet object then the extra cast is not needed in your example.
then create an extension method to create a filtered data table:
you can then filter your datatable like so:
results.ReturnColumn(new List<String> { "Value" });
which will return a data table with only the column "Value"