Last post May 27, 2008 02:40 PM by mbanavige
May 27, 2008 02:23 PM|EduardoAndres|LINK
I'm having a problem connecting to my database in the server:
This is my current connection:
OleDbConnection Conn = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source=~/Appointments.mdb");
But I'm getting this error:
How can i fix this?
May 27, 2008 02:26 PM|mbanavige|LINK
to protect your database, you can move it to the App_Data folder.
Then you can check here for the DataDirectory connection string syntax
May 27, 2008 02:35 PM|EduardoAndres|LINK
Thanks for your response. Yes, I had my connection as the one it was in the article you shared with me. However, when i uploaded my Web app to my web server, it gives me the error I mentioned in the last post. And it makes sense, my web servr does not have
a C: drive and I would like to create something where my application looks inside the root folder without specifying a speficic path ... for example ~/ database name ... but it does not work either ... any ideas?
May 27, 2008 02:40 PM|mbanavige|LINK
If your database is in the App_Data folder then this connection string is in the format you want:
If your database is not in the App_Data directory, then you have a security risk and should consider moving it there.