Page 1 of 1

Debuggin before submitchanges() ?

Posted: Fri 20 Feb 2009 23:14
by rodusa
How can I debug the generated sql statement before SubmitChanges()?

DbDataContext db = new DbDataContext();
.... // code here

db.SubmitChanges(); // Debug SQL here??????

On SQL Server there is a Visual debug analyzer. Is there anything similar for mysql?

Thank you

Rod

Posted: Mon 23 Feb 2009 15:20
by Shalex
The generated SQL statement cannot be shown before invoking the SubmitChanges() method. But you can see the SQL that was sent to the server after SubmitChanges():
1) either by the help of DBMonitor (refer to our documentation to find out how to use it),
2) or by this code:
StringBuilder sb = new StringBuilder();
databaseContext.Log = new StringWriter(sb);