Dim moConn As System.Data.SqlClient.SqlConnection
moConn = CType(Application.StaticObjects.Item("MyConnection"), System.Data.SqlClient.SqlConnection)
BTW: It is VERY BAD idea having Connection object as global object. Because of connection pooling it is much better to create, use and destroy (close) connection to database as quickly as possible.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.