Concatenate Two Sequences
Use the Concat(Of TSource) operator to concatenate two sequences.
The Concat(Of TSource) operator is defined for ordered multisets where the orders of the receiver and the argument are the same.
Ordering in SQL is the final step before results are produced. For this reason, the Concat(Of TSource) operator is implemented by using UNION ALL and does not preserve the order of its arguments. To make sure ordering is correct in the results, make sure to explicitly order the results.
This example uses Concat(Of TSource) to return a sequence of all Customer and Employee telephone and fax numbers.
This example uses Concat(Of TSource) to return a sequence of all Customer and Employee name and telephone number mappings.
Dim infoQuery = _ (From cust In db.Customers _ Select Name = cust.CompanyName, Phone = cust.Phone) _ .Concat _ (From emp In db.Employees _ Select Name = emp.FirstName & " " & emp.LastName, _ Phone = emp.HomePhone) For Each infoData In infoQuery Console.WriteLine("Name = " & infoData.Name & _ ", Phone = " & infoData.Phone) Next