我做毕业设计就用到了,下面的是部分代码!包括自动生成的,最后是如果取得连接字符串
................
<appSettings>
<add key="strConn" value="provider=Microsoft.Jet.OLEDB.4.0;Data Source=" />
<add key="dbPath" value="/App_Data/main.mdb"/>
</appSettings>
.......................
<authentication mode="Windows"/>
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1;42424"
cookieless="false"
timeout="20"
/>
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"/>
/////取得字符串
public string GetConnString()//获得连接字符串
{
string strConn = "";
strConn = System.Configuration.ConfigurationManager.AppSettings["strConn"] + System.Web.HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["DataPath"]) + "\\App_Data\\main.mdb;";
return strConn;
}