Esempio n. 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();
     }
 }
Esempio n. 2
0
File: Tra.cs Progetto: 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();
     }
 }
Esempio n. 3
0
        private void btnT_Click(object sender, EventArgs e)
        {
            DSTraPhong t = new DSTraPhong();

            t.ShowDialog();
        }