Linq throws errors since upgrade to 3.0

Posts   
 
    
Posts: 42
Joined: 22-Jan-2007
# Posted on: 27-Aug-2010 10:22:13   

Am i doing something wrong ? As soon as I make some sort of linq call i get weird errors like this one:

Line 1: Incorrect syntax near '('. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '('.

Source Error:

Line 107: LinqMetaData lm = new LinqMetaData(_da); Line 108: Line 109: return Convert.ToInt64(lm.Artikelen.Count());

I used the 3.0 designer and adapter templates.

These llblgen dll are in the bin directory: ORMsupportclass 3.0.10.0817 Linq Supportclass 3.0.10.0809 SQLserverDQE version 3.0.10.0729

The project is asp.net mvc 4.0 in vs 2010. Everything worked fine in 2.6.

EDIT: Oops, I guess I should have posted this in the helpdesk forum section. But maybe someone else might suffer from the same problem in the future simple_smile .

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 27-Aug-2010 10:46:45   

I guess you're running on SQL server 2000? The dqe compatibility is now by default set to 2005+, so set the DQE compatibility to 1 (see documentation: application configuration through config files for details)

Frans Bouma | Lead developer LLBLGen Pro
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 27-Aug-2010 10:50:25   

I tried to reproduce it with v.3.0 (Adapter), VS 2008, Windows Application. Using the following code:

            var metaData = new LinqMetaData(new DataAccessAdapter());
            var q = metaData.Customer.Count();

            MessageBox.Show(q.ToString());

But it ran successfully.

I don't think ASP.NET & MVVM has anything to do with this. Also, I doubt VS version can make a difference here , but anyway can you test this on VS 2008?

Posts: 42
Joined: 22-Jan-2007
# Posted on: 27-Aug-2010 11:04:13   

Otis wrote:

I guess you're running on SQL server 2000? The dqe compatibility is now by default set to 2005+, so set the DQE compatibility to 1 (see documentation: application configuration through config files for details)

Thanks ! That fixed it. For some obscure reason I cannot remember at the moment we still use a 2000 server as our development server.

I don't think ASP.NET & MVVM has anything to do with this.Also, I doubt VS version can make a difference here , but anyway can you test this on VS 2008?

Yes I didn't think it was relevant either, but from my brief days on helpdesk duty, I remember to give as much info as possible simple_smile . Thanks for the help !