📄 studentinfo.cs
字号:
//
this.txt1.Location = new System.Drawing.Point(192, 16);
this.txt1.Name = "txt1";
this.txt1.Size = new System.Drawing.Size(96, 21);
this.txt1.TabIndex = 2;
this.txt1.Text = "";
this.txt1.TextChanged += new System.EventHandler(this.txt1_TextChanged);
//
// label1
//
this.label1.Location = new System.Drawing.Point(128, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 24);
this.label1.TabIndex = 1;
this.label1.Text = "学号";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnSearch
//
this.btnSearch.Location = new System.Drawing.Point(16, 16);
this.btnSearch.Name = "btnSearch";
this.btnSearch.TabIndex = 0;
this.btnSearch.Text = "搜索";
this.btnSearch.Click += new System.EventHandler(this.btsearch_Click);
//
// da1
//
this.da1.DeleteCommand = this.sqlDeleteCommand2;
this.da1.InsertCommand = this.sqlInsertCommand2;
this.da1.SelectCommand = this.sqlSelectCommand2;
this.da1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "学生表", 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.da1.UpdateCommand = this.sqlUpdateCommand2;
this.da1.RowUpdated += new System.Data.SqlClient.SqlRowUpdatedEventHandler(this.da1_RowUpdated);
//
// sqlDeleteCommand2
//
this.sqlDeleteCommand2.CommandText = @"DELETE FROM 学生表 WHERE (学号 = @Original_学号) AND (出生日期 = @Original_出生日期 OR @Original_出生日期 IS NULL AND 出生日期 IS NULL) AND (姓名 = @Original_姓名 OR @Original_姓名 IS NULL AND 姓名 IS NULL) AND (学制 = @Original_学制 OR @Original_学制 IS NULL AND 学制 IS NULL) AND (年级 = @Original_年级 OR @Original_年级 IS NULL AND 年级 IS NULL) AND (性别 = @Original_性别 OR @Original_性别 IS NULL AND 性别 IS NULL) AND (所属院系 = @Original_所属院系 OR @Original_所属院系 IS NULL AND 所属院系 IS NULL) AND (班级名称 = @Original_班级名称 OR @Original_班级名称 IS NULL AND 班级名称 IS NULL)";
this.sqlDeleteCommand2.Connection = this.sqlConnection2;
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_学号", System.Data.SqlDbType.VarChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "学号", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_出生日期", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "出生日期", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_姓名", System.Data.SqlDbType.VarChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "姓名", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_学制", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "学制", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_年级", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "年级", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_性别", System.Data.SqlDbType.VarChar, 2, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "性别", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_所属院系", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "所属院系", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_班级名称", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "班级名称", System.Data.DataRowVersion.Original, null));
//
// sqlConnection2
//
this.sqlConnection2.ConnectionString = "workstation id=\"IBM-1A298E66873\";packet size=4096;integrated security=SSPI;initia" +
"l catalog=\"study&teach\";persist security info=False";
//
// sqlInsertCommand2
//
this.sqlInsertCommand2.CommandText = "INSERT INTO 学生表(学号, 姓名, 性别, 出生日期, 班级名称, 所属院系, 年级, 学制) VALUES (@学号, @姓名, @性别, @出生日" +
"期, @班级名称, @所属院系, @年级, @学制); SELECT 学号, 姓名, 性别, 出生日期, 班级名称, 所属院系, 年级, 学制 FROM 学生表" +
" WHERE (学号 = @学号)";
this.sqlInsertCommand2.Connection = this.sqlConnection2;
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@学号", System.Data.SqlDbType.VarChar, 8, "学号"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.VarChar, 8, "姓名"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@性别", System.Data.SqlDbType.VarChar, 2, "性别"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@出生日期", System.Data.SqlDbType.DateTime, 8, "出生日期"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@班级名称", System.Data.SqlDbType.VarChar, 30, "班级名称"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@所属院系", System.Data.SqlDbType.VarChar, 30, "所属院系"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@年级", System.Data.SqlDbType.Int, 4, "年级"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@学制", System.Data.SqlDbType.Int, 4, "学制"));
//
// sqlSelectCommand2
//
this.sqlSelectCommand2.CommandText = "SELECT 学号, 姓名, 性别, 出生日期, 班级名称, 所属院系, 年级, 学制 FROM 学生表 WHERE (学号 LIKE @Parameter0) " +
"AND (姓名 LIKE @Parameter1)";
this.sqlSelectCommand2.Connection = this.sqlConnection2;
this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Parameter0", System.Data.SqlDbType.VarChar, 8, "学号"));
this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Parameter1", System.Data.SqlDbType.VarChar, 8, "姓名"));
//
// sqlUpdateCommand2
//
this.sqlUpdateCommand2.CommandText = @"UPDATE 学生表 SET 学号 = @学号, 姓名 = @姓名, 性别 = @性别, 出生日期 = @出生日期, 班级名称 = @班级名称, 所属院系 = @所属院系, 年级 = @年级, 学制 = @学制 WHERE (学号 = @Original_学号) AND (出生日期 = @Original_出生日期 OR @Original_出生日期 IS NULL AND 出生日期 IS NULL) AND (姓名 = @Original_姓名 OR @Original_姓名 IS NULL AND 姓名 IS NULL) AND (学制 = @Original_学制 OR @Original_学制 IS NULL AND 学制 IS NULL) AND (年级 = @Original_年级 OR @Original_年级 IS NULL AND 年级 IS NULL) AND (性别 = @Original_性别 OR @Original_性别 IS NULL AND 性别 IS NULL) AND (所属院系 = @Original_所属院系 OR @Original_所属院系 IS NULL AND 所属院系 IS NULL) AND (班级名称 = @Original_班级名称 OR @Original_班级名称 IS NULL AND 班级名称 IS NULL); SELECT 学号, 姓名, 性别, 出生日期, 班级名称, 所属院系, 年级, 学制 FROM 学生表 WHERE (学号 = @学号)";
this.sqlUpdateCommand2.Connection = this.sqlConnection2;
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@学号", System.Data.SqlDbType.VarChar, 8, "学号"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.VarChar, 8, "姓名"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@性别", System.Data.SqlDbType.VarChar, 2, "性别"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@出生日期", System.Data.SqlDbType.DateTime, 8, "出生日期"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@班级名称", System.Data.SqlDbType.VarChar, 30, "班级名称"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@所属院系", System.Data.SqlDbType.VarChar, 30, "所属院系"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@年级", System.Data.SqlDbType.Int, 4, "年级"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@学制", System.Data.SqlDbType.Int, 4, "学制"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_学号", System.Data.SqlDbType.VarChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "学号", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_出生日期", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "出生日期", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_姓名", System.Data.SqlDbType.VarChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "姓名", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_学制", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "学制", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_年级", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "年级", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_性别", System.Data.SqlDbType.VarChar, 2, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "性别", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_所属院系", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "所属院系", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_班级名称", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "班级名称", System.Data.DataRowVersion.Original, null));
//
// sqlConnection4
//
this.sqlConnection4.ConnectionString = "workstation id=\"IBM-1A298E66873\";packet size=4096;integrated security=SSPI;initia" +
"l catalog=\"study&teach\";persist security info=False";
//
// sqlConnection3
//
this.sqlConnection3.ConnectionString = "workstation id=\"IBM-1A298E66873\";packet size=4096;integrated security=SSPI;initia" +
"l catalog=\"study&teach\";persist security info=False";
//
// sqlConnection5
//
this.sqlConnection5.ConnectionString = "workstation id=\"IBM-1A298E66873\";packet size=4096;integrated security=SSPI;initia" +
"l catalog=\"study&teach\";persist security info=False";
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "workstation id=\"IBM-1A298E66873\";packet size=4096;integrated security=SSPI;initia" +
"l catalog=\"study&teach\";persist security info=False";
//
// txt4
//
this.txt4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "学生表.学号"));
this.txt4.Location = new System.Drawing.Point(32, 448);
this.txt4.Name = "txt4";
this.txt4.ReadOnly = true;
this.txt4.Size = new System.Drawing.Size(72, 21);
this.txt4.TabIndex = 2;
this.txt4.Text = "";
//
// txt5
//
this.txt5.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "学生表.姓名"));
this.txt5.Location = new System.Drawing.Point(144, 448);
this.txt5.Name = "txt5";
this.txt5.ReadOnly = true;
this.txt5.Size = new System.Drawing.Size(72, 21);
this.txt5.TabIndex = 3;
this.txt5.Text = "";
this.txt5.TextChanged += new System.EventHandler(this.txt5_TextChanged);
//
// cmb1
//
this.cmb1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "学生表.性别"));
this.cmb1.Enabled = false;
this.cmb1.Items.AddRange(new object[] {
"男",
"女"});
this.cmb1.Location = new System.Drawing.Point(272, 448);
this.cmb1.Name = "cmb1";
this.cmb1.Size = new System.Drawing.Size(64, 20);
this.cmb1.TabIndex = 7;
this.cmb1.SelectedIndexChanged += new System.EventHandler(this.cmb1_SelectedIndexChanged);
//
// cmb2
//
this.cmb2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "学生表.年级"));
this.cmb2.Enabled = false;
this.cmb2.Items.AddRange(new object[] {
"1",
"2",
"3",
"4",
"5"});
this.cmb2.Location = new System.Drawing.Point(392, 504);
this.cmb2.Name = "cmb2";
this.cmb2.Size = new System.Drawing.Size(64, 20);
this.cmb2.TabIndex = 8;
this.cmb2.TextChanged += new System.EventHandler(this.cmb2_SelectedIndexChanged);
//
// lable4
//
this.lable4.Location = new System.Drawing.Point(32, 424);
this.lable4.Name = "lable4";
this.lable4.Size = new System.Drawing.Size(64, 23);
this.lable4.TabIndex = 9;
this.lable4.Text = "学号";
this.lable4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label5
//
this.label5.Location = new System.Drawing.Point(144, 424);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(96, 23);
this.label5.TabIndex = 10;
this.label5.Text = "姓名";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label6
//
this.label6.Location = new System.Drawing.Point(272, 424);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(40, 23);
this.label6.TabIndex = 11;
this.label6.Text = "性别";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label7
//
this.label7.Location = new System.Drawing.Point(384, 424);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(96, 23);
this.label7.TabIndex = 12;
this.label7.Text = "出生日期";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label8
//
this.label8.Location = new System.Drawing.Point(24, 480);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(96, 23);
this.label8.TabIndex = 13;
this.label8.Text = "班级名称";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -