77范文网 - 专业文章范例文档资料分享平台

net学生信息系统项目设计报告(3)

来源:网络收集 时间:2020-04-17 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

SqlConnection conn = new SqlConnection(\Catalog=studentInfo;Integrated Security=SSPI;\); //取出连接字符串 string SqlStr = \; DataSet ds = new DataSet();

if (conn.State.ToString() == \) //如果连接关闭,打开

conn.Open();

SqlDataAdapter da = new SqlDataAdapter(SqlStr, conn);

da.Fill(ds);

if (conn.State.ToString() == \)

conn.Close(); } }

protected void Button1_Click(object sender, EventArgs e)

{

GridViewBind(); }

private void GridViewBind()

{

string connStr = \

Security=SSPI;\;

string SqlStr = \* from users where userName='\ + TextBox1.Text.ToString().Trim() + \;

DataSet ds = new DataSet();

SqlConnection conn = new SqlConnection(connStr); try

{

if (conn.State.ToString() == \)

conn.Open();

SqlDataAdapter da = new SqlDataAdapter(SqlStr, conn);

da.Fill(ds);

GridView1.DataSource = ds.Tables[0].DefaultView; GridView1.DataBind(); }

catch (Exception ex)

{

Response.Write(\数据库错误,错误原因:\ + ex.Message);

Response.End(); }

finally

{

if (conn.State.ToString() == \)

conn.Close();

} }}

10

3.2.3 管理员登录管理界面

11

3.2.4添加功能模块

主要代码:

protected void Button1_Click1(object sender, EventArgs e)

{

string sex;

string userid = this.txtName.Text; string userpwd = this.txtPwd.Text; string username = this.userName.Text; string minzu = this.minzu.Text; string birthday = this.bd.Text; string intime = this.intime.Text; string uclass = this.uclass.Text; string comefrom = this.dr.Text; string beizhu = this.beizhu.Text;

if (this.RadioButton1.Checked == true)

{

sex = \男\;

}

else

{

sex = \女\;

}

12

SqlConnection conn = new

SqlConnection(ConfigurationManager.ConnectionStrings[\].ToString()); string sql1 = string.Format(\

(userid,username,sex,minzu,birthday,intime,uclass,comefrom,beizhu) values('\ + userid + \ +

username + \ + sex + \ + minzu + \ + birthday + \ + intime + \ + uclass + \ + comefrom + \ + beizhu + \); string sql = string.Format(%users (userid,userpwd,username) values('\ + userid + \ + userpwd + \ + username + \); SqlCommand cmd1 = new SqlCommand(sql1, conn); SqlCommand cmd = new SqlCommand(sql, conn);

conn.Open();

if (cmd1.ExecuteNonQuery() > 0)

{

if (cmd.ExecuteNonQuery() > 0)

{

conn.Close();

Response.Write(\添加成功!');window.location =

window.location;\); }

else

{

Response.Write(\添加失败!');window.location = window.location;\);

} }

}

13

3.2.5编辑和删除功能模块

删除主要代码:

protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)

{

string id = GridView1.DataKeys[e.RowIndex].Values[0].ToString(); SqlConnection conn = new

SqlConnection(ConfigurationManager.ConnectionStrings[\].ToString());//创建连接对象号

string SqlStr = \+id +\;

try

{

if (conn.State.ToString() == \)

conn.Open();

SqlCommand comm = new SqlCommand(SqlStr, conn); comm.ExecuteNonQuery(); //执行删除

comm.Dispose();

if (conn.State.ToString() == \)

conn.Close();

GridView1.EditIndex = -1; GridViewBind(); }

14

catch (Exception ex)

{

Response.Write(\数据库错误,错误原因:\ + ex.Message);

Response.End(); }

总结

经过一段时间的学生信息管理系统的设计,我在这次设计网页中锻炼了自我动手能力,增强了操作能力和分析逻辑能力。可能该网站还存在着许多不尽如人意的地方,我会进一步改善,正所谓任何设计都需要较长的一段时间来维护和管理。

在本次的课程设计中,在学习管理信息系统分析与设计的基础上对系统设计有了更深刻的了解,也有了更强的巩固和加深了ASP.NET动态网页设计、SQL Server 2005和Visual Studio 2008的应用能力。经过多次调试后,该系统能够完成学生、课程、成绩的相关管理,还对添加学生中进行了AJAX学号认证,防止输入相同的学号所带来的很多无效操作。

我知道在此次的学生信息管理系统网站设计中有许多的欠缺,在以后的日子中,我一定得更加严格要求自己,改正缺点,不断努力,不断进步,争取做到更好。

参考资料

1.《管理信息系统分析与设计》,邝孔武 编著,西安电子科技大学出版社 2006年12月 2.《ASP.NET 基础与案例开发详解》编著:易巍 张新颖 清华大学出版社 2009年8月 3.《ASP.NET 程序设计与软件项目实训》编著:郑伟 清华大学出版社 2009年3月

4.《数据库技术与应用——SQL Sever 2005》编著:张建伟 人民邮政出版社 2009年2月 5.《Visual C# 2008 入门经典》编著:James Foxall 人民邮政出版社 2009年6月

15

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库net学生信息系统项目设计报告(3)在线全文阅读。

net学生信息系统项目设计报告(3).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/983450.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: