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

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -