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

html - Cut text on left side inside button while centering -

plugins - CodeIgniter support on netbeans 8.0 -

php - Selecting items from MySQL for a status update feed efficiently while accounting for possible spam -