Add password to connectionstring

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
 
D

dahuzizyd

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);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top