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

📄 form_kcxxyl.cs

📁 一个很简单的考试系统。实用性很强啊!数据库在里面
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@exaI_registerTime", System.Data.SqlDbType.DateTime, 8, "exaI_registerTime"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@exaI_score", System.Data.SqlDbType.Float, 8, "exaI_score"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@exal_memo", System.Data.SqlDbType.VarChar, 200, "exal_memo"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_cou_no", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "cou_no", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_exaI_examTime", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "exaI_examTime", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_stu_id", System.Data.SqlDbType.VarChar, 16, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "stu_id", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_add_code", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "add_code", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_exaI_licenceNo", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "exaI_licenceNo", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_exaI_registerTime", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "exaI_registerTime", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_exaI_score", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "exaI_score", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_exal_memo", System.Data.SqlDbType.VarChar, 200, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "exal_memo", System.Data.DataRowVersion.Original, null));
			// 
			// sqlDeleteCommand1
			// 
			this.sqlDeleteCommand1.CommandText = @"DELETE FROM examInfo WHERE (cou_no = @Original_cou_no) AND (exaI_examTime = @Original_exaI_examTime) AND (stu_id = @Original_stu_id) AND (add_code = @Original_add_code OR @Original_add_code IS NULL AND add_code IS NULL) AND (exaI_licenceNo = @Original_exaI_licenceNo OR @Original_exaI_licenceNo IS NULL AND exaI_licenceNo IS NULL) AND (exaI_registerTime = @Original_exaI_registerTime OR @Original_exaI_registerTime IS NULL AND exaI_registerTime IS NULL) AND (exaI_score = @Original_exaI_score OR @Original_exaI_score IS NULL AND exaI_score IS NULL) AND (exal_memo = @Original_exal_memo OR @Original_exal_memo IS NULL AND exal_memo IS NULL)";
			this.sqlDeleteCommand1.Connection = this.sqlConnection1;
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_cou_no", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "cou_no", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_exaI_examTime", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "exaI_examTime", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_stu_id", System.Data.SqlDbType.VarChar, 16, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "stu_id", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_add_code", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "add_code", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_exaI_licenceNo", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "exaI_licenceNo", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_exaI_registerTime", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "exaI_registerTime", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_exaI_score", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "exaI_score", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_exal_memo", System.Data.SqlDbType.VarChar, 200, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "exal_memo", System.Data.DataRowVersion.Original, null));
			// 
			// sqlDataAdapter1
			// 
			this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;
			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", "examInfo", new System.Data.Common.DataColumnMapping[] {
																																																				  new System.Data.Common.DataColumnMapping("cou_no", "cou_no"),
																																																				  new System.Data.Common.DataColumnMapping("stu_id", "stu_id"),
																																																				  new System.Data.Common.DataColumnMapping("exaI_examTime", "exaI_examTime"),
																																																				  new System.Data.Common.DataColumnMapping("add_code", "add_code"),
																																																				  new System.Data.Common.DataColumnMapping("exaI_licenceNo", "exaI_licenceNo"),
																																																				  new System.Data.Common.DataColumnMapping("exaI_registerTime", "exaI_registerTime"),
																																																				  new System.Data.Common.DataColumnMapping("exaI_score", "exaI_score"),
																																																				  new System.Data.Common.DataColumnMapping("exal_memo", "exal_memo")})});
			this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
			// 
			// Form_kcxxyl
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(848, 438);
			this.Controls.Add(this.dataGrid1);
			this.Name = "Form_kcxxyl";
			this.Text = "Form_kcxxyl";
			this.Load += new System.EventHandler(this.Form_kcxxyl_Load);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void Form_kcxxyl_Load(object sender, System.EventArgs e)
		{
			//动态创建控件:
			System.Windows.Forms.Button btn = new Button();
			btn.Name = "btn1";
			btn.Text = "生成的按钮->添数据";
			
			btn.Left = 400;
			btn.Top = 400;
			

			//指定Button的单击事件!
			btn.Click +=new EventHandler(btn_Click);
			this.Controls.Add(btn);

			this.sqlConnection1.Open();
		
		}

		private void btn_Click(object sender, EventArgs e)
		{
			System.Data.DataSet ds1 = new System.Data.DataSet();
			
			
			this.sqlDataAdapter1.Fill(ds1);
			this.dataGrid1.DataSource = ds1;
			
			MessageBox.Show("It's can be realized!");
		}

		private void dataGrid1_DoubleClick(object sender, System.EventArgs e)
		{

	
			Int32 rN=dataGrid1.CurrentRowIndex;
			MessageBox.Show("当前行号为:"+rN.ToString());

		
		}
//		private void DataGrid1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
//		{ 
//			System.Drawing.Point pt = new Point(e.X, e.Y);  
//			DataGrid.HitTestInfo hit = this.dataGrid1.HitTest(pt); 
//			if(hit.Type == DataGrid.HitTestType.Cell)  
//			{ 
//				this.dataGrid1.CurrentCell = new DataGridCell(hit.Row, hit.Column); 
//				this.dataGrid1.Select(hit.Row); 
//				
//				
//				
//			}		
//		}

	}
}

⌨️ 快捷键说明

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