Exemple #1
0
        private void frmBaoCaoKhachHang_Load(object sender, EventArgs e)
        {
            string         sql     = "SELECT * FROM KHACHHANG";
            SqlConnection  sqlConn = new SqlConnection(@"Data Source=DESKTOP-6IA4IHN;Initial Catalog=khomaytinh;Integrated Security=True");
            SqlDataAdapter sqlDa   = new SqlDataAdapter(sql, sqlConn);
            DataTable      dt      = new DataTable();

            sqlDa.Fill(dt);
            rptKhachHang cr = new rptKhachHang();

            cr.SetDataSource(dt);
            rptKhachHang.ReportSource = cr;
        }
        private void frmBaoCaoKhachHang_Load(object sender, EventArgs e)
        {
            string         sql     = "SELECT * FROM KHACHHANG";
            SqlConnection  sqlConn = new SqlConnection(@"server = HP-91149BFA9401\SQLEXPRESS;uid = admin;pwd=admin");
            SqlDataAdapter sqlDa   = new SqlDataAdapter(sql, sqlConn);
            DataTable      dt      = new DataTable();

            sqlDa.Fill(dt);
            rptKhachHang cr = new rptKhachHang();

            cr.SetDataSource(dt);
            rptKhachHang.ReportSource = cr;
        }