1。数据库链接字符串
ole:StrCnn = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" + Server.MapPath("")
sql:strcnn="server=localhost;user id=sa;pwd=fluxay;database=db_gxlv_com"
在web.config中定义
<appSettings>
<add key="ConnectionString" value="server=localhost;user id=sa;pwd=fluxay;database=db_gxlv_com" />
</appSettings>
取得时:strcnn = ConfigurationSettings.AppSettings("connectionstring")