62,039
社区成员
发帖
与我相关
我的任务
分享
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
string SqlStr = ConfigurationSettings.AppSettings["conStr"];
SqlConnection con = new SqlConnection(SqlStr);
con.Open();
if(con.State == System.Data.ConnectionState.Closed)
{
Response.Write("SQL Server数据库连接关闭!!<p/>");
}
}
<appSettings/>
<add key ="conStr"value =" "Server =" WIN-K4VB106AG0A\FDW;User Id = sa;Pwd = ;DataBase = master"/>
</appSettings/>