tags:

views:

12

answers:

1

Hello everybody ::- ). I hope somebody wants some easy reputation by answering a simple question ::- ). How are you? Ok... joking ::- D.

The question is about how LINQ to Entities works with SQL Compact.

  • First of all, is there any way to profile stuff sent to an SQL Compact database? Apparently the Microsoft SQL Server Profiler does not work on SQL Compact databases... well... that's to be expected. But is there any other way to see the SQL query resulting from a LINQ select? Specifically:

    IQueryable<some_table> query = from v in SomeEntity.some_table select v;
    

I am using some extension methods I found via Google to apply a "where" to the above select. Normally in Entity Framework you can't do that with LINQ (in .Net 3.5) but there are some workarounds.

What I want to do is verify if the workarounds get ALL the data from the table and then cheaply filter it, or if they are doing the RIGHT THING and only get the data that I asked for.

  • Secondly, do you know for sure that the statement below does NOT bring all the data in the table and puts it in memory after which does a cheap filter on it? (gosh I'd like a profiler to see what that dude is doing over there in the back-stage).

    from v in SomeEntity.some_table where v.some_column == some_int_value select v;
    
+1  A: 

I'll give you 2 answers: first, check out this link: http://stackoverflow.com/questions/1412863/how-do-i-view-the-sql-generated-by-the-entity-framework

Second, have a look at EF Prof.

Steve Michelotti
Hello Steve and thanks for answering ::- ). Unfortunately EF Prof is not free ::- /. But I guess I could go for a trial, of course.
Axonn