How to extract datarow from data table using Linq query in C# . I had tried below query
(From r In SampleDT.Select()
Where r(“First Name”).Equals(“John”)
Select r).CopyToDataTable
ended up in error.
@Palaniyappan could you please help on this.
How to extract datarow from data table using Linq query in C# . I had tried below query
(From r In SampleDT.Select()
Where r(“First Name”).Equals(“John”)
Select r).CopyToDataTable
ended up in error.
@Palaniyappan could you please help on this.
Try this one
SampleDT.AsEnumerable.where(Function(x)x("First Name").ToString.Equals("John")).CopyToDataTable
@suresh_panneer_selva post updated
Hi,
Can you try the following?
(from r in SampleDT.AsEnumerable()
where r["First Name"].ToString().Equals("John")
select r).CopyToDataTable()
Regards,
Dear Yoichi,
Received below errors
Error Validation Error A query body must end with a select clause or a group clause
) expected
; expected
The range variable ‘r’ conflicts with a previous declaration of ‘r’
The type or namespace name ‘Where’ could not be found
Cannot apply indexing with to an expression of type ‘method group’
Thank you Yoichi. made some word correction
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.