Connecting to NorthWind Access Database?

Posted on 2007-10-03
Last Modified: 2012-05-05
I am trying to connect to an Access Database to do some testing, I have the following:

public System.Data.DataSet GetAuthorData(string lcID)
        if (lcID == "")
            lcID = "%";

        DataSet ds = new DataSet();
       //create the database connection
        OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\Northwind 2007.accdb");
        OleDbDataAdapter oAdapter = new OleDbDataAdapter();
        //create the command object and store the sql query
        OleDbCommand aCommand = new OleDbCommand("select * from Customer List where ID like '" + lcID + "%'", aConnection);

            //create the datareader object to connect to table
            OleDbDataReader aReader = aCommand.ExecuteReader();
            Console.WriteLine("This is the returned data from emp_test table");

            oAdapter.SelectCommand = aCommand;
            oAdapter.Fill(ds, "Authors");

            //close the reader

            //close the connection Its important.

        //Some usual exception handling
        catch(OleDbException e)
            return null;

        return ds;

@  aConnection.Open();

An exception is thrown and the result is null. So I believe the connection is the issue:

        OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\Northwind 2007.accdb");

Any ideas on what may be wrong with the connection?
Question by:directxBOB
    LVL 29

    Expert Comment

    by:Gautham Janardhan
    what sort of exception
    LVL 10

    Expert Comment

     OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\Northwind2007.accdb");

    There should be no space.

    Author Comment

    base {System.Data.Common.DbException} = {"Could not find installable ISAM."}
    LVL 29

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now