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

📄 courseinfo.cs

📁 数据库的课程设计作业。管理有关学生、课程的基本信息
💻 CS
📖 第 1 页 / 共 3 页
字号:
			this.toolBarButton5.Text = "添加";
			this.toolBarButton5.ToolTipText = "添加";
			// 
			// toolBarButton6
			// 
			this.toolBarButton6.Text = "删除";
			this.toolBarButton6.ToolTipText = "删除";
			// 
			// dataGrid1
			// 
			this.dataGrid1.CaptionVisible = false;
			this.dataGrid1.DataMember = "";
			this.dataGrid1.DataSource = this.dataSet11.课程表;
			this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid1.Location = new System.Drawing.Point(16, 128);
			this.dataGrid1.Name = "dataGrid1";
			this.dataGrid1.ReadOnly = true;
			this.dataGrid1.Size = new System.Drawing.Size(560, 248);
			this.dataGrid1.TabIndex = 2;
			// 
			// dataSet11
			// 
			this.dataSet11.DataSetName = "DataSet1";
			this.dataSet11.Locale = new System.Globalization.CultureInfo("zh-CN");
			// 
			// 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(392, 408);
			this.cmb1.Name = "cmb1";
			this.cmb1.Size = new System.Drawing.Size(64, 20);
			this.cmb1.TabIndex = 7;
			// 
			// da1
			// 
			this.da1.DeleteCommand = this.sqlDeleteCommand1;
			this.da1.InsertCommand = this.sqlInsertCommand1;
			this.da1.SelectCommand = this.sqlSelectCommand1;
			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.sqlUpdateCommand1;
			// 
			// sqlDeleteCommand1
			// 
			this.sqlDeleteCommand1.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_必修或选修) 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.sqlDeleteCommand1.Connection = this.sqlConnection1;
			this.sqlDeleteCommand1.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.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_上课地点", System.Data.SqlDbType.VarChar, 40, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "上课地点", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_学分", System.Data.SqlDbType.Real, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "学分", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.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.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_必修或选修", System.Data.SqlDbType.VarChar, 6, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "必修或选修", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_教师", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "教师", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.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.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_课程名", System.Data.SqlDbType.VarChar, 40, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "课程名", System.Data.DataRowVersion.Original, null));
			// 
			// sqlConnection1
			// 
			this.sqlConnection1.ConnectionString = "workstation id=\"IBM-1A298E66873\";packet size=4096;integrated security=SSPI;initia" +
				"l catalog=\"study&teach\";persist security info=False";
			// 
			// sqlInsertCommand1
			// 
			this.sqlInsertCommand1.CommandText = "INSERT INTO 课程表(课程号, 课程名, 必修或选修, 教师, 学分, 学时, 上课地点, 是否本学期课程) VALUES (@课程号, @课程名, @" +
				"必修或选修, @教师, @学分, @学时, @上课地点, @是否本学期课程); SELECT 课程号, 课程名, 必修或选修, 教师, 学分, 学时, 上课地点" +
				", 是否本学期课程 FROM 课程表 WHERE (课程号 = @课程号)";
			this.sqlInsertCommand1.Connection = this.sqlConnection1;
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@课程号", System.Data.SqlDbType.VarChar, 8, "课程号"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@课程名", System.Data.SqlDbType.VarChar, 40, "课程名"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@必修或选修", System.Data.SqlDbType.VarChar, 6, "必修或选修"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@教师", System.Data.SqlDbType.VarChar, 50, "教师"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@学分", System.Data.SqlDbType.Real, 4, "学分"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@学时", System.Data.SqlDbType.Int, 4, "学时"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@上课地点", System.Data.SqlDbType.VarChar, 40, "上课地点"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@是否本学期课程", System.Data.SqlDbType.VarChar, 2, "是否本学期课程"));
			// 
			// sqlSelectCommand1
			// 
			this.sqlSelectCommand1.CommandText = "SELECT 课程号, 课程名, 必修或选修, 教师, 学分, 学时, 上课地点, 是否本学期课程 FROM 课程表 WHERE (课程号 LIKE @param" +
				"eter0) AND (课程名 LIKE @parameter1)";
			this.sqlSelectCommand1.Connection = this.sqlConnection1;
			this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@parameter0", System.Data.SqlDbType.VarChar, 8, "课程号"));
			this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@parameter1", System.Data.SqlDbType.VarChar, 40, "课程名"));
			// 
			// sqlUpdateCommand1
			// 
			this.sqlUpdateCommand1.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_必修或选修) 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.sqlUpdateCommand1.Connection = this.sqlConnection1;
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@课程号", System.Data.SqlDbType.VarChar, 8, "课程号"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@课程名", System.Data.SqlDbType.VarChar, 40, "课程名"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@必修或选修", System.Data.SqlDbType.VarChar, 6, "必修或选修"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@教师", System.Data.SqlDbType.VarChar, 50, "教师"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@学分", System.Data.SqlDbType.Real, 4, "学分"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@学时", System.Data.SqlDbType.Int, 4, "学时"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@上课地点", System.Data.SqlDbType.VarChar, 40, "上课地点"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@是否本学期课程", System.Data.SqlDbType.VarChar, 2, "是否本学期课程"));
			this.sqlUpdateCommand1.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.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_上课地点", System.Data.SqlDbType.VarChar, 40, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "上课地点", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_学分", System.Data.SqlDbType.Real, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "学分", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.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.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_必修或选修", System.Data.SqlDbType.VarChar, 6, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "必修或选修", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_教师", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "教师", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.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.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_课程名", System.Data.SqlDbType.VarChar, 40, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "课程名", System.Data.DataRowVersion.Original, null));
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(48, 448);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(48, 23);
			this.label3.TabIndex = 8;
			this.label3.Text = "学时";
			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(168, 448);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(40, 23);
			this.label4.TabIndex = 9;
			this.label4.Text = "学分";
			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(472, 448);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(32, 23);
			this.label5.TabIndex = 10;
			this.label5.Text = "教师";
			this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// label6
			// 
			this.label6.Location = new System.Drawing.Point(272, 448);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(56, 23);
			this.label6.TabIndex = 11;
			this.label6.Text = "上课地点";
			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// label7
			// 
			this.label7.Location = new System.Drawing.Point(384, 384);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(80, 23);
			this.label7.TabIndex = 12;
			this.label7.Text = "必修或选修";
			this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// txt8
			// 
			this.txt8.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "课程表.课程名"));
			this.txt8.Location = new System.Drawing.Point(200, 408);
			this.txt8.Name = "txt8";
			this.txt8.ReadOnly = true;
			this.txt8.Size = new System.Drawing.Size(160, 21);
			this.txt8.TabIndex = 14;
			this.txt8.Text = "";
			// 
			// label8
			// 
			this.label8.Location = new System.Drawing.Point(200, 384);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(48, 23);
			this.label8.TabIndex = 15;
			this.label8.Text = "课程名";
			this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// label9
			// 
			this.label9.Location = new System.Drawing.Point(64, 384);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(48, 23);
			this.label9.TabIndex = 16;
			this.label9.Text = "课程号";
			this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			this.label9.Click += new System.EventHandler(this.label9_Click);
			// 
			// txt7
			// 
			this.txt7.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "课程表.课程号"));
			this.txt7.Location = new System.Drawing.Point(64, 408);
			this.txt7.Name = "txt7";
			this.txt7.ReadOnly = true;
			this.txt7.TabIndex = 13;
			this.txt7.Text = "";
			// 
			// 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",
													  "2.5",
													  "3",
													  "3.5",
													  "4"});
			this.cmb2.Location = new System.Drawing.Point(56, 472);
			this.cmb2.Name = "cmb2";
			this.cmb2.Size = new System.Drawing.Size(72, 20);
			this.cmb2.TabIndex = 17;
			// 
			// cmb3
			// 
			this.cmb3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "课程表.学分"));
			this.cmb3.Enabled = false;
			this.cmb3.Items.AddRange(new object[] {
													  "0.5",
													  "1",
													  "1.5",
													  "2",
													  "3",
													  "4",
													  "5"});
			this.cmb3.Location = new System.Drawing.Point(168, 472);
			this.cmb3.Name = "cmb3";
			this.cmb3.Size = new System.Drawing.Size(72, 20);
			this.cmb3.TabIndex = 18;
			// 
			// cmb4
			// 
			this.cmb4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "课程表.教师"));
			this.cmb4.DataSource = this.dataSet11.课程表;
			this.cmb4.DisplayMember = "教师";
			this.cmb4.Enabled = false;
			this.cmb4.Location = new System.Drawing.Point(480, 472);
			this.cmb4.Name = "cmb4";
			this.cmb4.Size = new System.Drawing.Size(96, 20);
			this.cmb4.TabIndex = 19;

⌨️ 快捷键说明

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