亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? form1.cs

?? 網(wǎng)絡應用
?? CS
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;

namespace jiaowu
{
	/// <summary>
	/// Form1 的摘要說明。
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private CrystalDecisions.Windows.Forms.CrystalReportViewer crystalReportViewer1;
		/// <summary>
		/// 必需的設計器變量。
		/// </summary>
		private System.ComponentModel.Container components = null;
		private System.Windows.Forms.ComboBox comboBox1;
		private string  connectstr = "data source=localhost;Initial Catalog=jiaowu;User ID=sa;Password=sa;";
		private System.Windows.Forms.GroupBox groupBox2;
		private System.Windows.Forms.TextBox textBox9;
		private System.Windows.Forms.TextBox textBox8;
		private System.Windows.Forms.TextBox textBox6;
		private System.Windows.Forms.TextBox textBox5;
		private System.Windows.Forms.Label label10;
		private System.Windows.Forms.Label label9;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Button StuInfo;
        private string select;
		public Form1()
		{
			//
			// Windows 窗體設計器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 調用后添加任何構造函數(shù)代碼
			//
			//定義Dataset1類的對象實例myset
			Dataset1 myset = new Dataset1();		
			SqlConnection sqlcnn = new SqlConnection( connectstr );
            
			string sqlstr = "select * from Stud";
			SqlDataAdapter myadapter = new SqlDataAdapter(sqlstr,sqlcnn);
			//將從數(shù)據(jù)庫的Stud表中選出的所有數(shù)據(jù)放置在myset的名為Stud表中
			myadapter.Fill(myset,"Stud");

			sqlstr = "select * from Yuanxi";
			SqlDataAdapter myadapter1 = new SqlDataAdapter(sqlstr,sqlcnn);
			//將從數(shù)據(jù)庫的Yuanxi表中選出的所有數(shù)據(jù)放置在myset的名為Yuanxi表中
			myadapter1.Fill(myset,"Yuanxi");
		
			//設置程序運行時默認顯示的報表
			bao1 bb = new bao1();
			//設置將水晶報表的數(shù)據(jù)源
			bb.SetDataSource(myset);
			//設置報表查看器中顯示的報表
			crystalReportViewer1.ReportSource = bb;
		}

		/// <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.crystalReportViewer1 = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
			this.comboBox1 = new System.Windows.Forms.ComboBox();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			this.textBox9 = new System.Windows.Forms.TextBox();
			this.textBox8 = new System.Windows.Forms.TextBox();
			this.textBox6 = new System.Windows.Forms.TextBox();
			this.textBox5 = new System.Windows.Forms.TextBox();
			this.label10 = new System.Windows.Forms.Label();
			this.label9 = new System.Windows.Forms.Label();
			this.label7 = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.StuInfo = new System.Windows.Forms.Button();
			this.groupBox2.SuspendLayout();
			this.SuspendLayout();
			// 
			// crystalReportViewer1
			// 
			this.crystalReportViewer1.ActiveViewIndex = -1;
			this.crystalReportViewer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.crystalReportViewer1.Location = new System.Drawing.Point(8, 16);
			this.crystalReportViewer1.Name = "crystalReportViewer1";
			this.crystalReportViewer1.ReportSource = null;
			this.crystalReportViewer1.Size = new System.Drawing.Size(384, 360);
			this.crystalReportViewer1.TabIndex = 0;
			this.crystalReportViewer1.Load += new System.EventHandler(this.crystalReportViewer1_Load);
			// 
			// comboBox1
			// 
			this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.comboBox1.Items.AddRange(new object[] {
														   "學生信息表",
														   "學生人數(shù)對比情況"});
			this.comboBox1.Location = new System.Drawing.Point(416, 56);
			this.comboBox1.Name = "comboBox1";
			this.comboBox1.Size = new System.Drawing.Size(176, 20);
			this.comboBox1.TabIndex = 5;
			this.comboBox1.Text = "請選擇";
			this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
			// 
			// groupBox2
			// 
			this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.groupBox2.BackColor = System.Drawing.Color.Transparent;
			this.groupBox2.Controls.Add(this.textBox9);
			this.groupBox2.Controls.Add(this.textBox8);
			this.groupBox2.Controls.Add(this.textBox6);
			this.groupBox2.Controls.Add(this.textBox5);
			this.groupBox2.Controls.Add(this.label10);
			this.groupBox2.Controls.Add(this.label9);
			this.groupBox2.Controls.Add(this.label7);
			this.groupBox2.Controls.Add(this.label6);
			this.groupBox2.Controls.Add(this.StuInfo);
			this.groupBox2.ForeColor = System.Drawing.Color.Black;
			this.groupBox2.Location = new System.Drawing.Point(408, 96);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new System.Drawing.Size(192, 248);
			this.groupBox2.TabIndex = 6;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "錄入信息";
			// 
			// textBox9
			// 
			this.textBox9.Location = new System.Drawing.Point(72, 160);
			this.textBox9.Name = "textBox9";
			this.textBox9.TabIndex = 15;
			this.textBox9.Text = "";
			// 
			// textBox8
			// 
			this.textBox8.Location = new System.Drawing.Point(72, 120);
			this.textBox8.Name = "textBox8";
			this.textBox8.TabIndex = 14;
			this.textBox8.Text = "";
			// 
			// textBox6
			// 
			this.textBox6.Location = new System.Drawing.Point(72, 80);
			this.textBox6.Name = "textBox6";
			this.textBox6.TabIndex = 12;
			this.textBox6.Text = "";
			// 
			// textBox5
			// 
			this.textBox5.Location = new System.Drawing.Point(72, 40);
			this.textBox5.Name = "textBox5";
			this.textBox5.TabIndex = 11;
			this.textBox5.Text = "";
			// 
			// label10
			// 
			this.label10.ForeColor = System.Drawing.Color.Black;
			this.label10.Location = new System.Drawing.Point(8, 160);
			this.label10.Name = "label10";
			this.label10.Size = new System.Drawing.Size(56, 23);
			this.label10.TabIndex = 10;
			this.label10.Text = "院系編號";
			this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// label9
			// 
			this.label9.ForeColor = System.Drawing.Color.Black;
			this.label9.Location = new System.Drawing.Point(32, 120);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(32, 23);
			this.label9.TabIndex = 9;
			this.label9.Text = "年齡";
			this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// label7
			// 
			this.label7.ForeColor = System.Drawing.Color.Black;
			this.label7.Location = new System.Drawing.Point(8, 80);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(56, 23);
			this.label7.TabIndex = 7;
			this.label7.Text = "姓名";
			this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// label6
			// 
			this.label6.ForeColor = System.Drawing.Color.Black;
			this.label6.Location = new System.Drawing.Point(24, 40);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(40, 23);
			this.label6.TabIndex = 6;
			this.label6.Text = "學號";
			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// StuInfo
			// 
			this.StuInfo.Location = new System.Drawing.Point(72, 208);
			this.StuInfo.Name = "StuInfo";
			this.StuInfo.Size = new System.Drawing.Size(88, 23);
			this.StuInfo.TabIndex = 5;
			this.StuInfo.Text = "提交";
			this.StuInfo.Click += new System.EventHandler(this.StuInfo_Click);
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(608, 389);
			this.Controls.Add(this.groupBox2);
			this.Controls.Add(this.comboBox1);
			this.Controls.Add(this.crystalReportViewer1);
			this.Name = "Form1";
			this.Text = "教務管理系統(tǒng)";
			this.groupBox2.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 應用程序的主入口點。
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}

		private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			//獲取從comboBox1中選取的字符串
			select = comboBox1.SelectedText.ToString();

			//定義Dataset1類的對象實例myset
			Dataset1 myset = new Dataset1();		
			SqlConnection sqlcnn = new SqlConnection( connectstr );

			string sqlstr = "select * from Stud";
			SqlDataAdapter myadapter = new SqlDataAdapter(sqlstr,sqlcnn);
			//將從數(shù)據(jù)庫的students表中選出的所有數(shù)據(jù)放置在myset的名為students表中
			myadapter.Fill(myset,"Stud");

			sqlstr = "select * from Yuanxi";
			SqlDataAdapter myadapter1 = new SqlDataAdapter(sqlstr,sqlcnn);
			//將從數(shù)據(jù)庫的Department表中選出的所有數(shù)據(jù)放置在myset的名為Department表中
			myadapter1.Fill(myset,"Yuanxi");

			//根據(jù)選擇到的不同字符串對報表的數(shù)據(jù)進行綁定
			switch ( Int32.Parse(comboBox1.SelectedIndex.ToString()))
			{
					//選擇了基本信息表	
				case 0 :
				{
					bao1 myrpt = new bao1();
					myrpt.SetDataSource(myset);
					crystalReportViewer1.ReportSource = myrpt;	
					break;
				}
					//選擇了年齡人數(shù)對照表	
				case 1 :
				{
					bao3 myrpt = new bao3();
					myrpt.SetDataSource(myset);
					crystalReportViewer1.ReportSource = myrpt;			
					break;
				}
					
				
			}
		}

		private void StuInfo_Click(object sender, System.EventArgs e)
		{
			string s_Number;
			string s_Name;
			int s_Age;
			int Y_Number;

			//判斷必須輸入的信息已輸入之后在給變量賦值
			if( (textBox5.Text!="") && (textBox6.Text!="") && (textBox8.Text!="") &&(textBox9.Text!=""))
			{
				s_Number = textBox5.Text;
				s_Name = textBox6.Text;
				s_Age = Int32.Parse(textBox8.Text);
				Y_Number = Int32.Parse(textBox9.Text);
			}
			else
			{
				MessageBox.Show("請輸入完整的信息!");
				return;
			}
			
			string check = String.Format("select Y_Number from Yuanxi where Y_Number={0}", Y_Number);
			string sql = String.Format("insert into Stud (s_Number,s_Name,s_Age,Y_Number) values ('{0}','{1}',{2},{3})",s_Number,s_Name,s_Age,Y_Number);

			SqlConnection sqlcnn = new SqlConnection( connectstr );
			try
			{
				sqlcnn.Open();
				SqlCommand cmd = new SqlCommand(check, sqlcnn);
				//查詢Dep_Number表中是否存在當前要錄入的學生所在的院系
				SqlDataReader MyDataReader = cmd.ExecuteReader();				
				if ( !MyDataReader.Read() )
				{
					MessageBox.Show("目前還沒有此院系!");
					MyDataReader.Close();
					sqlcnn.Close();
					return;
				}
				MyDataReader.Close();

				SqlCommand cmd1 = new SqlCommand(sql, sqlcnn);
				//執(zhí)行插入操作,并返回受影響的行數(shù)
				int j = cmd1.ExecuteNonQuery();
				//如果受影響的行數(shù)小于一則說明操作失敗了
				if ( j<1 )
				{
					MessageBox.Show("操作失敗!");
					sqlcnn.Close();
				}
				sqlcnn.Close();
			}
			catch(Exception er)
			{
				string temp = er.Message.ToString();
				sqlcnn.Close();
				return;
			}
			MessageBox.Show("已經(jīng)成功錄入!");
		}

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

		
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av在线观| 日本va欧美va精品发布| 欧美电影免费观看高清完整版在 | 国产成人日日夜夜| 婷婷开心久久网| 亚洲一区二区综合| 亚洲人成影院在线观看| 中文字幕第一区二区| 欧美成人video| 制服丝袜国产精品| 欧美一卡二卡在线| 91精品国产一区二区三区香蕉| 欧美亚洲免费在线一区| 91丨porny丨国产入口| 高清不卡在线观看| 国产91精品在线观看| 紧缚捆绑精品一区二区| 国内精品久久久久影院一蜜桃| 亚洲成av人在线观看| 亚洲成人av福利| 青娱乐精品在线视频| 蜜桃视频在线一区| 成人av网站在线观看| 一区二区三区欧美日| 国产片一区二区| 亚洲精品美国一| 午夜精品久久久久久久久| 亚洲成人免费影院| 国产乱码精品一品二品| 成人h精品动漫一区二区三区| 成人免费视频视频在线观看免费| 成人免费看片app下载| 欧美亚洲一区二区在线| 日韩色视频在线观看| 国产人久久人人人人爽| 亚洲视频你懂的| 久久成人免费日本黄色| 成人精品鲁一区一区二区| 一本到三区不卡视频| 精品国产精品网麻豆系列| 综合久久一区二区三区| 麻豆91在线播放免费| 不卡的av网站| 国产三级久久久| 亚洲精品网站在线观看| 久久疯狂做爰流白浆xx| 在线亚洲+欧美+日本专区| 国产午夜一区二区三区| 午夜精品久久久久久久99樱桃| 成人免费av在线| 久久午夜羞羞影院免费观看| 亚洲高清中文字幕| 一本到一区二区三区| 国产精品久久久久久久久久久免费看 | 久久久综合视频| 琪琪久久久久日韩精品| 欧美日韩亚洲国产综合| 亚洲日本乱码在线观看| 久久精品免费看| 日韩小视频在线观看专区| 一级特黄大欧美久久久| 成人18视频在线播放| 欧美久久久久久蜜桃| 亚洲成人综合网站| 欧美最新大片在线看| 亚洲免费三区一区二区| 色菇凉天天综合网| 亚洲精品久久7777| 欧美性色黄大片| 亚洲国产中文字幕| 91精品国产福利| 久久99久久99小草精品免视看| 777久久久精品| 成人av先锋影音| 国产欧美一区二区精品忘忧草| 国产91精品久久久久久久网曝门| 欧美激情一区三区| 欧洲人成人精品| 久久66热re国产| 国产亚洲欧美日韩日本| 91丨porny丨户外露出| 日本欧美大码aⅴ在线播放| 日韩三级免费观看| 99久久精品免费看国产免费软件| 国产精品久久久久久久久免费丝袜| 91日韩精品一区| 蜜桃视频免费观看一区| 中文字幕亚洲精品在线观看| 欧美日韩免费一区二区三区视频| 美腿丝袜一区二区三区| 国产精品久久久久久亚洲伦| 欧美理论在线播放| 不卡免费追剧大全电视剧网站| 午夜视频在线观看一区二区 | 大美女一区二区三区| 一区二区三区在线观看国产 | 亚洲成人av在线电影| 国产亚洲一区二区三区四区| 欧美午夜电影在线播放| 国产精品一二二区| 天堂影院一区二区| 亚洲免费成人av| 国产农村妇女毛片精品久久麻豆 | 91蝌蚪porny| 国产69精品久久99不卡| 另类欧美日韩国产在线| 日韩毛片在线免费观看| 国产日韩欧美不卡在线| 日韩视频免费观看高清完整版 | 波多野结衣中文字幕一区二区三区| 男女性色大片免费观看一区二区| 欧美成人精品高清在线播放| 久久精品二区亚洲w码| 亚洲一区二区偷拍精品| 国产精品久久久久四虎| 亚洲精品一区二区三区蜜桃下载| 91精品啪在线观看国产60岁| 欧美精品久久99| 在线亚洲免费视频| 欧美麻豆精品久久久久久| 91精品久久久久久久99蜜桃| 欧美人狂配大交3d怪物一区| 337p亚洲精品色噜噜| 日韩免费一区二区| 精品入口麻豆88视频| 久久亚洲免费视频| 国产亚洲综合在线| 中文字幕av在线一区二区三区| 欧美激情中文字幕| 国产欧美精品一区二区色综合 | 亚洲欧美日韩在线不卡| 一级做a爱片久久| 日韩高清一区在线| 国产精品一区在线| 97精品电影院| 日韩美女视频一区二区在线观看| 久久九九全国免费| 亚洲精品国久久99热| 亚洲123区在线观看| 蜜臀va亚洲va欧美va天堂| 国产精品77777| 99精品偷自拍| 精品国产一区二区精华| 国产色产综合色产在线视频| 亚洲区小说区图片区qvod| 天堂av在线一区| 激情欧美日韩一区二区| 欧美日韩精品二区第二页| 欧美国产视频在线| 日韩电影免费一区| heyzo一本久久综合| 日韩免费一区二区| 亚洲国产精品影院| 91网站视频在线观看| 日韩欧美你懂的| 亚洲少妇30p| 六月婷婷色综合| 欧美日韩亚洲综合一区二区三区| 久久久久久久综合狠狠综合| 午夜激情久久久| 在线免费观看日本一区| 亚洲欧美日本韩国| 成人综合在线观看| 日韩欧美在线不卡| 亚洲永久精品国产| 91丨porny丨最新| 一区二区久久久久久| 99久久99久久综合| 亚洲丝袜美腿综合| 99久久精品国产毛片| 久久在线观看免费| 九九在线精品视频| 久久精品欧美一区二区三区不卡| 丝袜脚交一区二区| 欧美电影免费观看高清完整版在 | 亚洲激情成人在线| 在线一区二区三区四区| 国产精品美女视频| 欧美一a一片一级一片| 一区二区三区美女视频| 在线免费视频一区二区| 亚洲精品久久嫩草网站秘色| 欧美日本一区二区三区| 国产综合色产在线精品| 日韩视频免费观看高清完整版 | 欧美唯美清纯偷拍| 天天综合天天做天天综合| 精品捆绑美女sm三区| 国产美女主播视频一区| 中文字幕一区二区三区色视频 | 精品福利视频一区二区三区| 99在线精品视频| 亚洲成av人片一区二区| 国产亚洲欧美在线| 成人精品免费看| 美女视频黄 久久| 亚洲男人天堂av| 91精品久久久久久久91蜜桃| 99亚偷拍自图区亚洲| 免费成人在线观看视频|