Click here to Skip to main content
12,688,907 members (29,677 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# C#4.0
can i make location free conntection to msaccess database
Posted 11-Jan-13 21:46pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can't - to connect to a database (of any type) you must identify the DB and / or the DB engine you wish to use.
For Access files directly, you have to specify which file you wish to connect to. For SQL you specify which SQL Sever instance you want, then connect to the DB by name - the service instance is a "location" in that sense.
Muhamad Faizan Khan 12-Jan-13 2:52am
i am facing problem publishing my app.
OriginalGriff 12-Jan-13 3:07am
Sorry, I don't understand from that little what your problem is.
Remember that we can't see your screen, access your HDD, or read your mind.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

If this is a publishing problem concerning your application, include the database files in your project and set their properties so that the files are copied (but not compiled) into the output directory.

This way the initial database is always in the same directory where the executable is and if published for example using ClickOnce, you can include the database in the publication.

If this is a multi user situation (concerning the database), then I'd suggest creating a separate setup process to set up the database portion centrally and the applications would be installed separately.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170113.4 | Last Updated 12 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100