Creating a Comma Separated List from DataTable Column

Hi can anyone tell me what is wrong with this line of code? I took it from somewhere else so I am unsure of the issue. The error says “Expression expected.”

Thanks

@jpreziuso
code is valid for c#
for VB do following:
ResultDB.AsEnumerable.Select(Function (x) x(“Person Person No”).toString).toArray

1 Like

Awesome, thank you. Do you know how to then take that array and create a comma separated list?

@jpreziuso
lets assume following:
Assign:
left side: arrValues, datatype String()
RightSide:
ResultDB.AsEnumerable.Select(Function (x) x(“Person Person No”).toString).toArray

Assign:
leftside: csvString - Datatype: String
RightSide:
String.Join(",",arrValues)

1 Like

Perfect, thank you

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.