reuse connection object with diff username password?
- From: jtbr
- Date: Wed, 22 Nov 2006 08:43:06 -0800
I have an ado.net based application (using BDP borland data provider actually). Everything is working fine. Up till now the connection string for my single connection object has been hard coded. set in designer. Now its time to implement login functionality using different user names and passwords. For a 'login' I figured, ok i'll close the connection if its open, then just change the ConnectionString. I set the exact same connection string as designer, I just set different username & password values.
The second time I run thru this cycle however I get strange exceptions when trying to close the connection. "No pool found to release connection". Then when I go to use it I get "connection already open".
The big question is, are connection objects meant to be reused in this manner, or must I new a new connection instance if I want to have a different connection string?
thanks
---
Posted via DotNetSlackers.com
.
- Follow-Ups:
- Re: reuse connection object with diff username password?
- From: Cor Ligthert [MVP]
- Re: reuse connection object with diff username passwor ...
- From: jtbm
- Re: reuse connection object with diff username password?
- From: William \(Bill\) Vaughn
- Re: reuse connection object with diff username password?
- Prev by Date: RE: Trouble displaying info from access db
- Next by Date: Re: Beginning question for Access OLEDBUpdate command
- Previous by thread: SqlTransaction rollback error
- Next by thread: Re: reuse connection object with diff username password?
- Index(es):
Relevant Pages
|
Loading