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

📄 f5修1.cs

📁 vb 图书馆管理系统。
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.label4.Text = "性别";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(232, 72);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(96, 23);
			this.label3.TabIndex = 7;
			this.label3.Text = "年龄";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(104, 72);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(88, 23);
			this.label2.TabIndex = 6;
			this.label2.Text = "姓名";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(0, 72);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(80, 24);
			this.label1.TabIndex = 5;
			this.label1.Text = "教师号 *";
			// 
			// textBox5
			// 
			this.textBox5.Location = new System.Drawing.Point(464, 112);
			this.textBox5.Name = "textBox5";
			this.textBox5.Size = new System.Drawing.Size(104, 21);
			this.textBox5.TabIndex = 4;
			this.textBox5.Text = "";
			// 
			// textBox4
			// 
			this.textBox4.Location = new System.Drawing.Point(352, 112);
			this.textBox4.Name = "textBox4";
			this.textBox4.Size = new System.Drawing.Size(96, 21);
			this.textBox4.TabIndex = 3;
			this.textBox4.Text = "";
			// 
			// textBox3
			// 
			this.textBox3.Location = new System.Drawing.Point(224, 112);
			this.textBox3.Name = "textBox3";
			this.textBox3.Size = new System.Drawing.Size(104, 21);
			this.textBox3.TabIndex = 2;
			this.textBox3.Text = "";
			// 
			// textBox1
			// 
			this.textBox1.Location = new System.Drawing.Point(0, 112);
			this.textBox1.Name = "textBox1";
			this.textBox1.Size = new System.Drawing.Size(80, 21);
			this.textBox1.TabIndex = 0;
			this.textBox1.Text = "";
			// 
			// textBox2
			// 
			this.textBox2.Location = new System.Drawing.Point(104, 112);
			this.textBox2.Name = "textBox2";
			this.textBox2.Size = new System.Drawing.Size(88, 21);
			this.textBox2.TabIndex = 1;
			this.textBox2.Text = "";
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(632, 104);
			this.button1.Name = "button1";
			this.button1.TabIndex = 6;
			this.button1.Text = "修改";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// label7
			// 
			this.label7.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.label7.Location = new System.Drawing.Point(80, 120);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(8, 8);
			this.label7.TabIndex = 11;
			this.label7.Text = "*";
			// 
			// dataGrid1
			// 
			this.dataGrid1.DataMember = "";
			this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid1.Location = new System.Drawing.Point(24, 208);
			this.dataGrid1.Name = "dataGrid1";
			this.dataGrid1.Size = new System.Drawing.Size(592, 160);
			this.dataGrid1.TabIndex = 7;
			// 
			// button2
			// 
			this.button2.Location = new System.Drawing.Point(656, 216);
			this.button2.Name = "button2";
			this.button2.TabIndex = 8;
			this.button2.Text = "刷新";
			this.button2.Click += new System.EventHandler(this.button2_Click);
			// 
			// button3
			// 
			this.button3.Location = new System.Drawing.Point(656, 264);
			this.button3.Name = "button3";
			this.button3.TabIndex = 9;
			this.button3.Text = "删除";
			this.button3.Click += new System.EventHandler(this.button3_Click);
			// 
			// Form5
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackgroundImage = ((System.Drawing.Bitmap)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = new System.Drawing.Size(742, 473);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.button3,
																		  this.button2,
																		  this.dataGrid1,
																		  this.groupBox1});
			this.MaximizeBox = false;
			this.Menu = this.mainMenu1;
			this.Name = "Form5";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "修改教师表";
			this.groupBox1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

	
		private void menuItem24_Click(object sender, System.EventArgs e)
		{
			Application.Exit();
		}

		private void menuItem23_Click(object sender, System.EventArgs e)
		{
			MessageBox.Show("               数据库课程设计\r                        -------教学管理系统\r\r小组成员:金铎,汪欣,齐肖西,李莎,王丽芳");
		}

		private void menuItem22_Click(object sender, System.EventArgs e)
		{
			MessageBox.Show("暂无帮助信息!");
		}

		private void menuItem2_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form2=new Form2();
			form2.ShowDialog ();
		}

		private void menuItem3_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form3=new Form3();
			form3.ShowDialog ();
		}

		private void menuItem4_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form4=new Form4();
			form4.ShowDialog ();
		}

		private void menuItem6_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form5=new Form5();
			form5.ShowDialog ();
		}

		private void menuItem7_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form6=new Form6();
			form6.ShowDialog ();
		}

		private void menuItem8_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form7=new Form7();
			form7.ShowDialog ();
		}

		private void menuItem10_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form8=new Form8();
			form8.ShowDialog ();
		}

		private void menuItem11_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form9=new Form9();
			form9.ShowDialog ();
		}

		private void menuItem12_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form10=new Form10();
			form10.ShowDialog ();
		}

		private void menuItem13_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form11=new Form11();
			form11.ShowDialog ();
		}

		private void menuItem15_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form12=new Form12();
			form12.ShowDialog ();
		}

		private void menuItem16_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form13=new Form13();
			form13.ShowDialog ();
		}

		private void menuItem18_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form14=new Form14();
			form14.ShowDialog ();
		}

		private void menuItem19_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form15=new Form15();
			form15.ShowDialog ();
		}

		private void menuItem20_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form16=new Form16();
			form16.ShowDialog ();
		}

		private void menuItem21_Click(object sender, System.EventArgs e)
		{
			this.Hide();
			Form form17=new Form17();
			form17.ShowDialog ();
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			string t_tno;
			int t_tage;
			string t_tname,t_tsex,t_tcourse;
			//  t_tage =int.Parse(textBox1.Text);
			t_tno =textBox1.Text;
			t_tname = textBox2.Text;
			t_tage =int.Parse(textBox3.Text);
			t_tsex=textBox4.Text;
			t_tcourse=textBox5.Text;
		
			MessageBox.Show("\t学号: "+t_tno+"\t姓名: "+t_tname+"\t年龄: "+t_tage+"\t性别: "+t_tsex+"\t教授课程: "+t_tcourse);
			SqlConnection connection = new SqlConnection("workstation id=S0353;packet size=4096;integrated security=SSPI;data source=S0353;persist security info=False;initial catalog=TSC");
			try
			{
				connection.Open();
				SqlCommand command = new SqlCommand("update T set Tname='"+t_tname+"',Tage='"+t_tage+"',Tsex='"+t_tsex+"',Tcourse='"+t_tcourse+"'where Tno='"+t_tno+"'",connection);
				command.ExecuteNonQuery();
				MessageBox.Show("修改成功");
           
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}

			string constr= "workstation id=S0353;packet size=4096;integrated security=SSPI;data source=S0353;pe" +
				"rsist security info=False;initial catalog=TSC";
			string sq1="select * from T where (Tno='"+textBox1.Text+"')";
			SqlConnection cn1=new SqlConnection(constr);
			SqlDataAdapter sqlDataAdapter1=new SqlDataAdapter(sq1,cn1);
			DataSet dt1=new DataSet();
			sqlDataAdapter1.Fill(dt1,"T");
			dataGrid1.SetDataBinding(dt1,"T");
				
		}

		private void button2_Click(object sender, System.EventArgs e)
		{
           
			string constr= "workstation id=S0353;packet size=4096;integrated security=SSPI;data source=S0353;pe" +
				"rsist security info=False;initial catalog=TSC";
			string sq1="select * from T";
			SqlConnection cn1=new SqlConnection(constr);
			SqlDataAdapter sqlDataAdapter1=new SqlDataAdapter(sq1,cn1);
			DataSet dt1=new DataSet();
			sqlDataAdapter1.Fill(dt1,"T");
			dataGrid1.SetDataBinding(dt1,"T");


			//sqlDataAdapter1.Fill(dataSet11,"T");
			//dataGrid1.SetDataBinding(dataSet11,"T");
			dataGrid1.Update ();
		}

		private void button3_Click(object sender, System.EventArgs e)
		{
			string t_tno;
			int t_tage;
			string t_tname,t_tsex,t_tcourse;
			//  t_tage =int.Parse(textBox1.Text);
			t_tno =textBox1.Text;
			t_tname = textBox2.Text;
			t_tage =int.Parse(textBox3.Text);
			t_tsex=textBox4.Text;
			t_tcourse=textBox5.Text;
		
			MessageBox.Show("\t学号: "+t_tno+"\t姓名: "+t_tname+"\t年龄: "+t_tage+"\t性别: "+t_tsex+"\t教授课程: "+t_tcourse);
			SqlConnection connection = new SqlConnection("workstation id=S0353;packet size=4096;integrated security=SSPI;data source=S0353;persist security info=False;initial catalog=TSC");
			try
			{
				connection.Open();
				//SqlCommand command = new SqlCommand("delete T where Tno="+t_tno,connection);
				SqlCommand command = new SqlCommand("delete from T where Tno='"+t_tno+"'",connection);
				command.ExecuteNonQuery();
				MessageBox.Show("修改成功");
           
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}

			string constr= "workstation id=S0353;packet size=4096;integrated security=SSPI;data source=S0353;pe" +
				"rsist security info=False;initial catalog=TSC";
			string sq1="select * from T ";
			SqlConnection cn1=new SqlConnection(constr);
			SqlDataAdapter sqlDataAdapter1=new SqlDataAdapter(sq1,cn1);
			DataSet dt1=new DataSet();
			sqlDataAdapter1.Fill(dt1,"T");
			dataGrid1.SetDataBinding(dt1,"T");
				
		}

		

	
	}
}

⌨️ 快捷键说明

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