Dim dict As Dictionary(Of String,DataRow)
dict = dt1.AsEnumerable.ToDictionary(Function(r) r(0).ToString,Function(r) r)
Dim previous As String
For Each row As DataRow In dt2.AsEnumerable()
Dim key As String
If Not String.IsNullOrEmpty(row(0).ToString) Then
key = row(0).ToString
previous = row(0).ToString
Else
key = previous
End If
dtResult.Rows.Add({key,dict(key)("Vendor Name"),dict(key)("Quotation"),dict(key)("Fax"),dict(key)("Email"),dict(key)("Date"),dict(key)("Terms"),row("Item").ToString,row("Part Number").ToString,row("Quantity").ToString,row("UnitPrice").ToString})
Next
Dim dict As Dictionary(Of String,DataRow)
dict = dt1.AsEnumerable.ToDictionary(Function(r) r(0).ToString,Function(r) r)
Dim previous As String
For Each row As DataRow In dt2.AsEnumerable()
Dim key As String= row(0).ToString
If Not String.IsNullOrEmpty(key) Then
dtResult.Rows.Add({key,dict(key)("Vendor Name"),dict(key)("Quotation"),dict(key)("Fax"),dict(key)("Email"),dict(key)("Date"),dict(key)("Terms"),row("Item").ToString,row("Part Number").ToString,row("Quantity").ToString,row("UnitPrice").ToString})
Else
For Each cname As String In {"Item","Part Number","Quantity","UnitPrice"}
dtResult.AsEnumerable().Last().Item(cname)=dtResult.AsEnumerable().Last().Item(cname).ToString+"||"+row(cname).ToString()
Next
End If
Next