|
-
Dec 2nd, 2004, 10:31 AM
#1
Thread Starter
Frenzied Member
path for database in connection string
Hello,
I have a database application in my connection string l have the following.
OleDbConnection cnnTeacher = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Library\LibrarySystem.mdb;Persist Security Info=False");
But if want to install this program on another machine l don't want to have to change every connection string. Is there an easy way to do this.
The database is in the same folder that the solution is in.
Thanks in advance,
Steve
-
Dec 2nd, 2004, 11:44 AM
#2
Frenzied Member
Two ideas come to mind, probably others as well. One, if you're sure it's in the same place as the executable, you can use Application.StartupPath or for more flexibility, stick it in the .config file and grab it through code with the ConfigurationSettings class.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|