コード例 #1
0
        private void frmBaoCaoNhanVien_Load(object sender, EventArgs e)
        {
            SqlConnection  sqlConn = new SqlConnection(@"Data Source=DESKTOP-AQEI1KT\SQLEXPRESS;Initial Catalog=khomaytinh;Integrated Security=True");
            string         sql     = "SELECT *FROM NHANVIENKHO";
            SqlDataAdapter sqlDa   = new SqlDataAdapter(sql, sqlConn);
            DataTable      dt      = new DataTable();

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

            cr.SetDataSource(dt);
            crystalReportViewer1.ReportSource = cr;
        }
コード例 #2
0
        private void frmBaoCaoNhanVien_Load(object sender, EventArgs e)
        {
            SqlConnection  sqlConn = new SqlConnection(@"server = HP-91149BFA9401\SQLEXPRESS;uid = admin;pwd=admin");
            string         sql     = "SELECT *FROM NHANVIENKHO";
            SqlDataAdapter sqlDa   = new SqlDataAdapter(sql, sqlConn);
            DataTable      dt      = new DataTable();

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

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