<add key="ConnectionString" value="Provider=Microsoft.Jet.OleDb.4.0;Data Source=MapPath(Northwind.mdb)"/>我要相对路径?
怎么样才行?各位帮帮忙

解决方案 »

  1.   

    <add key="ConnectionString" value="Provider=Microsoft.Jet.OleDb.4.0;Data Source=./Northwind.mdb"/>
    ./表示当前路径。
      

  2.   

    http://community.csdn.net/Expert/topic/5108/5108997.xml?temp=.0381586
      

  3.   

    <appSettings>
           <add key="con" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="></add>
           <add key="data" value="/Data/mdb"></add>
    </appSettings> string myCon=System.Configuration.ConfigurationSettings.AppSettings["con"]+ HttpContext.Current.Server.MapPath("~" + System.Configuration.ConfigurationSettings.AppSettings["data"]);
      

  4.   

    OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Password=;User ID=Admin;Data Source=" + HttpContext.Current.Server.MapPath(@"App_Data\service_applies.mdb") + ";");
      

  5.   

    在web.config中不能使用函数或方法什么的,只能使用绝对的字符串,你可以设置一个相对路径,然后在程序中拼接。
      

  6.   

    就是gjinlin(阿林) 的那个啊