English 中文(简体)
LINQ to Entites with 2000 issue
原标题:LINQ to Entites with SQL 2000 issue

I m using Linq to Entities. I have the following query in my code, it includes left outer Join:

    var surgeonList = (from item in context.T1_STM_Surgeon.Include("T1_STM_SurgeonTitle")
                                .Include("OTER").Include("OSLP")
                                join reptable in context.OSLP on item.Rep equals reptable.SlpCode into surgRepresentative
                                where item.ID == surgeonId
                                select new
{
    ID = item.ID,
    First = item.First,
    Last = item.Last,
    Rep = (surgRepresentative.FirstOrDefault() != null) ? surgRepresentative.FirstOrDefault().SlpName : "N/A",
    Reg = item.OTER.descript,
    PrimClinic = item.T1_STM_ClinicalCenter.Name,
    Titles = item.T1_STM_SurgeonTitle,
    Phone = item.Phone,
    Email = item.Email,
    Address1 = item.Address1,
    Address2 = item.Address2,
    City = item.City,
    State = item.State,
    Zip = item.Zip,
    Comments = item.Comments,
    Active = item.Active,
    DateEntered = item.DateEntered

})
                                .ToList();

My DEV server has SQL 2008, so the code works just fine. When I moved this code to client s production server - they use SQL 2000, I started getting "Incorrect syntax near ( ".

我曾尝试把供应商Manifest Token改为2000年,在我的编辑档案中,然后我开始“执行这一询问需要PenLY操作员,而后者在2005年8月5日之前没有在服务器的版本中得到支持”。 我把改为2005年,即“接近尾声的yn子”(“回头”)。

任何人都能够帮助我找到工作来实现这一目标?

非常感谢你们。

问题回答

http://msdn.microsoft.com/en-us/library/bb896273.aspx” rel=“nofollow noreferer” 另外,向下列组织转播了join。 我可以允诺这样做,但这是我解决问题的方法。





相关问题
LINQ Training: Native SQL Queries to LINQ

Can anyone point out some good LINQ training resources. Mostly interested in getting some developers that are very skilled with SQL up to speed using Lambda and LINQ queries. They are struggling with ...

How can i write Linq2Entities Query with inner joins

How can I get data from these related entities. I want to get these columns only: Term.Name , related Concept_Term.Weight, related Concept.Id I wrote the SQL but I don t want to use select t....

Linq to enties, insert foreign keys

I am using the ADO entity framework for the first time and am not sure of the best way of inserting db recored that contain foreign keys. this is the code that i am using, I would appreciate any ...

Linq to entity timing problem

I created a data model that has some views from my database as entities,when I create a linq statment that has part of this view s entities ,the time processor take to execute the linq statment is ...

热门标签