VB Problem Query with Where Clause Removed Doesn't Preserve Column Order

Feb 13, 2008 at 3:11 PM
Edited Feb 13, 2008 at 3:13 PM
The following query in the same VB project as that with the offending Where clause (now removed) returns columns ordered alphabetically by column name instead of the order specified by the projection:

Dim Prods2 = From p In lstProds _
Where p.Discontinued = False _
Order By p.ProductName _
Select New With {.ProductID = p.ProductID, .ProductName = p.ProductName, _
.SKU = p.QuantityPerUnit, .UnitPrice = p.UnitPrice, _
.Inventory = p.UnitsInStock, .OnOrder = p.UnitsOnOrder}

The C# query in the other discussion works as expected.

Sample projects to repro these issues are available on request.