I have a SQL CLR Trigger that has a number of SqlDataReader
calls in it (among other things), where in the production system users are getting errors like
A .NET Framework error occurred during execution of user-defined routine or aggregate "MyTrigger":
System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.
System.InvalidOperationException:
at
System.Data.SqlClient.SqlInternalConnectionSmi.ValidateConnectionForExecute(SqlCommand command)
...
however I am unable to reproduce this in my test env. I am considering setting MutltipleActiveResultSets=true
, but of course there is no connection string to define in the CLR Trigger (or is there...) - so is it possible to set MARS
to true somewhere here, or do I need to keep looking for an alternate solution?