Using a relative path in connection string for Access DB in C#

后端 未结 1 551
余生分开走
余生分开走 2020-12-11 21:09

I\'m trying to get this line in my web.config file to use a relative path instead of hardcoded one, but nothing seems to be working. I can only find stuff for SQL and mySQL

相关标签:
1条回答
  • 2020-12-11 22:00

    I looked around and got it working. I inserted this line into the Application_Start method of the Global.asax file

    AppDomain.CurrentDomain.SetData("DataDirectory", Server.MapPath("~/App_Data/"));
    
    0 讨论(0)
提交回复
热议问题