Queries in VB Projects with Simple Where Clause Fail in 0.2.2

Feb 13, 2008 at 3:00 PM
With Northwind Products, Categories, and Suppliers uploaded from Access 2007 to WSS 3.0, the following query in a VB LINQ to SharePoint project fails with a NotSupportedException in ParseErrors:

Dim Prods = From p In ctxNwind.Products _
Where p.Discontinued = False _
Order By p.ProductName _
Select p.ProductID, ProductName = p.ProductName, _
SKU = p.QuantityPerUnit, UnitPrice = p.UnitPrice, _
Category = p.CategoryID.CategoryName, _
Supplier = p.SupplierID.CompanyName, _
Inventory = p.UnitsInStock, OnOrder = p.UnitsOnOrder

Dim lstProds = Prods.ToList()
dgvLists.DataSource = lstProds

dgvLists is a DataGridView.

The following query works fine in C#:

var prods = from p in ctxNwind.Products
where p.Discontinued == false
orderby p.ProductName
select new { ProductID = p.ProductID, ProductName = p.ProductName,
SKU = p.QuantityPerUnit, UnitPrice = p.UnitPrice,
Category = p.CategoryID.CategoryName,
Supplier = p.SupplierID.CompanyName,
Inventory = p.UnitsInStock, OnOrder = p.UnitsOnOrder };

var lstProds = prods.ToList();
dgvLists.DataSource = lstProds;

Although it takes 17 seconds to execute until the lookup is cached.

--rj