I have a DataSet
and I want to convert the DataSet
into List
T - type object
How convert my DataSet
?
I think this should do it.
var output = yourDataSet.Tables[0].Rows.Cast().Select(r => new
{
Column1 = r["Column1"].ToString(),
Column2 = r["Column2"].ToString(),
Column3 = r["Column3"].ToString(),
Column4 = r["Column4"].ToString(),
Column5 = r["Column5"].ToString(),
Column6 = r["Column6"].ToString(),
Column7 = r["Column7"].ToString(),
Column8 = r["Column8"].ToString(),
Column9 = r["Column9"].ToString(),
Column10 = r["Column10"].ToString()
}).ToList();