I have a query that should always be returning a single int. I have now logged it returning a string entirely unrelated to what it should be.
We\'ve been ge
The ExecuteScalar() function's return type is object, and you declare your result variable with the var keyword. That's not really a good combination, because you're putting a lot of pressure on the system to get the type inference right.
object
var