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

            t.ShowDialog();
        }