CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2008
    Posts
    1

    Question MS Access - Ent Lib 3.1 Connection Problems

    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!

  2. #2
    Join Date
    Dec 2007
    Location
    South Africa
    Posts
    263

    Smile Re: MS Access - Ent Lib 3.1 Connection Problems

    You must Add a Key. This is How the App.Config file

    Code:
    <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

    Code:
       Dim StrCon As String = Configuration.ConfigurationSettings.AppSettings.Get("PDP_AConnectionString");
    Last edited by vuyiswam; August 16th, 2008 at 07:08 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured