How to Convert Datatable to IEnumerable List in Asp.Net.

 Posted by Vishalneeraj-24503 on 3/1/2015 | Category: ADO.NET Interview questions | Views: 673 | Points: 40
Answer:

We make sure that we have a Datatable with Records.

var data = dt.AsEnumerable().Select(row =>

new
{
emp_Id = row["emp_Id"].ToString(),
emp_Name = row["emp_Name"].ToString(),
PAN_no = row["PAN_no"].ToString()
});


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response