‘System.Data.TypedTableBaseExtensions.Where(System.Data.TypedTableBase, System.Query.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly

 

This is first time I am writing a BLOG post with an error messageJ. This error message you will experience while writing code in Orcas Jan CTP. There is no LINQ Windows or LINQ Console Application template available. So no references/namespace directives will be added automatically. If you have installed Orcas Jan CTP and are trying to create LINQ Apps there and follow the Charlie’s BLOG, you need to manually add couple of dlls from \Windows\Microsoft.NET\Framework\v3.5.XXXXX\ (I have version 3.5.11209 ie. Microsoft .NET Framework 3.5 (GreenBits)). Dlls are System.Core.dll, System.Data.Linq.dll, System.Xml.Linq.dll and add a reference “System.Query”. But still that will throw you and error for the simple code

 

int[] nums = {1,2,3,4,5,6,7};

var q = from n in nums

        where n>5

        select n;

 

There where will throw you and error with the following message

‘System.Data.TypedTableBaseExtensions.Where<T>(System.Data.TypedTableBase<T>, System.Query.Func<T,bool>)' cannot be inferred from the usage. Try specifying the type arguments explicitly

 

Simple solution is that you need to add a line at the top of your page using System.Query; 

 

Hope this will solve your problem.

 

Namoskar