ConnectionString Password gone once Connection is Opened

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

As soon as I open a connection my password in the connection string is gone

For example:
SqlConnection conn = new SqlConnection("Persist Security Info=False;User ID=me;Password=secret;Initial Catalog=Northwind;Data Source=devsql;Connect Timeout=15;")
conn.Open()

now if I watch the conn.ConnectionString as soon as the open occurs the connection string become
"Persist Security Info=False;User ID=me;Initial Catalog=Northwind;Data Source=devsql;Connect Timeout=15;

Where did the password go

Is there anyway to stop this from happening. I want to reuse the connection object but now it doesn't have a password in it

anyhelp would be greatly appreciated

Paul
 
Change "Persist Security Info=False" to "Persist Security Info=True"

More info -
http://msdn.microsoft.com/library/d...cpguide/html/cpconsecureadonetconnections.asp

Paul M said:
As soon as I open a connection my password in the connection string is gone:

For example:
SqlConnection conn = new SqlConnection("Persist Security
Info=False;User ID=me;Password=secret;Initial Catalog=Northwind;Data
Source=devsql;Connect Timeout=15;");
conn.Open();

now if I watch the conn.ConnectionString as soon as the open occurs the connection string becomes
"Persist Security Info=False;User ID=me;Initial
Catalog=Northwind;Data Source=devsql;Connect Timeout=15;"
Where did the password go?

Is there anyway to stop this from happening. I want to reuse the
connection object but now it doesn't have a password in it.
 
Back
Top