Connect to database in project with VS 2005 RRS feed

  • Question


    I want to include an Access database in a VS 2005 project to which I can connect. When I follow the data connection wizard, the connection string points to the copy of the Access database in the project folder on my development machine. If I include the Access database as an application file and use this connect string, will the application be able to access the database when installed on a stand-alone computer? I don't see how, unless the installation creates the same project folder on the client machine and places the Access database there.


    Thanks for the help.

    Wednesday, October 10, 2007 12:56 PM

All replies

  • The following should explain how this works:




    Wednesday, October 10, 2007 2:25 PM

  • Paul,

    Thanks for the reply. That link does explain how to access the database included in the project for updating and grabbing data. I am also using that same database to create a dataset. I then update the database through the dataset. Problem is that when I create a new datasource so that I can create the dataset in the designer, the |DataDirectory| method doesn't work. The connnection string has to refer to the database in the project folder. Any ideas?


    Wednesday, October 10, 2007 7:06 PM