毕业论文--基于web的考试报名系统的设计与实现内容摘要:

for int i 0。 i 31。 i++ i + 1 .ToString。 else //其他月份则为 30 天 for int i 0。 i 30。 i++ i + 1 .ToString。 protected void Button2_Click object sender, EventArgs e //把出生年月转换为时间 if ! 0 amp。 amp。 ! 0 amp。 amp。 ! 0 int selectedyears。 int selectedmonth。 int selectedday。 birth new DateTime selectedyears, selectedmonth, selectedday。 string str server localhost。 Integrated security true。 database userinfo。 SqlConnection conn new SqlConnection str。 string sql select * from user_info。 SqlCommand cmd new SqlCommand sql, conn。 //打开数据库连接。 cmdmandText @INSERT INTO user_info User_Name,User_Address,User_Sex,User_tel,User_Email,User_race, User_Degree,User_Password,User_Birthday VALUES @name,@address,@sex,@telphone,@,@race, @degree,@password,@birth。 @name, .Value。 @address, .Value。 @sex, .Value。 @telphone, .Value。 @, .Value。 @race, .Value。 @degree, .Value。 @password, .Value。 @birth, .Value birth。 try if 0 //检索刚刚插入数据表中的 User_ID 号,通过User_ID 号跳转页面 cmdmandText select User_ID from user_info where User_Name @username and User_Password @pws and User_Email @mail。 @username, .Value。 @pws, .Value。 @mail, .Value。 int id。 注册成功,欢迎您的到来。 39。 登录成功。 39。 ~/?userid 0 ,id。 else 注册失败,请重新填写。 catch 操作出现错误。 3 查询模块 考生在此模块中可以查询自己的报名情况,因此考生可以通过用户名进行查询,还可以通过科目选择查看。 因为考生的查询有权限限制,而且为了确保考生的信息不被其他人利用,所以使用用户名查询可以查看到考生的全部信息,而使用科目查看只能查询到此科目的详细信息和报考的人的姓名 ,这两种查询方式反映给用户的结果是不同的,那么它在数据库中的操作也是不同的,这里主要的操作是查询,而查询就要涉及到 DataBase 类中的一个通用查询方法 mySelect String sql 在这个方法中,需要传递一个 sql 语句和一个 字符串数组, sql 语句只能是查询语句。 查询模块界面: 核心代码: protected void Page_Load object sender, EventArgs e false。 false。 false。 false。 false。 请您记住你的用户 ID 号 ,登录时请用 ID 号登录。 string userid [userid]。 string str server localhost。 Integrated Security true。 database userinfo。 SqlConnection conn new SqlConnection str。 SqlCommand cmd new SqlCommand str, conn。 //打开连接 cmdmandText select User_Name from user_info where User_ID @id。 @id, .Value userid。 try .ToString。 catch 数据库操作发生错误。 protected void LinkButton1_Click object sender, EventArgs e true。 false。 false。 false。 false。 string userid [userid]。 //由登录页面传过来的 userid 号。 string str server localhost。 integrated security true。 database userinfo。 SqlConnection connection new SqlConnection str。 SqlCommand cmd new SqlCommand str,connection。 try cmdmandText select * from user_info where User_ID @id。 @id, .Value userid。 SqlDataAdapter adapter new SqlDataAdapter。 cmd。 DataSet ds new DataSet。 ds。 if [0].Rows[0][User_Birthday].ToString //如果出生日期字段为空,则显示为空。 else DateTime birth [0].Rows[0][User_Birthday].ToString。 TimeSpan ts birth。 int / 365 .ToString。 [0].Rows[0][User_ID].ToString。 [0].Rows[0][User_Name].ToString。 [0].Rows[0][User_Sex].ToString。 [0].Rows[0][User_Address].ToString。 [0].Rows[0][User_Email].ToString。 [0].Rows[0][User_tel].ToString。 [0].Rows[0][User_race].ToString。 [0].Rows[0][User_Degree].ToString。 catch。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。