Add password to connectionstring

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

Guest

Creating a new typed dataset using the Data Source Configuration Wizard (and
opting NOT to save the password with user settings) generates a
ConnectionString setting like...

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\JB74\LISYSTEM.MDB;User
ID=user;Jet OLEDB:System database=C:\JB74\system.mdw

How do I now incorporate "password=xxx" without saving it in app.config?

Thanks
 
You could do this :

string tempConectionnsting = @"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\JB74\LISYSTEM.MDB;User ID=user;{0}Jet OLEDB:System
database=C:\JB74\system.mdw";
string passwordString = "password=xxx";
string finalConectionString =
String.Format(tempConectionnsting,passwordString);
 
Back
Top