⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cs

📁 《学籍管理系统》 “c# WinForm 数据库操作的简单范例 (SQL Server 2000)”
💻 CS
📖 第 1 页 / 共 5 页
字号:
			this.textBox15.TabIndex = 2;
			this.textBox15.Text = "";
			// 
			// textBox16
			// 
			this.textBox16.Location = new System.Drawing.Point(112, 460);
			this.textBox16.Name = "textBox16";
			this.textBox16.Size = new System.Drawing.Size(156, 21);
			this.textBox16.TabIndex = 6;
			this.textBox16.Text = "";
			this.textBox16.Visible = false;
			// 
			// comboBox2
			// 
			this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.comboBox2.Items.AddRange(new object[] {
														   "姓    名",
														   "性    别",
														   "学    号",
														   "学    院",
														   "专    业",
														   "班    级",
														   "电    话",
														   "出生年月",
														   "民    族",
														   "籍    贯",
														   "住    址",
														   "来自何校",
														   "政治面貌",
														   "备    注"});
			this.comboBox2.Location = new System.Drawing.Point(20, 20);
			this.comboBox2.Name = "comboBox2";
			this.comboBox2.Size = new System.Drawing.Size(156, 20);
			this.comboBox2.TabIndex = 1;
			this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
			// 
			// listBox1
			// 
			this.listBox1.ItemHeight = 12;
			this.listBox1.Location = new System.Drawing.Point(20, 52);
			this.listBox1.Name = "listBox1";
			this.listBox1.Size = new System.Drawing.Size(156, 436);
			this.listBox1.TabIndex = 0;
			this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
			// 
			// groupBox5
			// 
			this.groupBox5.Controls.Add(this.button6);
			this.groupBox5.Controls.Add(this.button7);
			this.groupBox5.Location = new System.Drawing.Point(572, 428);
			this.groupBox5.Name = "groupBox5";
			this.groupBox5.Size = new System.Drawing.Size(208, 60);
			this.groupBox5.TabIndex = 2;
			this.groupBox5.TabStop = false;
			// 
			// button6
			// 
			this.button6.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(64)), ((System.Byte)(64)), ((System.Byte)(64)));
			this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.button6.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.button6.ForeColor = System.Drawing.Color.Lime;
			this.button6.Location = new System.Drawing.Point(20, 24);
			this.button6.Name = "button6";
			this.button6.Size = new System.Drawing.Size(68, 20);
			this.button6.TabIndex = 5;
			this.button6.Text = "<=";
			this.button6.TextAlign = System.Drawing.ContentAlignment.TopCenter;
			this.button6.Click += new System.EventHandler(this.button6_Click);
			// 
			// button7
			// 
			this.button7.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(64)), ((System.Byte)(64)), ((System.Byte)(64)));
			this.button7.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.button7.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.button7.ForeColor = System.Drawing.Color.Lime;
			this.button7.Location = new System.Drawing.Point(124, 24);
			this.button7.Name = "button7";
			this.button7.Size = new System.Drawing.Size(68, 20);
			this.button7.TabIndex = 4;
			this.button7.Text = "=>";
			this.button7.TextAlign = System.Drawing.ContentAlignment.TopCenter;
			this.button7.Click += new System.EventHandler(this.button7_Click);
			// 
			// textBox4
			// 
			this.textBox4.Location = new System.Drawing.Point(556, 252);
			this.textBox4.Name = "textBox4";
			this.textBox4.Size = new System.Drawing.Size(252, 21);
			this.textBox4.TabIndex = 0;
			this.textBox4.Text = "";
			this.textBox4.Visible = false;
			// 
			// groupBox6
			// 
			this.groupBox6.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
			this.groupBox6.Controls.Add(this.button10);
			this.groupBox6.Controls.Add(this.textBox17);
			this.groupBox6.Controls.Add(this.label15);
			this.groupBox6.Controls.Add(this.textBox18);
			this.groupBox6.Controls.Add(this.textBox19);
			this.groupBox6.Controls.Add(this.label16);
			this.groupBox6.Controls.Add(this.label17);
			this.groupBox6.Controls.Add(this.button11);
			this.groupBox6.Location = new System.Drawing.Point(204, 128);
			this.groupBox6.Name = "groupBox6";
			this.groupBox6.Size = new System.Drawing.Size(336, 172);
			this.groupBox6.TabIndex = 13;
			this.groupBox6.TabStop = false;
			this.groupBox6.Text = "服务器配置信息";
			this.groupBox6.Visible = false;
			// 
			// button10
			// 
			this.button10.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(64)), ((System.Byte)(64)), ((System.Byte)(64)));
			this.button10.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.button10.ForeColor = System.Drawing.Color.Lime;
			this.button10.Location = new System.Drawing.Point(84, 132);
			this.button10.Name = "button10";
			this.button10.Size = new System.Drawing.Size(80, 24);
			this.button10.TabIndex = 2;
			this.button10.Text = "确  定";
			this.button10.Click += new System.EventHandler(this.button10_Click);
			// 
			// textBox17
			// 
			this.textBox17.Location = new System.Drawing.Point(84, 32);
			this.textBox17.Name = "textBox17";
			this.textBox17.Size = new System.Drawing.Size(212, 21);
			this.textBox17.TabIndex = 1;
			this.textBox17.Text = "";
			// 
			// label15
			// 
			this.label15.Location = new System.Drawing.Point(12, 32);
			this.label15.Name = "label15";
			this.label15.Size = new System.Drawing.Size(72, 20);
			this.label15.TabIndex = 0;
			this.label15.Text = "服务器名:";
			// 
			// textBox18
			// 
			this.textBox18.Location = new System.Drawing.Point(84, 64);
			this.textBox18.Name = "textBox18";
			this.textBox18.PasswordChar = '*';
			this.textBox18.Size = new System.Drawing.Size(212, 21);
			this.textBox18.TabIndex = 1;
			this.textBox18.Text = "";
			// 
			// textBox19
			// 
			this.textBox19.Location = new System.Drawing.Point(84, 100);
			this.textBox19.Name = "textBox19";
			this.textBox19.PasswordChar = '*';
			this.textBox19.Size = new System.Drawing.Size(212, 21);
			this.textBox19.TabIndex = 1;
			this.textBox19.Text = "";
			this.textBox19.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox19_KeyDown);
			// 
			// label16
			// 
			this.label16.Location = new System.Drawing.Point(12, 68);
			this.label16.Name = "label16";
			this.label16.Size = new System.Drawing.Size(72, 20);
			this.label16.TabIndex = 0;
			this.label16.Text = "登 陆 名:";
			// 
			// label17
			// 
			this.label17.Location = new System.Drawing.Point(12, 104);
			this.label17.Name = "label17";
			this.label17.Size = new System.Drawing.Size(68, 16);
			this.label17.TabIndex = 0;
			this.label17.Text = "登陆密码:";
			// 
			// button11
			// 
			this.button11.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(64)), ((System.Byte)(64)), ((System.Byte)(64)));
			this.button11.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.button11.ForeColor = System.Drawing.Color.Lime;
			this.button11.Location = new System.Drawing.Point(212, 132);
			this.button11.Name = "button11";
			this.button11.Size = new System.Drawing.Size(80, 24);
			this.button11.TabIndex = 2;
			this.button11.Text = "取  消";
			this.button11.Click += new System.EventHandler(this.button11_Click);
			// 
			// sqlDataAdapter1
			// 
			this.sqlDataAdapter1.DeleteCommand = this.sqlCommand1;
			this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
			this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
			this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																									  new System.Data.Common.DataTableMapping("Table", "EssentialInfo", new System.Data.Common.DataColumnMapping[] {
																																																					   new System.Data.Common.DataColumnMapping("姓名", "姓名"),
																																																					   new System.Data.Common.DataColumnMapping("性别", "性别"),
																																																					   new System.Data.Common.DataColumnMapping("学号", "学号"),
																																																					   new System.Data.Common.DataColumnMapping("学院", "学院"),
																																																					   new System.Data.Common.DataColumnMapping("专业", "专业"),
																																																					   new System.Data.Common.DataColumnMapping("班级", "班级"),
																																																					   new System.Data.Common.DataColumnMapping("电话", "电话"),
																																																					   new System.Data.Common.DataColumnMapping("出生年月", "出生年月"),
																																																					   new System.Data.Common.DataColumnMapping("民族", "民族"),
																																																					   new System.Data.Common.DataColumnMapping("籍贯", "籍贯"),
																																																					   new System.Data.Common.DataColumnMapping("住址", "住址"),
																																																					   new System.Data.Common.DataColumnMapping("来自何校", "来自何校"),
																																																					   new System.Data.Common.DataColumnMapping("政治面貌", "政治面貌"),
																																																					   new System.Data.Common.DataColumnMapping("备注", "备注"),
																																																					   new System.Data.Common.DataColumnMapping("照片", "照片")})});
			this.sqlDataAdapter1.UpdateCommand = this.sqlCommand2;
			// 
			// sqlInsertCommand1
			// 
			this.sqlInsertCommand1.CommandText = @"INSERT INTO EssentialInfo(姓名, 性别, 学号, 学院, 专业, 班级, 电话, 出生年月, 民族, 籍贯, 住址, 来自何校, 政治面貌, 备注, 照片) VALUES (@姓名, @性别, @学号, @学院, @专业, @班级, @电话, @出生年月, @民族, @籍贯, @住址, @来自何校, @政治面貌, @备注, @照片); SELECT 姓名, 性别, 学号, 学院, 专业, 班级, 电话, 出生年月, 民族, 籍贯, 住址, 来自何校, 政治面貌, 备注, 照片 FROM EssentialInfo";
			this.sqlInsertCommand1.Connection = this.sqlConnection1;
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.NVarChar, 10, "姓名"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@性别", System.Data.SqlDbType.NVarChar, 2, "性别"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@学号", System.Data.SqlDbType.NVarChar, 10, "学号"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@学院", System.Data.SqlDbType.NVarChar, 20, "学院"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@专业", System.Data.SqlDbType.NVarChar, 20, "专业"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@班级", System.Data.SqlDbType.NVarChar, 10, "班级"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@电话", System.Data.SqlDbType.NVarChar, 15, "电话"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@出生年月", System.Data.SqlDbType.NVarChar, 20, "出生年月"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@民族", System.Data.SqlDbType.NVarChar, 10, "民族"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@籍贯", System.Data.SqlDbType.NVarChar, 20, "籍贯"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@住址", System.Data.SqlDbType.NVarChar, 20, "住址"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@来自何校", System.Data.SqlDbType.NVarChar, 20, "来自何校"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@政治面貌", System.Data.SqlDbType.NVarChar, 10, "政治面貌"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@备注", System.Data.SqlDbType.NVarChar, 50, "备注"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@照片", System.Data.SqlDbType.VarBinary, 2147483647, "照片"));
			// 
			// sqlConnection1
			// 
			this.sqlConnection1.ConnectionString = "workstation id=CALMHAWK;packet size=4096;user id=sa;password=calmhawk;data source" +
				"=calmhawk;persist security info=False;initial catalog=Students";
			// 
			// sqlSelectCommand1
			// 
			this.sqlSelectCommand1.CommandText = "SELECT 姓名, 性别, 学号, 学院, 专业, 班级, 电话, 出生年月, 民族, 籍贯, 住址, 来自何校, 政治面貌, 备注, 照片 FROM Esse" +
				"ntialInfo";
			this.sqlSelectCommand1.Connection = this.sqlConnection1;
			// 
			// sqlCommand2
			// 
			this.sqlCommand2.Connection = this.sqlConnection1;
			// 
			// dataSet11
			// 
			this.dataSet11.DataSetName = "DataSet1";
			this.dataSet11.Locale = new System.Globalization.CultureInfo("zh-CN");
			// 
			// dataSet31
			// 
			this.dataSet31.DataSetName = "DataSet3";
			this.dataSet31.Locale = new System.Globalization.CultureInfo("zh-CN");
			// 
			// sqlDataAdapter2
			// 
			this.sqlDataAdapter2.InsertCommand = this.sqlInsertCommand2;
			this.sqlDataAdapter2.SelectCommand = this.sqlSelectCommand2;
			this.sqlDataAdapter2.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																									  new System.Data.Common.DataTableMapping("Table", "User_OperateInfo", new System.Data.Common.DataColumnMapping[] {
																																																						  new System.Data.Common.DataColumnMapping("username", "username"),
																																																						  new System.Data.Common.DataColumnMapping("datatime", "datatime"),
																																																						  new System.Data.Common.DataColumnMapping("operatelist", "operatelist")})});
			// 
			// sqlInsertCommand2
			// 
			this.sqlInsertCommand2.CommandText = "INSERT INTO User_OperateInfo(username, datatime, operatelist) VALUES (@username, " +
				"@datatime, @operatelist); SELECT username, datatime, operatelist FROM User_Opera" +
				"teInfo";
			this.sqlInsertCommand2.Connection = this.sqlConnection1;
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@username", System.Data.SqlDbType.NVarChar, 50, "username"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@datatime", System.Data.SqlDbType.DateTime, 8, "datatime"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@operatelist", System.Data.SqlDbType.NVarChar, 500, "operatelist"));
			// 
			// sqlSelectCommand2
			// 
			this.sqlSelectCommand2.CommandText = "SELECT username, datatime, operatelist FROM User_OperateInfo";
			this.sqlSelectCommand2.Connection = this.sqlConnection1;
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.Color.Teal;
			this.ClientSize = new System.Drawing.Size(792, 553);
			this.Controls.Add(this.groupBox6);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.textBox1);
			this.Controls.Add(this.comboBox1);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.button2);
			this.Controls.Add(this.button3);
			this.Controls.Add(this.button4);
			this.Controls.Add(this.button5);
			this.Controls.Add(this.groupBox1);
			this.Controls.Add(this.dataGrid1);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.MaximumSize = new System.Drawing.Size(800, 580);
			this.Menu = this.mainMenu1;
			this.MinimumSize = new System.Drawing.Size(800, 580);
			this.Name = "Form1";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "风中枫叶 学籍管理系统 V1.1";
			this.Load += new System.EventHandler(this.Form1_Load);
			this.Closed += new System.EventHandler(this.Form1_Closed);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
			this.groupBox1.ResumeLayout(false);
			this.groupBox4.ResumeLayout(false);
			this.groupBox3.ResumeLayout(false);
			this.groupBox2.ResumeLayout(false);
			this.groupBox5.ResumeLayout(false);
			this.groupBox6.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.dataSet31)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>
		[STAThread]
		

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -