Faisal Ansari

Faisal Ansari

  • NA
  • 451
  • 831.8k

How to Convert Linq Query into DataTable

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