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

StackOverflow https://stackoverflow.com/questions/3689365

문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top