using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;namespace Test
{
    public partial class Demo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SqlConnection conn = new SqlConnection();
                conn.ConnectionString = "Data Source=.;Initial Catalog=CRM;Integrated Security=True";
                conn.Open();                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "select * from dept;";
                cmd.CommandType = CommandType.Text;
                cmd.Connection = conn;
                conn.Close();
                Response.Write("<script> alert('链接成功!') </script>");
            }
            catch
            {
                Response.Write("<script> alert('链接失败!') </script>");
            }
            
        }        protected void BtnLogin_Click(object sender, EventArgs e)
        {
            
        }    }
}