如何添加密码连接字符串

时间:2014-02-12 09:35:57

标签: connection-string

如何在下面提到的连接字符串中添加密码

 <connectionStrings>
    <add name="Gate_App.My.MySettings.GateDbConnectionString1" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\GateDb.accdb;Persist Security Info=True "
        providerName="System.Data.OleDb" />
</connectionStrings>

3 个答案:

答案 0 :(得分:1)

使用它 <connectionStrings> <add name="Gate_App.My.MySettings.GateDbConnectionString1" connectionString=" Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\GateDb.accdb; User ID=*******; Password='*******';Persist Security Info=True " providerName="System.Data.OleDb" /> </connectionStrings>

答案 1 :(得分:0)

试试这个,

 <add name="Gate_App.My.MySettings.GateDbConnectionString1" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\GateDb.accdb;User Id=id;Password=pass;" providerName="System.Data.OleDb" /

答案 2 :(得分:0)

<connectionStrings>
    <add name="Gate_App.My.MySettings.GateDbConnectionString1" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=|DataDirectory|\GateDb.accdb;Persist Security Info=True;User ID=myUsername;Password=myPassword;"
            providerName="System.Data.OleDb" />
    </connectionStrings>

Access connection strings