Click here to Skip to main content
15,921,959 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I,m Using This Code to Access My DataBase On Local Server Folder Shar Name dbakar

if (new System.Web.UI.Page().Session["GetYear"] != null)
{
string dbPath2 = new System.Web.UI.Page().Server.MapPath("D:/dbakar/"+"rent"+ new System.Web.UI.Page().Session["GetYear"].ToString() + ".mdb");



connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dbPath2;
}

conn.ConnectionString = connectionString;

display This Error
------------------

System.Web.HttpException: 'D:/dbakar/rent2013.mdb' is not a valid virtual path. at System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) at System.Web.HttpServerUtility.MapPath(String path) at GenericDataAccess.CreateCommand() at ShowDataAccess.GetUserAll(Int32 Id_Num, String Pass) at MasterPage.btnLogin_Click(Object sender, EventArgs e
Posted

1 solution

go to http://connectionstrings.com/ you will see the best connection string that suits your project. enjoy
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900