Click to See Complete Forum and Search --> : MS Access - Ent Lib 3.1 Connection Problems


jadams2008
May 1st, 2008, 02:16 PM
I am trying to access MS-Access Db using Ent Lib 3.1
In the app.config file, I changed the settings as required.
But I am getting error in connecting. Can some one please help?

<add name="PDP_AConnectionString"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot;D:\1-work\00_SDP\02-SDP Access\PDP A.mdb&quot;"
providerName="System.Data.OleDb" />

Thanks in advance!

vuyiswam
August 12th, 2008, 08:54 AM
You must Add a Key. This is How the App.Config file


<add Key ="PDP_AConnectionString" Value ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot;D:\1-work\00_SDP\02-SDP Access\PDP A.mdb&quot;User Id=;Password;"
providerName="System.Data.OleDb" ></add>


and in your C# Code you can Access it like this


Dim StrCon As String = Configuration.ConfigurationSettings.AppSettings.Get("PDP_AConnectionString");