chenwenbin

EMMSDatabaseDataContext data = new EMMSDatabaseDataContext("Server=laver-chen;Database=EMMS;User=sa;Password=*****");
var dst = from p in data.InspectionSafeties
select p;

Error 1 Could not find an implementation of the query pattern for source type 'System.Data.Linq.Table<EMMS.Entity.InspectionSafety>'. 'Select' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq' D:\wwwroot\EMMSDesktop\EMMS.Facade\Inspection\frmRoadSafety.cs 127 34 EMMS.Facade

who help me



Re: LINQ Project General Could not find an implementation of the query pattern for source type

Joe Albahari

You need to add

using System.Linq;

to your namespace imports. The compiler translates comprehension queries into lambda syntax, which require methods called "Where", "Select", "OrderBy", etc to be in scope in order to resolve. Importing the System.Linq namespace puts the Enumerable and Queryable classes in scope, which define these standard querying methods.

Regards
Joe