数据库课程设计学生信息管理系统实验报告.docx
- 文档编号:12032426
- 上传时间:2023-04-16
- 格式:DOCX
- 页数:15
- 大小:270.48KB
数据库课程设计学生信息管理系统实验报告.docx
《数据库课程设计学生信息管理系统实验报告.docx》由会员分享,可在线阅读,更多相关《数据库课程设计学生信息管理系统实验报告.docx(15页珍藏版)》请在冰豆网上搜索。
数据库课程设计学生信息管理系统实验报告
数据库课程设计报告
----------建立学生成绩管理系统
一、
学习掌握了如何连接数据库,用C#,ASP.NET,SQL建立学生成绩管理系统
二、界面截图
登录界面
代码:
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Web.UI;
usingSystem.Web.UI.WebControls;
usingSystem.Data.SqlClient;
publicpartialclassLogin:
System.Web.UI.Page
{
protectedvoidPage_Load(objectsender,EventArgse)
{
}
protectedvoidBtnLogin_Click(objectsender,EventArgse)
{
if(TxtPassword.Text==string.Empty||TxtUsername.Text==string.Empty)
{
Response.Write("");
}
stringconStr="DataSource=127.0.0.1;InitialCatalog=students;integratedSecurity=True";//连接字符串
SqlConnectioncon=newSqlConnection(conStr);//创建connection对象
con.Open();
SqlCommandcmd=newSqlCommand("selectPasswordfromUserswhereUserID='"+TxtUsername.Text+"'",con);
SqlDataReaderReader=cmd.ExecuteReader();
if(Reader.Read())
{
if(TxtPassword.Text.Trim()==Reader["Password"].ToString().Trim())
{
//Response.Write("");
Server.Transfer("Index.aspx");
}
else
{
Response.Write("");
}
}
else
{
Response.Write("");
}
}
}
主界面
代码:
//www.w3.org/1999/xhtml">
学生成绩更新 学生成绩查询 学生成绩汇总