using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("<center><b>测试数据库连接</b></center>");
string connString = "server=localhost;uid=sa;pwd=sa;database=MyChatroom";
try{
SqlConnection myconnection=new SqlConnection(connString);
myconnection.Open();
Label1.Text="连接成功";
}
catch{
Label1.Text="连接失败";
}
}
}