views:

41

answers:

2

I'm using DbLinq with SQLite for a small project of mine. Is there any way to look at the actual SQL queries that get executed behind the scenes?

I remember a monitoring program for SQL Server from my internship but SQLite is a quite different beast, I fear.

A: 

If you're using Visual Studio 2010 Premium or Ultimate you may find the Tier Interaction Profiler helpful. There was a good blog post recently on Skinner's Blog over on MSDN that included viewing the generated SQL code

Kefala
Hm, might take a few days to get my hands on Ultimate. Will that profiler work with databases other than SQL Server?
Joey
From his follow up post I believe that the TIP is actually hooked in to ADO.NET so provided that you're accessing your DB through a compatible driver then it should hook properly. Caveat is that it needs to be web application/site or the TIP won't work as per that blog post but his follow up one shows a work around. http://blogs.msdn.com/b/camerons/archive/2010/09/06/tip-support-for-any-ado-net-app.aspx
Kefala
+2  A: 

Your database context should have a Log property of type TextWriter. If you assign context.Log = Console.Out; for example, you should get the SQL written out to the console.

Gabe