关于c 查询 功能的实现代码

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

关于C#查询功能的实现代码关于C#查询功能的实现代码usingSystem;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Drawing;usingSystem.Collections;usingSystem.ComponentModel;usingSystem.Windows.Forms;namespace企业人事管理系统{///<summary>///FrmLogin的摘要说明。///</summary>publicclassFrmLogin:System.Windows.Forms.Form{privateSystem.Windows.Forms.PictureBoxpictureBox1;privateSystem.Windows.Forms.Buttonbutton1;privateSystem.Windows.Forms.Buttonbutton2;privateSystem.Windows.Forms.TextBoxtextBox1;privateSystem.Windows.Forms.TextBoxtextBox2;privateSystem.Windows.Forms.Labellabel1;privateSystem.Windows.Forms.Labellabel2;privatestringUserName;privatestringPassWord;privatestringsql;privateSystem.Data.OleDb.OleDbDataAdapteroleDbDataAdapter1;privateSystem.Data.OleDb.OleDbCommandoleDbSelectCommand1;privateSystem.Data.OleDb.OleDbCommandoleDbInsertCommand1;privateSystem.Data.OleDb.OleDbCommandoleDbUpdateCommand1;privateSystem.Data.OleDb.OleDbCommandoleDbDeleteCommand1;privateSystem.Data.OleDb.OleDbConnectionoleDbConnection1;private企业人事管理系统.DataSet2dataSet21;privateSystem.Windows.Forms.DataGriddataGrid1;///<summary>///必需的设计器变量。///</summary>privateSystem.ComponentModel.Containercomponents=null;publicFrmLogin(){////Windows窗体设计器支持所必需的//InitializeComponent();////TODO:在InitializeComponent调用后添加任何构造函数代码//}///<summary>///清理所有正在使用的资源。///</summary>protectedoverridevoidDispose(booldisposing){if(disposing){if(components!=null){components.Dispose();}}base.Dispose(disposing);}#regionWindows窗体设计器生成的代码///<summary>///设计器支持所需的方法-不要使用代码编辑器修改///此方法的内容。///</summary>privatevoidInitializeComponent(){this.pictureBox1=newSystem.Windows.Forms.PictureBox();this.button1=newSystem.Windows.Forms.Button();this.button2=newSystem.Windows.Forms.Button();this.textBox1=newSystem.Windows.Forms.TextBox();this.textBox2=newSystem.Windows.Forms.TextBox();this.label1=newSystem.Windows.Forms.Label();this.label2=newSystem.Windows.Forms.Label();this.oleDbDataAdapter1=newSystem.Data.OleDb.OleDbDataAdapter();this.oleDbDeleteCommand1=newSystem.Data.OleDb.OleDbCommand();this.oleDbConnection1=newSystem.Data.OleDb.OleDbConnection();this.oleDbInsertCommand1=newSystem.Data.OleDb.OleDbCommand();this.oleDbSelectCommand1=newSystem.Data.OleDb.OleDbCommand();this.oleDbUpdateCommand1=newSystem.Data.OleDb.OleDbCommand();this.dataSet21=new企业人事管理系统.DataSet2();this.dataGrid1=newSystem.Windows.Forms.DataGrid();((System.ComponentModel.ISupportInitialize)(this.dataSet21)).BeginInit();((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();this.SuspendLayout();////pictureBox1//this.pictureBox1.BorderStyle=System.Windows.Forms.BorderStyle.Fixed3D;this.pictureBox1.Location=newSystem.Drawing.Point(40,32);this.pictureBox1.Name=pictureBox1;this.pictureBox1.Size=newSystem.Drawing.Size(272,96);this.pictureBox1.TabIndex=0;this.pictureBox1.TabStop=false;////button1//this.button1.Location=newSystem.Drawing.Point(72,152);this.button1.Name=button1;this.button1.TabIndex=1;this.button1.Text=登录;this.button1.Click+=newSystem.EventHandler(this.button1_Click);////button2//this.button2.Location=newSystem.Drawing.Point(200,152);this.button2.Name=button2;this.button2.TabIndex=2;this.button2.Text=取消;this.button2.Click+=newSystem.EventHandler(this.button2_Click);////textBox1//this.textBox1.Location=newSystem.Drawing.Point(144,56);this.textBox1.Name=textBox1;this.textBox1.Size=newSystem.Drawing.Size(128,21);this.textBox1.TabIndex=3;this.textBox1.Text=;this.textBox1.TextChanged+=newSystem.EventHandler(this.textBox1_TextChanged);////textBox2//this.textBox2.Location=newSystem.Drawing.Point(144,96);this.textBox2.Name=textBox2;this.textBox2.Size=newSystem.Drawing.Size(128,21);this.textBox2.TabIndex=4;this.textBox2.Text=;////label1//this.label1.Location=newSystem.Drawing.Point(56,56);this.label1.Name=label1;this.label1.Size=newSystem.Drawing.Size(88,23);this.label1.TabIndex=5;this.label1.Text=***名称;////label2//this.label2.Location=newSystem.Drawing.Point(56,96);this.label2.Name=label2;this.label2.Size=newSystem.Drawing.Size(88,23);this.label2.TabIndex=6;this.label2.Text=***口令;////oleDbDataAdapter1//this.oleDbDataAdapter1.DeleteCommand=this.oleDbDeleteCommand1;this.oleDbDataAdapter1.InsertCommand=this.oleDbInsertCommand1;this.oleDbDataAdapter1.SelectCommand=this.oleDbSelectCommand1;this.oleDbDataAdapter1.TableMappings.AddRange(newSystem.Data.Common.DataTableMapping[]{newSystem.Data.Common.DataTableMapping(Table,管理用户,newSystem.Data.Common.DataColumnMapping[]{newSystem.Data.Common.DataColumnMapping(用户口令,用户口令),newSystem.Data.Common.DataColumnMapping(用户名称,用户名称),newSystem.Data.Common.DataColumnMapping(用户权限,用户权限)})});this.oleDbDataAdapter1.UpdateCommand=this.oleDbUpdateCommand1;////oleDbDeleteCommand1//this.oleDbDeleteCommand1.CommandText=DELETEFROM管理用户WHERE(用户名称=?)AND(用户口令=?OR?ISNULLAND用户口令ISNULL)AN+D(用户权限=?OR?ISNULLAND用户权限ISNULL);this.oleDbDeleteCommand1.Connection=this.oleDbConnection1;this.oleDbDeleteCommand1.Parameters.Add(newSystem.Data.OleDb.OleDbParameter(Original_用户名称,System.Data.OleD

1 / 26
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功