Executing OleDBConnection.Open erases the password from Connection string

  • Thread starter Thread starter RZavulunov
  • Start date Start date
R

RZavulunov

I have just stumbled upon this fact. My scenario is the following:
From a web browser i click a button which fires of a call to retrieve
data from a table in Oracle. In the same call, i do another retrieve
using the same connection object. The second retrieve crashes becuase
there is no password in the ConnectionString. My debugging showed me
that it was when the connection was opened that the connectionstring
was altered. Is this a bug or a feature?
 
So essentially you're doing something like this

OracleConnection cn = new OracleConnection(ConnectionString);
OracleCommand cmd = new OracleCommand("sqlstatement", cn);
//Open connection0
cmd.Executexxx();
//now if you do anything with that same connection, the password is gone?
 
Are you sure that is why? For some reason I feel like I remember that when
you look in the connection string property, the password is never shown for
security reasons. So it's not that it wasn't there after the second time -
it wasn't there the first time either because it is never shown.

Maybe you should tell us exactly what the error message is.
 
Back
Top