2

Working with the latest stable version of MiniProfiler (3.2) I am having an issue where the parameters list for the Command is empty. The SQL of the command is printing out fine through MiniProfiler but the parameters are not actually being removed.

The output of the SQL (as an example) is showing and I believe executing as follows:

   Select person_ID, first_NME, last_NME from Customer where customer_Id = @p0

when the query executes I am getting an error that states: Must declare the scalar variable "@p0

I am able to debug and look at the DBCommand for miniProfiler and it does not have anything in the parameter lists.

Has anyone come across this before? I have already tried setting the SQLFormatter but I don't think that is helping because i don't have any parameters.

Dan
  • 23
  • 5

1 Answers1

0

If you get an error like this:

Must declare the scalar variable "@p0"

That's coming from the ADO.NET driver underneath MiniProfiler (from whichever database you are connecting to - I'm assuming SQL Server here but that applies to all). MiniProfiler's parameter list should be showing empty because it's actually empty, which is the same source of the exception.

But, if you're still seeing this without MiniProfiler and it's somehow interfering...that I'm very interested in.

Note: a lot of this has been rewritten in MiniProfiler v4, currently available in beta on NuGet. After giving it a test this week on Stack Overflow, if all goes well it should see a 4.0 RTM soon after. If you find bugs with v4 please drop me an issue at: https://github.com/MiniProfiler/dotnet/issues and I'll take a look ASAP.

Nick Craver
  • 623,446
  • 136
  • 1,297
  • 1,155