Viewing the generated SQL of LINQ statements

Posts   
 
    
jbreuer
User
Posts: 43
Joined: 30-Nov-2009
# Posted on: 10-Dec-2009 08:39:49   

Hello,

I would like to view the generated SQL of LINQ statements. I found the following example at http://jagchat.spaces.live.com/blog/cns!41050F68F010A662!1224.entry?wa=wsignin1.0&sa=222439930, but that's for LINQ to SQL.


Dim obj As New SampleDAL.SampleDataContext
        Dim s As New StringWriter
        obj.Log = s
        Me.GridView1.DataSource = From p In obj.emps _
                                  Where p.deptno = 10 _
                                  Select p
        Me.GridView1.DataBind()
        Me.Label1.Text = s.ToString

How can this be done Using LINQ to LLBLGen?

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 10-Dec-2009 08:48:23   

Please go to the Troubleshooting section of the Using the Generated Code in the Manual, and there you will find how to turn tracing on to see the generated SQL queries in the output window of VS when debugging.

jbreuer
User
Posts: 43
Joined: 30-Nov-2009
# Posted on: 10-Dec-2009 10:37:17   

Thank you for the info!

Guess there isn't a way to do it like the following example?

http://weblogs.asp.net/scottgu/archive/2006/09/01/Understanding-LINQ-to-SQL-Query-Translations.aspx

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39863
Joined: 17-Aug-2003
# Posted on: 10-Dec-2009 10:45:23   

Not at the moment. We hope to have something soon (hint: linqpad wink )

Frans Bouma | Lead developer LLBLGen Pro