一、Web.config设置 将 <add key="ConnectionString" value="server=127.0.0.1;database=codematic;uid=sa;pwd=1"/> 改为 add key="ConnectionString" value="provider=microsoft.jet.oledb.4.0;data source= "/> <add key="dbPath" value="~/App_Data/Data.mdb"/>
二、DbHelperOleDb.cs设置 加:using System.Web; 将 public static string connectionString = PubConstant.ConnectionString; 改为 public static string connectionString = ConfigurationManager.AppSettings["ConnectionString"].ToString() + HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["dbPath"]) + ";";
|