Reputation: 4727
I have a datatable who has only one column with values as below
COLUMN1
a
b
c
d
So what I want is, I want this values in a string with comma separated like below
string value = a,b,c,d
How will I get this.
Upvotes: 3
Views: 11428
Reputation: 202
var list = dt.AsEnumerable().Select(r => r["COLUMN1"].ToString());
string value = string.Join(",", list);
Upvotes: 11