我当前正在尝试通过MySQL连接使用mvc-mini-profiler。有没有一种方法可以通过某种自定义包装器来做到这一点呢?
var mysqlConn = new MySqlConnection("Data Source=localhost; ...");
string commandText = "SELECT ...";
ProfiledDbConnection profiledConn = new ProfiledDbConnection(mysqlConn, MiniProfiler.Current);
var sqlCom = new MySqlCommand(commandText, profiledConn); // error, expects MySQLConnection, not DBConnection谢谢!
发布于 2011-09-08 09:05:17
使用:
var sqlCom = profiledConn.CreateCommand();
sqlCom.CommandText = commandText; 截获命令对于分析正常工作至关重要。
https://stackoverflow.com/questions/7321336
复制相似问题