MiniProfiler - SqlParameter

I use the latest version of MiniProfiler, everything is configured and works as I expected. My only problem is that SqlParameters are not displayed.

For example, I run a stored procedure: -

var cmd = dbcon.CreateCommand();
cmd.CommandText = "USP_Admin_Subscription_List";
cmd.CommandType = CommandType.StoredProcedure;

// parameters
cmd.Parameters.Add(new SqlParameter("@UserRef", SqlDbType.NVarChar) { Value = customerRef });

When this is done, I see SQL on the MiniProfiler display, but I do not see the @UserRef parameter and its value.

Is it possible? It would be great to see the meaning, so that I can guarantee that the correct value is being transmitted.

I am using MVC 3

Any advice would be appreciated.

Greetings

J

+5
source share
1 answer

Old questions, but just in case, someone is looking for an answer to this question:

Code example:

    // different RDBMS have different ways of declaring sql parameters - SQLite can understand inline sql parameters just fine
    // by default, sql parameters won't be displayed
    MiniProfiler.Settings.SqlFormatter = new StackExchange.Profiling.SqlFormatters.InlineFormatter();

You need to change it to:

MiniProfiler.Settings.SqlFormatter = new StackExchange.Profiling.SqlFormatters.SqlServerFormatter();

And your options will appear.

+5
source

All Articles