I need to execute a stored procedure in the DB every time a connection is created/opened. So I though I could handle the state change event of dbconnection/sqlconnection.
Is there a way to handle them globally? I dont know where the connections are opened in my program, so I dont have access to the sql connection objects individually.
P.S. i use enterprise library to handle dataconnections, but I also open sql connection myself rarely.
So, I want to handle the statechange event of sqlconnection/dbconnection globally for all instances and call a stored procedure for that instance.