protected void GridViewBind() { JudgeProblem judgeproblem = new JudgeProblem(); //创建判断题对象 DataSet ds = judgeproblem.QueryJudgeProblem(int.Parse(ddlCourse.SelectedValue)); //根据试卷科目查询判断题信息 GridView1.DataSource = ds.Tables[0].DefaultView; //为GridView控件指名数据源 GridView1.DataBind(); //绑定数据 }
//显示选择科目的判断题 protected void ddlCourse_SelectedIndexChanged(object sender, EventArgs e) { JudgeProblem judgeproblem = new JudgeProblem(); //创建单选题对象 DataSet ds = judgeproblem.QueryJudgeProblem(int.Parse(ddlCourse.SelectedValue)); //根据试卷科目查询单选题信息 GridView1.DataSource = ds.Tables[0].DefaultView; //为GridView控件指名数据源 GridView1.DataBind(); //绑定数据 }