Exemple #1
0
        private void btntim_Click(object sender, EventArgs e)
        {
            daSach = new SqlDataAdapter("Select * From NhanVien where MaNV like '%" + txttim.Text.ToString() + "%'", conn);
            dtSach = new DataTable();
            dtSach.Clear();
            daSach.Fill(dtSach);
            CrystalReport4 rp = new CrystalReport4();

            rp.SetDataSource(dtSach);
            crystalReportViewer1.ReportSource = rp;
        }
Exemple #2
0
 private void repotnhanvien_Load(object sender, EventArgs e)
 {
     try
     {
         daSach = new SqlDataAdapter("Select * From NhanVien", conn);
         dtSach = new DataTable();
         dtSach.Clear();
         daSach.Fill(dtSach);
         CrystalReport4 rp = new CrystalReport4();
         rp.SetDataSource(dtSach);
         crystalReportViewer1.ReportSource = rp;
     }
     catch (SqlException)
     {
         MessageBox.Show("Không Lấy Được Dữ Liệu");
     }
 }