C课程设计报告(11)
发布时间:2021-06-06
发布时间:2021-06-06
基于PDA的C#的一个考勤系统,是课程设计!
附录
一、 源程序:
部分代码
using System;
using System.Linq;
using System.Collections.Generic; using ponentModel; using System.Data; using System.Drawing; using System.Text;
using System.Windows.Forms; using System.Data.SqlServerCe;
namespace 作业2 {
public partial class 考勤统计 : Form {
string[] substr;
public string ConnStr = @"Data Source=\西\Data.sdf"; public 考勤统计() {
InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) {
SqlCeConnection Conn = new SqlCeConnection(ConnStr); SqlCeCommand comm;
if (Conn.State != ConnectionState.Open) {
Conn.Open(); }
if (comboBox1.Text == "") {
MessageBox.Show("请选择课程!"); return; } else {
substr = comboBox1.Text.Split(' ');
string SQL = @"SELECT T_Student.F__Stcode, T_Student.F_Stname,T_Union.F_Lessoncode
FROM T_Student INNER JOIN
T_Union ON T_Student.F__Stcode = T_Union.F_Stucode WHERE (T_Union.F_Lessoncode='" + substr[0] + "')"; SqlCeDataAdapter da = new SqlCeDataAdapter(SQL, Conn); DataTable dt = new DataTable(); da.Fill(dt);
comm = new SqlCeCommand(SQL, Conn); comm.ExecuteNonQuery();
DataTable dtsub; ListViewItem lvi;
listView1.Items.Clear();
for (int i = 0; i < dt.Rows.Count; i++) {
int cq = 0; int bj = 0; int cd = 0; int sj = 0; int zt = 0; int qt = 0; int kk = 0;
SQL = @"SELECT F_Memo
上一篇:广外--英语(国际商务管理)介绍
下一篇:人生五大投资