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
Debuggin before submitchanges() ?
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);
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);