4
Answers

How to Convert Linq Query into DataTable

Faisal Ansari

Faisal Ansari

13y
11.9k
1
hello guys once again.

i have an problem in this code i wanna cast linq query into datatable but its giving error..
My Code is below:
 var searchData = from search in context.PersonInformations
                         where search.p_ID == Convert.ToInt32(txtPId.Text)
                         select search;
DataTable dt = ((DataTable)searchData);

Reply Soon ...

Thanks .
Answers (4)