学生选课系统代码
更新时间:2023-11-10 22:24:01 阅读量: 教育文库 文档下载
登陆界面:
vusing System;
using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text;
using System.Windows.Forms; using System.Data.SqlClient;
namespace MySchool {
public partial class Login : Form {
public Login() {
InitializeComponent(); }
private void Login_Load(object sender, EventArgs e) {
}
private void btnYes_Click(object sender, EventArgs e) {
string userName = txtName.Text; string passward = txtPwd.Text;
string connString = @\Security=True\
SqlConnection connection = new SqlConnection(connString);
try {
//打开数据库
connection.Open(); //创建Command对象
SqlCommand command = new SqlCommand(sql, connection);
int num = (int)command.ExecuteScalar(); if(num > 0) {
//如果有匹配的行,则表明用户名和密码正确
MessageBox.Show(\欢迎进入学生选课系统系统!\登陆成功\ //创建主窗体对象
MainFrm mainForm = new MainFrm(); //显示主窗体
mainForm.Show(); //隐藏登录窗体 this.Visible = false; } else {
MessageBox.Show(\您输入的用户名或密码错误!\登陆失败\MessageBoxButtons.OK, MessageBoxIcon.Exclamation); }
}
catch (Exception ex) {
MessageBox.Show(ex.Message, \登陆失败\MessageBoxIcon.Exclamation); }
finally {
connection.Close(); }
}
private void btnNo_Click(object sender, EventArgs e) {
txtName.Clear(); txtPwd.Clear(); txtName.Focus(); }
private void lblMain_Click(object sender, EventArgs e) {
} } }
Course:
using System;
using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text;
using System.Windows.Forms;
namespace MySchool {
public partial class CourseFrm : Form {
public CourseFrm()
{
InitializeComponent(); }
private void CourseFrm_Load(object sender, EventArgs e) {
// TODO: 这行代码将数据加载到表“myschoolDataSet4.CourseMsg”中。您可以根据需要移动或删除它。
this.courseMsgTableAdapter2.Fill(this.myschoolDataSet4.CourseMsg); //// TODO: 这行代码将数据加载到表“myschoolDataSet2.CourseMsg”中。您可以根据需要移动或删除它。
//this.courseMsgTableAdapter1.Fill(this.myschoolDataSet2.CourseMsg);
}
private void btnsave_Click(object sender, EventArgs e) {
courseMsgTableAdapter.Update(mySchoolDataSet1.CourseMsg); }
private void btnclose_Click(object sender, EventArgs e) {
this.Close(); }
private void btnupdate_Click(object sender, EventArgs e) {
courseMsgTableAdapter.Fill(mySchoolDataSet1.CourseMsg); } } }
using System;
using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text;
using System.Windows.Forms; using System.Data.SqlClient;
namespace MySchool {
public partial class CourseMsgFrm : Form {
string courseName; string courseClass; string required; int credit;
int prelectionCredit; int ExperimentCredit;
正在阅读:
学生选课系统代码11-10
民政部门党建工作存在的问题及解决建议09-05
中药治疗体股癣疗效观察(南京药科大学)06-23
太和殿口试导游词08-11
宋佳经典语录语句集锦11-20
九年级语文上册《议论文知识点及范文》教案 新人教版03-08
辽宁省地方导游复习提纲12-22
汽车理论3动力性05-22
- exercise2
- 铅锌矿详查地质设计 - 图文
- 厨余垃圾、餐厨垃圾堆肥系统设计方案
- 陈明珠开题报告
- 化工原理精选例题
- 政府形象宣传册营销案例
- 小学一至三年级语文阅读专项练习题
- 2014.民诉 期末考试 复习题
- 巅峰智业 - 做好顶层设计对建设城市的重要意义
- (三起)冀教版三年级英语上册Unit4 Lesson24练习题及答案
- 2017年实心轮胎现状及发展趋势分析(目录)
- 基于GIS的农用地定级技术研究定稿
- 2017-2022年中国医疗保健市场调查与市场前景预测报告(目录) - 图文
- 作业
- OFDM技术仿真(MATLAB代码) - 图文
- Android工程师笔试题及答案
- 生命密码联合密码
- 空间地上权若干法律问题探究
- 江苏学业水平测试《机械基础》模拟试题
- 选课走班实施方案
- 选课
- 代码
- 学生
- 系统
- 东营市节能减排通知
- 关于加强和创新农村社会管理,确保农村社会和谐稳定的提案
- 电力机车构造练习册答案
- 苹果不套袋技术的周年生产管理方案
- 申请律师执业人员实习总结
- 七年级语文上册第10课《社戏》精品同步测试苏教版
- 河南省郑州市2018届高三第二次质量预测英语试卷(含答案)
- 九年级语文上册 19《范进中举》教学案(新版)新人教版
- 毕业论文开题报告模版
- 2018学年八年级道德与法治下册第四单元崇尚法治精神评估新人教版 精品
- 外周血细胞染色体培养操作
- 煤矿一级标准化检查问题汇总--采煤
- 多住户公寓楼的安静之道
- 全国电子设计大赛论文 电源设计
- 人教版数学三年级下1-3单元知识整理单
- 2018年建设行业施工员岗位统考综合试卷A答案
- 人教版二年级下册第七单元教案
- 光敏三极管的结构及工作原理和磁敏三极管
- 2018小学数学《绩优学案》六年级(下)总复习 - 数与代数
- 2015年1月全国自考学前教育学模拟试卷(一)