Step 1: Import NameSpace
Imports System.Linq
Step 2: Use Function
dt is returning value in datatable.
- Public Function CommaSeparated()
- Dim strName As String = String.Empty
- Try
- strName += String.Join(",", (From row In dt.Rows Select CType(row.Item("columnname"), String)).ToArray)
- Console.writeline(strName)
- Catch(Exception ex)
- Throw New(ex.message)
- End Function