Ejemplo n.º 1
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            Report.BangDiem obj   = new Report.BangDiem();
            string          maLop = lop.Select(string.Format("tenlop ='{0}'", comboBox1.Text.Trim()))[0][0].ToString();
            string          maMH  = monHoc.Select(string.Format("[Tên môn học] ='{0}'", comboBox2.Text.Trim()))[0][0].ToString();
            int             lan   = Convert.ToInt32(comboBox3.Text);

            string[]  name     = { "@mamh", "@malop", "@lan" };
            object[]  param    = { maMH, maLop, lan };
            DataTable bangDiem = DBAccess.ExecuteQuery("SP_LayBangDiem", name, param, 3);

            obj.SetDataSource(bangDiem);
            obj.SetParameterValue("@malop", maLop);
            obj.SetParameterValue("@mamh", maMH);
            obj.SetParameterValue("@lan", lan);
            obj.SetParameterValue("tengv", DBAccess.hoTen);
            crptView.ReportSource = obj;
        }