‘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

‘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

Rate This
  • Comments 0

 

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

 

Leave a Comment
  • Please add 3 and 2 and type the answer here:
  • Post