4
Reply

How to Convert Linq Query into DataTable

Faisal Ansari

Faisal Ansari

Apr 6 2011 1:48 AM
8.8k
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)