Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# Constructor 11/9/2008 7:25 PM
I am trying to get the database connection string (complete with password) from the 'properties.config'.

I have used: this._sessionManager.OpenSession().Connection.ConnectionString;

I do not get the full connection string back. I wish to use conect to the database manually to do some work.

Can anyone help?
# martijnb 11/9/2008 8:43 PM
What does the connectionstring that is returned look like?
# Constructor 11/9/2008 10:06 PM
In the 'properties.config':

<connectionString>Server=myPC\sqlexpress;Initial Catalog=dbPrinters;User ID=dbPrintersUser;Password=dbPrintersPassword1!;</connectionString>


and the returned string is:

Server=myPC\sqlexpress;Initial Catalog=dbPrinters;User ID=dbPrintersUser;

# martijnb 11/10/2008 10:06 AM
Hmmm, maybe it just doesn't return the password for security reasons? I don't know.

As an alternative, you can directly use the Connection object from the session.