Click here to Skip to main content
11,579,093 members (64,587 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#4.0
can i make location free conntection to msaccess database
Posted 11-Jan-13 20: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 at 12-Jan-13 2:52am
i am facing problem publishing my app.
OriginalGriff at 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
0 OriginalGriff 133
1 Frankie-C 115
2 Afzaal Ahmad Zeeshan 85
3 Richard Deeming 60
4 Richard MacCutchan 60
0 OriginalGriff 933
1 Sergey Alexandrovich Kryukov 740
2 Abhinav S 573
3 F-ES Sitecore 420
4 Dave Kreskowiak 419

Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 12 Jan 2013
Copyright © CodeProject, 1999-2015
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