学生宿舍管理系统c#winform窗体程序


这是一个对学生宿舍进行管理的系统,运用c#语言编写,是一个窗体程序,里面附加有数据库
资源截图
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 学生宿舍管理系统1
{
    public partial class addStudent : Form
    {
        private string num;
        public addStudent()
        {
            InitializeComponent();
        }
        public addStudent(string n)
        {
            InitializeComponent();
            num = n;
            txtRoomNum.Text = num;
        }

        public void GetData(string selectCommand)
        {
            try
            {
                String connectionString =
                    “Integrated Security=SSPI;Persist Security Info=False;“ +
                    “Initial Catalog=stuQuartersManage;Data Source=HASEE-PC\SQLEXPRESS“;
                SqlDataAdapter dataAdapter = new SqlDataAdapter(selectCommand connectionString);

                SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter);
                DataTable table = new DataTable();
                table.Locale = System.Globalization.CultureInfo.InvariantCulture;
                dataAdapter.Fill(table);
                bindingSource1.DataSource = table;
                dataGridView1.AutoResizeColumns(
                    DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);
            }
            catch (SqlException)
            {
                MessageBox.Show(“添加学生信息失败!“ “错误提示“);
            }
        }

        public int getConut()
        {
            SqlConnection con = new SqlConnection(@“Data Source=HASEE-PCSQLEXPRESS;Initial Catalog=stuQuartersManage;Integrated Security=True“);
            con.Open();
            string str = “select * from Student where stuNum=‘“ + txtStuNum.Text + “‘“;           
            SqlCommand com = new SqlCommand(str con);            
            int intcont = Convert.ToInt32(com.ExecuteScalar());
            con.Close();
            com.Clone();
            return intcont;       
        }

        public string room()
        {
            SqlConnection con = new SqlConnection(@“Data Source=HASEE-PCSQLEXPRESS;Initial Catalog=stuQuartersManage;Integrated Security=True“);
            con.Open();
            string str1 = “select roomNum from Room where roomNum = ‘“ + txtRoomNum.Text + “‘“;
            SqlCommand com1 = new SqlCommand(str1 con);
            string room = Convert.ToString(com1.ExecuteScalar());
            con.Close();
            com1.Clone();
            return room;
        }

        public int count()
        {
            SqlConnection con = new SqlConnection(@“Data Source=HASEE-PCSQLEXPRESS;Initial Catalog=stuQuartersManage;Integrated Security=True“);
            con.Open();
            string str1 = “select count(roomNum) from Student where roomNum=‘“ + txtRoomNum.Text + “‘“;
            SqlCommand com1 = new SqlComm

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-06-09 09:26  学生宿舍管理系统1
     目录           0  2011-06-09 09:26  学生宿舍管理系统1学生宿舍管理系统1
     目录           0  2011-06-09 09:26  学生宿舍管理系统1学生宿舍管理系统1Properties
     文件        1442  2011-06-09 09:26  学生宿舍管理系统1学生宿舍管理系统1PropertiesAssemblyInfo.cs
     文件        1769  2011-06-10 12:32  学生宿舍管理系统1学生宿舍管理系统1PropertiesSettings.Designer.cs
     文件        5957  2011-06-09 10:49  学生宿舍管理系统1学生宿舍管理系统1PropertiesResources.resx
     文件        2874  2011-06-09 10:49  学生宿舍管理系统1学生宿舍管理系统1PropertiesResources.Designer.cs
     文件        1051  2011-06-10 12:32  学生宿舍管理系统1学生宿舍管理系统1PropertiesSettings.settings
     文件        2411  2011-06-11 15:48  学生宿舍管理系统1学生宿舍管理系统1Login.cs
     文件        8541  2011-06-12 00:57  学生宿舍管理系统1学生宿舍管理系统1addStudent.cs
     文件        9742  2011-06-09 16:18  学生宿舍管理系统1学生宿舍管理系统1stuLook.Designer.cs
     文件        8964  2011-06-12 12:17  学生宿舍管理系统1学生宿舍管理系统1学生宿舍管理系统1.csproj
     目录           0  2011-06-09 09:26  学生宿舍管理系统1学生宿舍管理系统1in
     目录           0  2011-06-09 09:26  学生宿舍管理系统1学生宿舍管理系统1inDebug
     文件       14328  2011-06-20 13:48  学生宿舍管理系统1学生宿舍管理系统1inDebug学生宿舍管理系统1.vshost.exe
     文件      156672  2011-06-20 13:48  学生宿舍管理系统1学生宿舍管理系统1inDebug学生宿舍管理系统1.exe
     文件       95744  2011-06-20 13:48  学生宿舍管理系统1学生宿舍管理系统1inDebug学生宿舍管理系统1.pdb
     文件         450  2011-06-10 12:32  学生宿舍管理系统1学生宿舍管理系统1inDebug学生宿舍管理系统1.exe.config
     文件         450  2011-06-10 12:32  学生宿舍管理系统1学生宿舍管理系统1inDebug学生宿舍管理系统1.vshost.exe.config
     目录           0  2011-06-12 12:17  学生宿舍管理系统1学生宿舍管理系统1inDebugdatabase
     文件     2293760  2011-06-12 12:16  学生宿舍管理系统1学生宿舍管理系统1inDebugdatabasestuQuartersManage.mdf
     文件      573440  2011-06-12 12:16  学生宿舍管理系统1学生宿舍管理系统1inDebugdatabasestuQuartersManage_log.LDF
     文件         490  2009-06-11 05:14  学生宿舍管理系统1学生宿舍管理系统1inDebug学生宿舍管理系统1.vshost.exe.manifest
     目录           0  2011-06-12 12:18  学生宿舍管理系统1学生宿舍管理系统1inRelease
     文件         450  2011-06-10 12:32  学生宿舍管理系统1学生宿舍管理系统1inRelease学生宿舍管理系统1.exe.config
     文件         450  2011-06-10 12:32  学生宿舍管理系统1学生宿舍管理系统1inRelease学生宿舍管理系统1.vshost.exe.config
     文件         490  2009-06-11 05:14  学生宿舍管理系统1学生宿舍管理系统1inRelease学生宿舍管理系统1.vshost.exe.manifest
     文件       14328  2011-06-20 13:48  学生宿舍管理系统1学生宿舍管理系统1inRelease学生宿舍管理系统1.vshost.exe
     目录           0  2011-06-12 12:20  学生宿舍管理系统1学生宿舍管理系统1inReleasedatabase
     文件     2293760  2011-06-12 12:16  学生宿舍管理系统1学生宿舍管理系统1inReleasedatabasestuQuartersManage.mdf
     文件      573440  2011-06-12 12:16  学生宿舍管理系统1学生宿舍管理系统1inReleasedatabasestuQuartersManage_log.LDF
............此处省略73个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)