views:

9

answers:

1

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.

A: 

i fear you are going to find that theres is no practical way to do this in your stated case.

Sky Sanders
how about using reflection?
sathish
@sath - what are you going to reflect upon, sathish? The issue is not visibility it is accessibility.
Sky Sanders

related questions