c# - Extract one whole column from DataTable without using LINQ? -
i have datatable
many columns in it. want extract entire 3rd column in, , put values in string array. , not want use linq i'm using .net 2.0 framework, default not support linq.
so how can without linq ?
string[] result = new string[datatable.rows.count]; int index = 0; foreach(datarow row in datatable.rows) { result[index] = row[2].tostring(); ++index; }
Comments
Post a Comment