私はmini profilerと統合したいWebフォームアプリケーションに既存のdb接続関数を持っています。私はミニプロファイラーをインストールして、アプリケーションで実行しているが、私はデータベース部分が正しく接続されるように見えることはできません。以下はdbに接続するコードの一部です。Mini ProfilerはSqlConnectionと統合します
public override IEnumerable<IDataRecord> Execute()
{
using(SqlConnection conn = new SqlConnection(ConnectionString)) {
using(SqlCommand command = new SqlCommand(CommandText, conn)) {
command.CommandType = SQLCommandType;
foreach(SqlParameter p in ParamsToAdd) {
command.Parameters.Add(p);
}
conn.Open();
SqlDataReader rdr;
try {
rdr = command.ExecuteReader();
} catch(Exception ex) {
//log error
}
using(rdr) {
while(rdr.Read()) {
yield return (IDataRecord)rdr;
}
}
}
}
}
私は簡単そうのような)のExecuteReader(周りのステップを置くことができます。
using(MiniProfiler.Current.Step(command.CommandText)) {
rdr = command.ExecuteReader();
}
が、これは、トレースなどとして有用な程度のミニプロファイラを行い、私は、クエリは上の示された特徴を取得したいと思っていますサイト。どんな助け?
この作業を試みても、「ミニプロファイラにはデータの定義が含まれていません」と表示されます。 – ThunD3eR