示例#1
0
 public Tra(DSTraPhong temp)
 {
     InitializeComponent();
     DSTP = temp;
     try
     {
         if (cn != null && cn.State == ConnectionState.Closed)
         {
             cn.Open();
         }
     }
     catch (SqlException)
     {
         MessageBox.Show("Loi ket noi !!", "Thong bao", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     finally
     {
         cn.Close();
     }
 }
示例#2
0
文件: Tra.cs 项目: HoaLyNg/QLPH
 public Tra(DSTraPhong temp)
 {
     InitializeComponent();
     DSTP = temp;
     try
     {
         string cnstr = "Server = .; Database = QLPH; Integrated Security = true;";
         cn.ConnectionString = cnstr;
         if (cn != null && cn.State == ConnectionState.Closed)
         {
             cn.Open();
         }
     }
     catch (SqlException)
     {
         MessageBox.Show("Loi ket noi !!", "Thong bao", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     finally
     {
         cn.Close();
     }
 }
示例#3
0
文件: Form1.cs 项目: HoaLyNg/QLPH
        private void btnT_Click(object sender, EventArgs e)
        {
            DSTraPhong t = new DSTraPhong();

            t.ShowDialog();
        }