views:

68

answers:

1

I have a simple query running on both .NET 3.5 and .NET 4, something like this:

var x = from o in Orders
        join ot in OrderTypes on o.OrderTypeId equals ot.OrderTypeId
        where or.OrderTypeName.Contains("sales")
        select o;
var y = x.ToList();

The identical code runs on both .NET 3.5 and .NET 4, connecting to the same DB, with both dbml files generated in the respected .NET versions. Both returns the correct number of records (about 350 records). DB tables are indexed correctly. Both running in debug mode in VS 2008 and VS 2010 respectively. When I run the query in T-SQL directly in SQL Mgmt Studio, it runs fast, almost instantly. So this is definitely not a problem with the DB objects.

Here is the problem: the one running in .NET 3.5 runs fast (as it should be, less than 1 sec, I do not have precise measurement, but it's almost instant). But the one running in .NET 4 takes longer than 5 seconds.

Anybody know why is this? Or ... help?

A: 

You could try disabling IntelliTrace in VS 2010.

Kris
It was the Intellitrace, yes! Thanks!
Johannes Setiabudi