This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Quick question. I am using the free version of LinqPad with the Lightspeed driver. How do I display the SQL that is generated by a Lightspeed query? Thanks |
|
|
Run the query, go to the results pane, and select the SQL button -- see attached screenshot. |
|
|
Thanks for reply. I did look at that SQL tab, but it was empty for my query. Apparently it has something to do with the way I was running the query. See attached screenshots: 1) LinqPadSQL1 shows my query with the results populated in the 'Results' tab. 2) LinqPadSQL2 shows the 'SQL' tab for my query and it's empty. 3) LinqPadSQL3 shows my query modified, and the modified query produced output in the 'SQL' tab. Why didn't the original query populate the 'SQL' tab? (I was getting errors during post ...please remove dup attachments) |
|
|
When you use the implicit unit of work given to you by LinqPad (which is what you do in screenshot #3) then we hook up the SQL logging infrastructure for you. In your first two screenshots however you are creating your own LightSpeedContext with its own logging settings, and creating the UOW from that. So in those cases the logging is not hooked up to LinqPad because LinqPad has no way to override your explicit code. I don't think there's a way around this when hand-building your context, because hooking up the logging bits relies on an object that LinqPad gives to the LightSpeed driver, and I don't think that object is accessible from within a LinqPad snippet. You could however try setting |
|