Call custom function after every sqlConnection.Close()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sachinkale123
    New Member
    • Jul 2007
    • 37

    Call custom function after every sqlConnection.Close()

    Hi I working on a application which is recording open and close connections time.

    Now I want to call my custom function which will write data in to database as soon as connection is closed.

    I manually can write function by finding.. sqlConnection.C lose() but
    Is there any other way by which I would come to know that sqlConnction.Cl ose is called and I an invoke my method.

    Thanx in advance.
  • vekipeki
    Recognized Expert New Member
    • Nov 2007
    • 229

    #2
    Can you handle the StateChange event of your SqlConnection? StateChangeEven tArgs will then contain the new ConnectionState .

    Comment

    Working...