예제 #1
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            模糊查询 form = new 模糊查询();

            form.Show();
            this.Hide();
        }
예제 #2
0
파일: 登录.cs 프로젝트: tomyqg/CSHomework
        private void btlogin_Click(object sender, EventArgs e)
        {
            string strConnection = "provider=microsoft.jet.oledb.4.0;";

            strConnection += @"data source=dl.mdb";
            OleDbConnection objconnection = new OleDbConnection(strConnection);

            objconnection.Open();
            string       sql   = "select * from dlxxb  where name='" + this.manager.Text + "' and password='******' and bzb='" + this.部职别.Text + "' and yhlx='" + this.用户.Text + "'";
            OleDbCommand cmd   = new OleDbCommand(sql, objconnection);
            int          state = Convert.ToInt32(cmd.ExecuteScalar());

            if (state == 0 || state > 1)
            {
                MessageBox.Show("没有此用户", "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                模糊查询 form = new 模糊查询();
                form.Show();
                this.Hide();
            }
            objconnection.Close();
        }