Resulting sql

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Posts: 10
Joined: Tue 14 Apr 2009 11:46

Resulting sql

Post by iOgre » Fri 30 Oct 2009 19:36

Is there any way to get resulting sql query?

(at the moment of DataContext.SubmitChanges() execution, for example)

Site Admin
Posts: 8241
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 02 Nov 2009 09:16

You can get the queries executed in the context using its Log property:

Code: Select all

DataContext1.DataContext1 ctx = new DataContext1.DataContext1();
StringBuilder sb = new StringBuilder();
ctx.Log = new StringWriter(sb);

Post Reply