云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 毕业设计说明书 计算机

毕业设计说明书 计算机

  • 62 次阅读
  • 3 次下载
  • 2025/6/16 21:14:38

淮阴师范学院毕业论文(设计)

图5-4-1

主代码如下:

SqlConnection cn = BaseClass.DBConn.CyCon(); DataSet ds = new DataSet(); private string txt = \;

private void display() {

SqlCommand cmd = new SqlCommand();

cmd.CommandText = string.Format(\课程号,课程名,学分 from 选课信息 where 教工号 ='{0}'\, login.userid.Trim()); cmd.Connection = cn;

SqlDataAdapter adapter = new SqlDataAdapter(cmd); ds.Clear();

adapter.Fill(ds, \);

dataGridView1.DataSource = ds.Tables[\]; }

private void display1() {

comboBox1.Items.Clear();

SqlCommand cmd = new SqlCommand();

cmd.CommandText = string.Format(\(select 课程名 from 选课信息,course where 选课信息.课程号=course.cno and 教工号='{0}')\, login.userid.Trim()); cmd.Connection = cn; cn.Open();

SqlDataReader dr = cmd.ExecuteReader();

25

淮阴师范学院毕业论文(设计)

while (dr.Read()) {

comboBox1.Items.Add(dr[0].ToString()); }

cn.Close(); dr.Close(); }

private void teacourseinfo_Load(object sender, EventArgs e) {

display();

display1(); }

private void button1_Click(object sender, EventArgs e) {

SqlCommand cmd = new SqlCommand();

txt = dataGridView1.CurrentRow.Cells[0].Value.ToString();

cmd.CommandText = string.Format(\and cno='{1}' \,login.userid.Trim(),txt); cmd.Connection = cn; try {

cn.Open();

cmd.ExecuteNonQuery();

toolStripStatusLabel1.Text=\您以后将不再受理此课程!\;

}

catch(SqlException ex) {

toolStripStatusLabel1.Text=\错误:\+ex.Message; }

finally {

cn.Close(); }

display(); display1(); }

26

淮阴师范学院毕业论文(设计)

private void button2_Click(object sender, EventArgs e) {

string cno=\;

SqlCommand cmd = new SqlCommand();

cmd.CommandText = string.Format(\cname='{0}'\,comboBox1.Text.Trim()); cmd.Connection = cn; cn.Open();

SqlDataReader dr = cmd.ExecuteReader(); if(dr.Read()) {

cno=dr[0].ToString(); }

cn.Close(); dr.Close(); /* */

string str = string.Format(\into teach values('{0}','{1}') \, login.userid.Trim(), cno.ToString()); cmd = new SqlCommand(str,cn); try {

cn.Open();

cmd.ExecuteNonQuery();

toolStripStatusLabel1.Text=\申请授课成功!\;

}

catch (SqlException ex) {

toolStripStatusLabel1.Text=\错误:\ + ex.Message; }

finally {

cn.Close(); }

//BaseClass.DBConn.getsqlcmd(\

values('\ display(); display1(); }

27

淮阴师范学院毕业论文(设计)

学生、教师信息的查询显示界面如图5-4-2所示。教师信息界面与学生类似,这里就举学生界面为例。

图5-4-2学生信息

主代码如下:

SqlConnection cn = new SqlConnection(\

Source=WS03-20111120UM;Initial Catalog=design;Integrated Security=True\); DataSet ds;

SqlDataAdapter adapter; private static int n;

private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) {

string sql = \学号,sname 姓名,sage 年龄,entertime 入学时间,sdept 系科 from student where sdept='\ + e.Node.Text.ToString() + \;

adapter = new SqlDataAdapter(sql, cn); ds = new DataSet(); ds.Clear();

if (cn.State == ConnectionState.Closed) cn.Open();

adapter.Fill(ds, \);

dataGridView1.DataSource = ds.Tables[\]; cn.Close(); }

private void dataGridView1_CellContentClick(object sender,

28

搜索更多关于: 毕业设计说明书 计算机 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

淮阴师范学院毕业论文(设计) 图5-4-1 主代码如下: SqlConnection cn = BaseClass.DBConn.CyCon(); DataSet ds = new DataSet(); private string txt = \; private void display() { SqlCommand cmd = new SqlCommand(); cmd.CommandText = string.Format(\课程号,课程名,学分 from 选课信息 where 教工号 ='{0}'\, login.userid.Trim()); cmd.Connection = cn; SqlDataAdapter adapte

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com