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

📄 form_kcxxyl.cs

📁 一个很简单的考试系统。实用性很强啊!数据库在里面
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace bizdb
{
	/// <summary>
	/// Form_kcxxyl 的摘要说明。
	/// </summary>
	public class Form_kcxxyl : System.Windows.Forms.Form
	{
		private System.Windows.Forms.DataGrid dataGrid1;
		private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
		private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
		private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
		private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
		private System.Data.SqlClient.SqlConnection sqlConnection1;
		private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Form_kcxxyl()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.dataGrid1 = new System.Windows.Forms.DataGrid();
			this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
			this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
			this.SuspendLayout();
			// 
			// dataGrid1
			// 
			this.dataGrid1.DataMember = "";
			this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid1.Location = new System.Drawing.Point(48, 88);
			this.dataGrid1.Name = "dataGrid1";
			this.dataGrid1.Size = new System.Drawing.Size(744, 176);
			this.dataGrid1.TabIndex = 0;
			this.dataGrid1.DoubleClick += new System.EventHandler(this.dataGrid1_DoubleClick);
			// 
			// sqlSelectCommand1
			// 
			this.sqlSelectCommand1.CommandText = "SELECT cou_no, stu_id, exaI_examTime, add_code, exaI_licenceNo, exaI_registerTime" +
				", exaI_score, exal_memo FROM examInfo";
			this.sqlSelectCommand1.Connection = this.sqlConnection1;
			// 
			// sqlConnection1
			// 
			this.sqlConnection1.ConnectionString = "workstation id=DANNYDOG;packet size=4096;user id=sa;data source=PDCSERVER;persist" +
				" security info=True;initial catalog=EXAMDB;password=\"jiuhao.com\"";
			// 
			// sqlInsertCommand1
			// 
			this.sqlInsertCommand1.CommandText = @"INSERT INTO examInfo(cou_no, stu_id, exaI_examTime, add_code, exaI_licenceNo, exaI_registerTime, exaI_score, exal_memo) VALUES (@cou_no, @stu_id, @exaI_examTime, @add_code, @exaI_licenceNo, @exaI_registerTime, @exaI_score, @exal_memo); SELECT cou_no, stu_id, exaI_examTime, add_code, exaI_licenceNo, exaI_registerTime, exaI_score, exal_memo FROM examInfo WHERE (cou_no = @cou_no) AND (exaI_examTime = @exaI_examTime) AND (stu_id = @stu_id)";
			this.sqlInsertCommand1.Connection = this.sqlConnection1;
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@cou_no", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "cou_no", System.Data.DataRowVersion.Current, null));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@stu_id", System.Data.SqlDbType.VarChar, 16, "stu_id"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@exaI_examTime", System.Data.SqlDbType.DateTime, 8, "exaI_examTime"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@add_code", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "add_code", System.Data.DataRowVersion.Current, null));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@exaI_licenceNo", System.Data.SqlDbType.VarChar, 10, "exaI_licenceNo"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@exaI_registerTime", System.Data.SqlDbType.DateTime, 8, "exaI_registerTime"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@exaI_score", System.Data.SqlDbType.Float, 8, "exaI_score"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@exal_memo", System.Data.SqlDbType.VarChar, 200, "exal_memo"));
			// 
			// sqlUpdateCommand1
			// 
			this.sqlUpdateCommand1.CommandText = @"UPDATE examInfo SET cou_no = @cou_no, stu_id = @stu_id, exaI_examTime = @exaI_examTime, add_code = @add_code, exaI_licenceNo = @exaI_licenceNo, exaI_registerTime = @exaI_registerTime, exaI_score = @exaI_score, exal_memo = @exal_memo 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); SELECT cou_no, stu_id, exaI_examTime, add_code, exaI_licenceNo, exaI_registerTime, exaI_score, exal_memo FROM examInfo WHERE (cou_no = @cou_no) AND (exaI_examTime = @exaI_examTime) AND (stu_id = @stu_id)";
			this.sqlUpdateCommand1.Connection = this.sqlConnection1;
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@cou_no", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "cou_no", System.Data.DataRowVersion.Current, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@stu_id", System.Data.SqlDbType.VarChar, 16, "stu_id"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@exaI_examTime", System.Data.SqlDbType.DateTime, 8, "exaI_examTime"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@add_code", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "add_code", System.Data.DataRowVersion.Current, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@exaI_licenceNo", System.Data.SqlDbType.VarChar, 10, "exaI_licenceNo"));

⌨️ 快捷键说明

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