What would happen if i stored a open connection object in a application variable and made it the only connection that i use.Would it improve performance.Crash out. Become terribly slow. Just an idea.
You should really be using connection pooling. Create a new connection each time you need one using the exact same connection string. When you're finished with it, dispose it and the pool will do the rest for you.
Don't keep the same connection constantly open because you'll have problems with multiple datareaders trying to use it simultaneously and throwing an exception.
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.