你可以在global.asax.cs的Application_Start事件中加入
Application["strconn"]=连接字符串
然后再程序中直接引用
strconn=Application["strconn"];
就可以了