Google+ Peter Bromberg's .NET Blog | Convert DataTable to List<T>

Peter Bromberg's .NET Blog All Things Programming

Convert DataTable to List<T>

15. March 2016 13:39 by admin in

 DataTable dt = ds.Tables[0];

             var   sponsorids  = dt.Rows.OfType<DataRow>().Select(dr => (int) dr["AccountID"]).ToList();

                return sponsorids;

Add comment

  Country flag


Loading