VB.Net SqlException - Details of failing command's parameters
Posted on 2009-05-02
Is there any way of getting details of the command's parameters that caused a SQLException? Obviously the stack trace shows the failed command but I would like to know the Command's parameters as well.
In good old ADO, the Command was passed as a paramter in the ExecuteComplete event, so you could easily find not only the command text, but also all the paramter values in the failed SQL.
I've just taken over some code which is a mess (lots of random errors) and a generic means of getting details of failed SQL would be more than useful.