Star
12777 Points
1635 Posts
Jan 08, 2014 01:13 AM|Terry Guo - MSFT|LINK
Hi amiteshverma,
According to your description, my understanding is that you would like to fetch datatable columns value into string array.
If so, please try to refer to the following code:
string[] strArr = new string[dt.Rows.Count]; int i=0; foreach (DataRow r in dt.Rows) { strArr[i] = r["ColumnName"].ToString(); i++; }
Hope it helps.
Best Regards, Terry Guo
c array datatable gridview
Star
12777 Points
1635 Posts
Re: how to collect datatable result in string array
Jan 08, 2014 01:13 AM|Terry Guo - MSFT|LINK
Hi amiteshverma,
According to your description, my understanding is that you would like to fetch datatable columns value into string array.
If so, please try to refer to the following code:
Hope it helps.
Best Regards,
Terry Guo
c array datatable gridview