您目前尚未登陆,请选择【登陆】或【注册
首页->行政办公->多功能在线考试系统源码>>Web/TestAnswer.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:多功能在线考试系统源码
当前文件:文件类型 OnLineExam/Web/TestAnswer.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11using MyOnLineExam.DataAccessLayer; 12using System.Data.SqlClient; 13using MyOnLineExam.BusinessLogicLayer; 14 15public partial class Web_TestAnswer : System.Web.UI.Page 16{ 17 protected void Page_Load(object sender, EventArgs e) 18 { 19 if (!IsPostBack) 20 { 21 lblPaperName.Text = Session["PaperName"].ToString(); 22 InitData(); 23 } 24 } 25 //初始化试卷,从数据库中将试题取出 26 protected void InitData() 27 { 28 SqlParameter[] Params1 = new SqlParameter[2]; 29 DataBase DB = new DataBase(); 30 int paperID = int.Parse(Session["PaperID"].ToString()); 31 Params1[0] = DB.MakeInParam("@PaperID", SqlDbType.Int, 4, paperID); //试卷编号 32 Params1[1] = DB.MakeInParam("@Type", SqlDbType.VarChar, 10, "单选题"); //题目类型 33 DataSet ds1 = DB.GetDataSet("Proc_PaperDetail", Params1); 34 GridView1.DataSource = ds1; 35 GridView1.DataBind(); 36 ((Label)GridView1.HeaderRow.FindControl("Label27")).Text = ((Label)GridView1.Rows[0].FindControl("Label4")).Text; 37 38 SqlParameter[] Params2 = new SqlParameter[2]; 39 Params2[0] = DB.MakeInParam("@PaperID", SqlDbType.Int, 4, paperID); //试卷编号 40 Params2[1] = DB.MakeInParam("@Type", SqlDbType.VarChar, 10, "多选题"); //题目类型 41 DataSet ds2 = DB.GetDataSet("Proc_PaperDetail", Params2); 42 GridView2.DataSource = ds2; 43 GridView2.DataBind(); 44 ((Label)GridView2.HeaderRow.FindControl("Label28")).Text = ((Label)GridView2.Rows[0].FindControl("Label8")).Text; 45 46 SqlParameter[] Params3 = new SqlParameter[2]; 47 Params3[0] = DB.MakeInParam("@PaperID", SqlDbType.Int, 4, paperID); //试卷编号 48 Params3[1] = DB.MakeInParam("@Type", SqlDbType.VarChar, 10, "判断题"); //题目类型 49 DataSet ds3 = DB.GetDataSet("Proc_PaperDetail", Params3); 50 GridView3.DataSource = ds3; 51 GridView3.DataBind(); 52 ((Label)GridView3.HeaderRow.FindControl("Label29")).Text = ((Label)GridView3.Rows[0].FindControl("Label12")).Text; 53 54 SqlParameter[] Params4 = new SqlParameter[2]; 55 Params4[0] = DB.MakeInParam("@PaperID", SqlDbType.Int, 4, paperID); //试卷编号 56 Params4[1] = DB.MakeInParam("@Type", SqlDbType.VarChar, 10, "填空题"); //题目类型 57 DataSet ds4 = DB.GetDataSet("Proc_PaperDetail", Params4); 58 GridView4.DataSource = ds4; 59 GridView4.DataBind(); 60 ((Label)GridView4.HeaderRow.FindControl("Label30")).Text = ((Label)GridView4.Rows[0].FindControl("Label17")).Text; 61 } 62} 63
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:多功能在线考试系统源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号