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

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