sqllinq-to-sqlsqlitedblinq

How can I find out the exact query that gets executed with LINQ to SQL in DbLinq and SQLite?


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.


Solution

  • 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.