Manish Kumar Choudhary

Manish Kumar Choudhary

  • 189
  • 10.9k
  • 3.6m

how to convert DataTable to List<> dynamically

Nov 22 2014 1:56 AM
Can Anyone suggest me how to convert DataTable to List<> dynamically ?

I need a function where if I pass class name or object of class with dataTable that function should return List<Object_Of_Class_Pass_In_Function>.

Ex :

Public List<xy> ChnageDtToList(DataTable dt, <Here Dynamic Object Of Any Custom Class say xy>)

{

//

Return List<xy>

}

How to create above function ?


Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (3)