MiniProfiler not showing sql timing when using ProfiledDbDataAdapter

时间:2019-03-19 15:05:38

标签: asp.net miniprofiler

I'm currently trying to add MiniProfiler (v4) to a WebForms/MVC hybrid application and when trying to fit it into some older ADO.NET calls it isn't showing the timing of the profiled queries. It always shows 0.0ms. Our newer calls using Dapper are showing proper timings. Can anyone help me figure out what I'm doing wrong?

using (var con = GetDatabaseConnection(command.Connection?.ConnectionString)) // returns new ProfiledDbConnection based on connection string
{
    DbCommand cmd = GetDbCommand(con, command); // Creates DbCommand, using connection.CreateCommand() and data from a passed in SqlCommand object

    using (var da = new ProfiledDbDataAdapter(new SqlDataAdapter()))
    {
        da.SelectCommand = cmd;

        con.Open();
        da.Fill(dataSet);
    }
}

enter image description here enter image description here

0 个答案:

没有答案