3

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.

1 Answer 1

11
var list = dt.AsEnumerable().Select(r => r["COLUMN1"].ToString());
string value = string.Join(",", list);
Sign up to request clarification or add additional context in comments.

1 Comment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.