Last post Aug 14, 2008 02:35 AM by Mikesdotnetting
Aug 14, 2008 02:24 AM|maonisity|LINK
I have successfully connected to the database running on one machine in a web applicaiton (C#). However, when I copy the web application to another machine and run it, I have to re-specify the path of the DB I had in connString below:
String connString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\QuestionAir\App_Data\QuestionDB.mdb";
OleDbConnection connection = new OleDbConnection(connString);
OleDbCommand command = new OleDbCommand();
Is there a way that I can make all machine knows the path of the DB, which is in App_Data directory, automatically?
Aug 14, 2008 02:35 AM|Mikesdotnetting|LINK
String connString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|QuestionDB.mdb";
|DataDirectory| automatically maps it.