private void btnBaoCao_Click(object sender, EventArgs e)
 {
     DataTable dt = new DataTable();
     SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=qlks3lop;Integrated Security=True");
     SqlCommand com = new SqlCommand();
     SqlDataAdapter da = new SqlDataAdapter();
     com.CommandText = "thongkedatphong " + cmbThang.Text + "," + cmbNam.Text;
     com.Connection = con;
     con.Open();
     da.SelectCommand = com;
     da.Fill(dt);
     FormCRThongKeDatPhong frm = new FormCRThongKeDatPhong();
     frm.frmTK = this;
     frm.frmMain = this.frmMain;
     frm.dt = dt;
     frm.ShowDialog();
 }
Example #2
0
        private void btnBaoCao_Click(object sender, EventArgs e)
        {
            DataTable      dt  = new DataTable();
            SqlConnection  con = new SqlConnection("Data Source=.;Initial Catalog=qlks3lop;Integrated Security=True");
            SqlCommand     com = new SqlCommand();
            SqlDataAdapter da  = new SqlDataAdapter();

            com.CommandText = "thongkedatphong " + cmbThang.Text + "," + cmbNam.Text;
            com.Connection  = con;
            con.Open();
            da.SelectCommand = com;
            da.Fill(dt);
            FormCRThongKeDatPhong frm = new FormCRThongKeDatPhong();

            frm.frmTK   = this;
            frm.frmMain = this.frmMain;
            frm.dt      = dt;
            frm.ShowDialog();
        }