Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Posts
    5

    Arrow Unanswered: Openning an access database using ADO.NET

    What is the proper way to open an access database using ADO.NET (that is, using c#) ?
    I have the following code, but somehow it does not compile saying that it doesn't find the mdb file called PhoneBook :
    Code:
    OleDbConnection Myconnection = null;
    Myconnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\PhoneBook");
    Myconnection.Open();
    What am I doing wrong here ?
    All help appreciated !

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Stab in the dark:
    change C:\PhoneBook to include the file extension i.e. C:\PhoneBook.mdb
    George
    Home | Blog

  3. #3
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313

Posting Permissions

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