How to maintain SqlConnection (or use another component) always (connected) always during the execution of my .Net application?
I need this because my application must detect using this commnad
exec sp_who2
how many instances of my application are connected to mydatabase to restrict access (license control).
Example
A) my application is made from location1
- check the number of my applications connected to sql server using
exec sp_who2 - if the number of my applications is <MaxLicencesConnected , then start my application and open sqlconnection
B) my application is made from location2
- check the number of my applications connected to sql server using
exec sp_who2 - if the number of my applications> = MaxLicencesConnected , close my application
sorry for my English.
early.
Salvador
source share