• 大小: 861KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-07-26
  • 语言: C#
  • 标签: 数据库  课设  c#  源码  

资源简介

这是数据库课设时做的,用的时候可能需要改一下代码中服务器的地址,管理员账户wayne 密码hannah 进去后可以查看所有会员信息,会员登陆可以查看查找社团内人的信息和修改自己的信息,等等...

资源截图

代码片段和文件信息

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 AddStudentForm : Form
    {
        public AddStudentForm()
        {
            InitializeComponent();
        }


        private void button2_Click(object sender EventArgs e)
        {
            this.Close();
        }

        private string Getbumen()
        {
            string bumen = ““;
            string sql = string.Format(“SELECT 部门 FROM bumen WHERE 部门=‘{0}‘“cbobumen.Text);
            try 
            {
                SqlCommand command = new SqlCommand(sql DBHelper.connection);
                DBHelper.connection.Open();
                SqlDataReader daraReader = command.ExecuteReader();
                if (daraReader.Read())
                {
                    bumen = (string)daraReader[0];

                }
                daraReader.Close();
            }
            catch(Exception ex)
            {
                MessageBox.Show(“操作数据库出错!“);
                Console.WriteLine(ex.Message);
            }
            finally
            {
                DBHelper.connection.Close();
            }
            return bumen;
        }
      /*  private void AddStudentForm_Load(object sender EventArgs e)
        {
            try
            {
                //查询班级的sql语句
                string sql = “SELECT 班级 FROM student“;
                //定义command对象
                SqlCommand Command = new SqlCommand(sql DBHelper.connection);
                DBHelper.connection.Open();
                SqlDataReader datareader = Command.ExecuteReader();
                string classname = ““;
                //循环独处所有班级名,并添加进班级组合框
                while (datareader.Read())
                {
                    classname = (string)datareader[0];
                    cboclass.Items.Add(classname);
                }
                datareader.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(“操作数据库出错!“);
                Console.WriteLine(ex.Message);
            }
            finally
            {
                DBHelper.connection.Close();
            }
        }*/

        private void btnsave_Click(object sender EventArgs e)
        {
            string loginId = txtLoginId.Text;
            string loginPwd = txtLoginPwd.Text;
            string loginPwd2 = txtLoginPwd2.Text;
            if (loginPwd != loginPwd2)
            {
                MessageBox.Show(“您两次输入的密码不一致,请重新输入“ “输入提示“ MessageBoxButtons.OK MessageBoxIcon.Warning);
                txtLoginPwd.Focus();
            }
            else
            {
                // string userStateId = rdoactive.Checked ? (string)rdoactive.Tag : (string)rdoInActive.Tag;
                string name = txtSt

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       5612  2011-12-23 15:57  MySchool\MySchool\Properties\Resources.resx

     文件        249  2011-12-23 15:57  MySchool\MySchool\Properties\Settings.settings

     文件       1164  2011-12-23 15:57  MySchool\MySchool\Properties\AssemblyInfo.cs

     文件       2838  2012-03-05 20:07  MySchool\MySchool\Properties\Resources.Designer.cs

     文件       1104  2012-03-05 20:07  MySchool\MySchool\Properties\Settings.Designer.cs

     文件      17233  2011-11-29 13:47  MySchool\MySchool\AddStudentForm.Designer.cs

     文件       5430  2011-11-30 14:07  MySchool\MySchool\16-32.ico

     文件       8267  2011-11-30 14:08  MySchool\MySchool\MySchool.csproj

     文件       5632  2005-11-11 22:25  MySchool\MySchool\bin\Debug\MySchool.vshost.exe

     文件       1689  2012-03-05 20:08  MySchool\MySchool\bin\Debug\MySchool.vshost.application

     文件       2654  2012-03-05 20:08  MySchool\MySchool\bin\Debug\MySchool.vshost.exe.manifest

     文件       2806  2011-12-28 17:57  MySchool\MySchool\bin\Debug\pagerror.gif

     文件      20284  2011-12-28 18:01  MySchool\MySchool\bin\Debug\back.gif

     文件      30638  2012-03-05 20:08  MySchool\MySchool\bin\Debug\back.png

     文件       2654  2012-03-05 20:08  MySchool\MySchool\bin\Debug\MySchool.exe.manifest

     文件       1689  2012-03-05 20:08  MySchool\MySchool\bin\Debug\MySchool.application

     文件      69632  2012-03-05 20:08  MySchool\MySchool\bin\Debug\MySchool.exe

     文件     114176  2012-03-05 20:08  MySchool\MySchool\bin\Debug\MySchool.pdb

     文件      36724  2011-11-30 11:40  MySchool\MySchool\bin\Debug\Forever.png

     文件       6394  2011-11-30 14:08  MySchool\MySchool\bin\Debug\MySchool.publish\MySchool_1_0_1_5\MySchool.exe.manifest

     文件      69632  2011-11-30 14:08  MySchool\MySchool\bin\Debug\MySchool.publish\MySchool_1_0_1_5\MySchool.exe.deploy

     文件       5430  2011-11-30 14:07  MySchool\MySchool\bin\Debug\MySchool.publish\MySchool_1_0_1_5\16-32.ico.deploy

     文件     423936  2011-11-30 14:08  MySchool\MySchool\bin\Debug\MySchool.publish\setup.exe

     文件       5482  2011-11-30 14:08  MySchool\MySchool\bin\Debug\MySchool.publish\MySchool.application

     文件       8540  2011-11-30 14:08  MySchool\MySchool\bin\Debug\MySchool.publish\publish.htm

     文件       5632  2005-11-11 22:25  MySchool\MySchool\bin\Release\MySchool.vshost.exe

     文件       1689  2011-11-29 15:44  MySchool\MySchool\bin\Release\MySchool.vshost.application

     文件       2198  2011-11-29 15:44  MySchool\MySchool\bin\Release\MySchool.vshost.exe.manifest

     文件      30638  2011-11-29 15:44  MySchool\MySchool\bin\Release\back.png

     文件       2198  2011-11-29 15:44  MySchool\MySchool\bin\Release\MySchool.exe.manifest

............此处省略104个文件信息

评论

共有 条评论