This question is almost the same as Intercept SQL statements containing parameter values generated by NHibernate but with no answer so far yet.
Public Class SqlStatementInterceptor
Inherits EmptyInterceptor
Implements IInterceptor
Public Overrides Function OnPrepareStatement(sql As SqlString) As SqlString
Debug.WriteLine(String.Format("{0} - {1}", DateTime.Now, sql.ToString()))
Return sql
End Function
End Class
I can capture SQL statementm, but does not seem to be able to get parameters. Anybody ever tried to achieve it?