郑贤

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<appSettings>
<add key="SQLConnString" value="provider=microsoft.jet.oledb.4.0;data source="/>
<add key="connectionAccess" value="~/DataBase/zwbestdb.mdb"/>
</appSettings>
</configuration>

 

//*********************************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.OleDb;
using System.Configuration;
using System.Web;
using System.Collections;

 

public static readonly string connectionString = System.Configuration.ConfigurationManager.AppSettings["SQLConnString"].ToString() + System.Web.HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["connectionAccess"]) + ";";

posted on 2017-11-16 18:00  郑志岩  阅读(869)  评论(0编辑  收藏  举报