VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,782 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dim Table1 As New DataTable
Table1.Columns.Add("C1")
Table1.Columns.Add("C2")
Table1.Columns.Add("C3")
Table1.Rows.Add({1, "A","C"})
Table1.Rows.Add({2, "B","D"})
Table1.Rows.Add({3, "C","D"})
Dim Table2 As New DataTable
Dim sttSeparator as String="<>" 'Use between columns
'Need Result
Table2.Columns.Add("AllColumnsTable1") 'As String
Table2.Rows.Add("1<>A<>C")
Table2.Rows.Add("2<>B<>D")
Table2.Rows.Add("3<>C<>D")
For example:
Table1.AsEnumerable.
Select(Function(r) String.Join(strSeparator, r.ItemArray.Select(Function(i) i.ToString))).
ToList.ForEach(Sub(r) Table2.Rows.Add(r))