Пример #1
0
 void LoadData()
 {
     try
     {
         dgvHD.DataSource = dbHD.LayHD();
         this.txtMaKH.ResetText();
         this.txtTenKH.ResetText();
         this.txtDiaChi.ResetText();
         this.txtDienThoai.ResetText();
         this.txtBienSo.ResetText();
         this.cmbLX.ResetText();
         this.mskNgayGui.ResetText();
         this.cmbHinhThuc.ResetText();
         //
         this.btnLuu.Enabled   = false;
         this.btnHuyBo.Enabled = false;
         this.btnThem.Enabled  = true;
         this.btnSua.Enabled   = true;
         this.btnXoa.Enabled   = true;
         this.btnThoat.Enabled = true;
     }
     catch (SqlException)
     {
         MessageBox.Show("Không lấy được dữ liệu!!!");
     }
 }
Пример #2
0
        private void frmHoaDon_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'QLXeDataSet.QLHoaDon' table. You can move, or remove it, as needed.
            // TODO: This line of code loads data into the 'QLXeDataSet1.QLKhachHang' table. You can move, or remove it, as needed.
            //// TODO: This line of code loads data into the 'QLXeDataSet.QLHoaDon' table. You can move, or remove it, as needed.
            //// TODO: This line of code loads data into the 'QLXeDataSet1.QLKhachHang' table. You can move, or remove it, as needed.
            ReportDataSource datasource = new ReportDataSource("HoaDon", dbHD.LayHD());

            this.reportViewer1.LocalReport.DataSources.Clear();
            this.reportViewer1.LocalReport.DataSources.Add(datasource);

            this.reportViewer1.RefreshReport();
        }