学生成绩管理系统(C#)
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
saveFileDialog.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*";
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
{
string FileName = saveFileDialog.FileName;
childForm.Text = "窗口" + childFormNumber++;
childForm.Show();
}
private void OpenFile(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
using System.Threading.Tasks;
using System.Windows.Forms;
namespace student_test1
{
public partial class MDIParent1 : Form
{
private int childFormNumber = 0;
由于时隔久远,电脑中关于数据库的部分模块被遗漏了,望各位大牛小牛们理解啦。
一、项目诉求:
创建一个VS项目连接数据库,项目为学生成绩管理系统,其中包含登录、开课情况查询、学生成绩查询、学生信息维护、学生成绩维护以及帮助等主要内容。
分为两端:因用户权限不同,分别为普通用户端以及管理员端。
二、项目平台
PC、VS2012、SQLServer 2008R2
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
openFileDialog.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*";
学生成绩管理系统(C#)
江宏晖
这篇作品是本作者在校大二期间学习C#与数据库时自我训练所写的一个项目,主要是为了自学自练,当然如果能对部分同学有一定帮助的话那也是本人的荣幸。
这次数据库自编项目,使我掌握了C#的编写技巧以及SQLServer数据库和VS的链接方式,其中遇到过不少的难题,但是只要抓住思路检查之后还是能做到及时纠正,对每个部分了解是极为重要的一点。
三、主要代码以及运行截图演示
Login.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
}
}
private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
{
foreach (Form childForm in MdiChildren)
{
childForm.Close();
}
}
private void退出系统ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void帮助ToolStripMenuItem_Click(object sender, EventArgs e)
{
help u = new help();
u.Show();
}
private void开课情况查询ToolStripMenuItem_Click(object sender, EventArgs e)
{
开课情况查询k = new开课情况查询();
k.Show();
}
private void MDIParent1_Load(object sender, EventArgs e)
{
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
{
foreach (Form childForm in MdiChildren)
{
childForm.Close();
DataTable dt = qa.Tables["学生成绩表"];
dataGridView1.DataSource = dt;
conn.Close();
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.Odbc;
namespace student_test1
{
public partial class学生成绩查询: Form
}
private void chaxun_Click(object sender, EventArgs e)
{
string str = "dsn=jhh;uid=sa;pwd=sa";
string sqlstr = "select cjpm.学号,cjpm.姓名,cjpm.班级,cjpm.总分,cjpm.排名from cjpm where cjpm.学号='" + xuehao.Text.Trim() + "'";
using System.Windows.Forms;
namespace student_test1
{
public partial class MDIParent2 : Form
{
private int childFormNumber = 0;
public MDIParent2()
{
InitializeComponent();
{
学生信息维护w = new学生信息维护();
w.Show();
}
private void学生成绩维护ToolStripMenuItem_Click(object sender, EventArgs e)
{
学生成绩维护y = new学生成绩维护();
y.Show();
}
}
}
MDIparent2.cs:
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
{
string FileName = openFileDialog.FileName;
}
}
private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
}
private void ShowNewForm(object sender, EventArgs e)
{
Form childForm = new Form();
childForm.MdiParent = this;
childForm.Text = "窗口" + childFormNumber++;
OdbcConnection conn = new OdbcConnection(str);
conn.Open();
OdbcDataAdapter da = new OdbcDataAdapter(sqlstr, conn);
DataSet qa = new DataSet();
da.Fill(qa, "学生成绩表");
}
}
private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
saveFileDialog.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*";
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
{
string FileName = saveFileDialog.FileName;
openFileDialog.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*";
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
{
string FileName = openFileDialog.FileName;
{
}
}
}
MDIparent1.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
childForm.Show();
}ຫໍສະໝຸດ Baidu
private void OpenFile(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
{
public学生成绩查询()
{
InitializeComponent();
}
private void学生成绩查询_Load(object sender, EventArgs e)
{
// TODO:这行代码将数据加载到表“dataSet1.cjpm”中。您可以根据需要移动或删除它。
this.cjpmTableAdapter.Fill(this.dataSet1.cjpm);
public MDIParent1()
{
InitializeComponent();
}
private void ShowNewForm(object sender, EventArgs e)
{
Form childForm = new Form();
childForm.MdiParent = this;
{
}
private void学习成绩查询ToolStripMenuItem_Click(object sender, EventArgs e)
{
学生成绩查询q = new学生成绩查询();
q.Show();
}
private void学生信息维护ToolStripMenuItem_Click(object sender, EventArgs e)
}
}
private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
{
string FileName = saveFileDialog.FileName;
childForm.Text = "窗口" + childFormNumber++;
childForm.Show();
}
private void OpenFile(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
using System.Threading.Tasks;
using System.Windows.Forms;
namespace student_test1
{
public partial class MDIParent1 : Form
{
private int childFormNumber = 0;
由于时隔久远,电脑中关于数据库的部分模块被遗漏了,望各位大牛小牛们理解啦。
一、项目诉求:
创建一个VS项目连接数据库,项目为学生成绩管理系统,其中包含登录、开课情况查询、学生成绩查询、学生信息维护、学生成绩维护以及帮助等主要内容。
分为两端:因用户权限不同,分别为普通用户端以及管理员端。
二、项目平台
PC、VS2012、SQLServer 2008R2
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
openFileDialog.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*";
学生成绩管理系统(C#)
江宏晖
这篇作品是本作者在校大二期间学习C#与数据库时自我训练所写的一个项目,主要是为了自学自练,当然如果能对部分同学有一定帮助的话那也是本人的荣幸。
这次数据库自编项目,使我掌握了C#的编写技巧以及SQLServer数据库和VS的链接方式,其中遇到过不少的难题,但是只要抓住思路检查之后还是能做到及时纠正,对每个部分了解是极为重要的一点。
三、主要代码以及运行截图演示
Login.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
}
}
private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
{
foreach (Form childForm in MdiChildren)
{
childForm.Close();
}
}
private void退出系统ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void帮助ToolStripMenuItem_Click(object sender, EventArgs e)
{
help u = new help();
u.Show();
}
private void开课情况查询ToolStripMenuItem_Click(object sender, EventArgs e)
{
开课情况查询k = new开课情况查询();
k.Show();
}
private void MDIParent1_Load(object sender, EventArgs e)
{
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
{
foreach (Form childForm in MdiChildren)
{
childForm.Close();
DataTable dt = qa.Tables["学生成绩表"];
dataGridView1.DataSource = dt;
conn.Close();
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.Odbc;
namespace student_test1
{
public partial class学生成绩查询: Form
}
private void chaxun_Click(object sender, EventArgs e)
{
string str = "dsn=jhh;uid=sa;pwd=sa";
string sqlstr = "select cjpm.学号,cjpm.姓名,cjpm.班级,cjpm.总分,cjpm.排名from cjpm where cjpm.学号='" + xuehao.Text.Trim() + "'";
using System.Windows.Forms;
namespace student_test1
{
public partial class MDIParent2 : Form
{
private int childFormNumber = 0;
public MDIParent2()
{
InitializeComponent();
{
学生信息维护w = new学生信息维护();
w.Show();
}
private void学生成绩维护ToolStripMenuItem_Click(object sender, EventArgs e)
{
学生成绩维护y = new学生成绩维护();
y.Show();
}
}
}
MDIparent2.cs:
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
{
string FileName = openFileDialog.FileName;
}
}
private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
}
private void ShowNewForm(object sender, EventArgs e)
{
Form childForm = new Form();
childForm.MdiParent = this;
childForm.Text = "窗口" + childFormNumber++;
OdbcConnection conn = new OdbcConnection(str);
conn.Open();
OdbcDataAdapter da = new OdbcDataAdapter(sqlstr, conn);
DataSet qa = new DataSet();
da.Fill(qa, "学生成绩表");
}
}
private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
saveFileDialog.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*";
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
{
string FileName = saveFileDialog.FileName;
openFileDialog.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*";
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
{
string FileName = openFileDialog.FileName;
{
}
}
}
MDIparent1.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
childForm.Show();
}ຫໍສະໝຸດ Baidu
private void OpenFile(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
{
public学生成绩查询()
{
InitializeComponent();
}
private void学生成绩查询_Load(object sender, EventArgs e)
{
// TODO:这行代码将数据加载到表“dataSet1.cjpm”中。您可以根据需要移动或删除它。
this.cjpmTableAdapter.Fill(this.dataSet1.cjpm);
public MDIParent1()
{
InitializeComponent();
}
private void ShowNewForm(object sender, EventArgs e)
{
Form childForm = new Form();
childForm.MdiParent = this;
{
}
private void学习成绩查询ToolStripMenuItem_Click(object sender, EventArgs e)
{
学生成绩查询q = new学生成绩查询();
q.Show();
}
private void学生信息维护ToolStripMenuItem_Click(object sender, EventArgs e)
}
}
private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)