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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? form1.cs

?? 網(wǎng)絡(luò)應(yīng)用
?? CS
字號(hào):
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 的摘要說(shuō)明。
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private CrystalDecisions.Windows.Forms.CrystalReportViewer crystalReportViewer1;
		/// <summary>
		/// 必需的設(shè)計(jì)器變量。
		/// </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 窗體設(shè)計(jì)器支持所必需的
			//
			InitializeComponent();

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

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

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

		#region Windows 窗體設(shè)計(jì)器生成的代碼
		/// <summary>
		/// 設(shè)計(jì)器支持所需的方法 - 不要使用代碼編輯器修改
		/// 此方法的內(nèi)容。
		/// </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[] {
														   "學(xué)生信息表",
														   "學(xué)生人數(shù)對(duì)比情況"});
			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 = "請(qǐng)選擇";
			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 = "院系編號(hào)";
			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 = "學(xué)號(hào)";
			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 = "教務(wù)管理系統(tǒng)";
			this.groupBox2.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

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

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

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

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

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

			//根據(jù)選擇到的不同字符串對(duì)報(bào)表的數(shù)據(jù)進(jìn)行綁定
			switch ( Int32.Parse(comboBox1.SelectedIndex.ToString()))
			{
					//選擇了基本信息表	
				case 0 :
				{
					bao1 myrpt = new bao1();
					myrpt.SetDataSource(myset);
					crystalReportViewer1.ReportSource = myrpt;	
					break;
				}
					//選擇了年齡人數(shù)對(duì)照表	
				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("請(qǐng)輸入完整的信息!");
				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表中是否存在當(dāng)前要錄入的學(xué)生所在的院系
				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ù)小于一則說(shuō)明操作失敗了
				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)
		{
		
		}

		
	}
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久er精品视频| 国产女人18水真多18精品一级做| 国产乱码精品一区二区三| 久久久国产一区二区三区四区小说| 99re8在线精品视频免费播放| 日韩国产一二三区| 麻豆91精品视频| 亚洲欧美综合另类在线卡通| www.欧美日韩国产在线| 开心九九激情九九欧美日韩精美视频电影| 亚洲精品国久久99热| 欧美一区二区三区日韩| 欧美亚洲日本一区| 日本不卡一二三| 麻豆精品一二三| 成人免费毛片高清视频| 欧美一级艳片视频免费观看| 成人激情视频网站| 99久精品国产| 日韩专区中文字幕一区二区| 久久精品人人做人人爽97| 国产午夜久久久久| 亚洲日本电影在线| 免费成人在线影院| 99视频一区二区| 日韩免费视频线观看| 伊人婷婷欧美激情| 国产一区二区三区在线观看精品| 色成人在线视频| 久久婷婷综合激情| 亚洲成人免费视频| 成人av高清在线| 精品国产乱码久久久久久蜜臀| 亚洲美女区一区| 欧美不卡视频一区| 午夜天堂影视香蕉久久| 欧美在线三级电影| 久久久天堂av| 国产一区二区三区四| 精品少妇一区二区三区免费观看| 亚洲激情第一区| 成人免费电影视频| 精品电影一区二区| 日韩专区欧美专区| 717成人午夜免费福利电影| 亚洲欧美在线观看| 成人激情av网| 一区二区中文视频| 91视频免费观看| 国产欧美视频一区二区| 亚洲成人tv网| 日韩av电影天堂| 欧美精品一区二区精品网| 中文字幕一区在线| 成人欧美一区二区三区| 欧美日韩免费电影| 五月婷婷久久丁香| 日韩欧美国产电影| 成人免费视频caoporn| 亚洲一区二区三区在线播放| 91精品在线一区二区| 激情文学综合丁香| 亚洲欧美日韩国产综合在线| 欧美日韩国产不卡| 成人av小说网| 午夜精品久久久久| 国产精品伦一区二区三级视频| av电影在线观看完整版一区二区| 五月婷婷激情综合| 亚洲精品视频免费看| 欧美电视剧免费观看| 色综合久久久久网| 国产精品一区不卡| 麻豆视频观看网址久久| 夜夜嗨av一区二区三区中文字幕| 久久精品亚洲精品国产欧美kt∨ | 99麻豆久久久国产精品免费 | 成人免费视频视频| 91麻豆精品国产91久久久使用方法 | 国产精品成人网| 国产精华液一区二区三区| 午夜精品在线视频一区| 日韩欧美高清dvd碟片| 亚洲欧美一区二区视频| 97精品电影院| 日韩va亚洲va欧美va久久| 中文字幕av一区二区三区免费看| 国产一区二区三区免费| 国产精品午夜久久| 91浏览器入口在线观看| 日韩黄色小视频| 日韩理论片一区二区| 日韩精品一区二区三区中文精品| 国产清纯美女被跳蛋高潮一区二区久久w| 精品久久人人做人人爰| 久久精品免费观看| 国产精品一区久久久久| 久久精品国产精品亚洲红杏 | 久久综合九色综合久久久精品综合| 99精品国产99久久久久久白柏| 亚洲久本草在线中文字幕| 欧美日韩久久久久久| av在线播放不卡| 成人在线视频首页| 国产高清精品在线| 亚洲一区二区三区三| 色天天综合久久久久综合片| 午夜电影网亚洲视频| 欧美日韩一区高清| 亚洲视频在线一区二区| 福利一区在线观看| 国产精品拍天天在线| 久久99精品久久久久婷婷| 欧美精品18+| 91在线码无精品| 欧美夫妻性生活| 国产精品国产自产拍高清av王其| 成人激情视频网站| 波多野结衣精品在线| 99re热这里只有精品免费视频 | 欧美成人三级在线| 91热门视频在线观看| 不卡一区在线观看| 欧美日本一区二区三区四区| 欧美日韩三级一区二区| 国产人成亚洲第一网站在线播放| 亚洲综合色噜噜狠狠| 欧美一区二区三区啪啪| 午夜视频久久久久久| 日韩激情视频在线观看| 国产一区二区在线免费观看| 五月天激情小说综合| 亚洲欧美另类在线| 久久精品亚洲一区二区三区浴池| 欧美一区二区三区人| 欧美亚洲一区二区在线| 一本大道久久a久久综合婷婷| 粉嫩高潮美女一区二区三区| 激情欧美一区二区| 国产精品蜜臀av| 91国在线观看| 国产福利电影一区二区三区| 一区二区三区国产精华| 国产精品国产a级| 伊人色综合久久天天人手人婷| 91久久一区二区| 美女视频黄免费的久久| 国产东北露脸精品视频| 国产偷国产偷亚洲高清人白洁| 国产精品综合久久| 中文字幕av一区二区三区| 91在线小视频| 日韩中文欧美在线| 精品国产欧美一区二区| 欧美一区二区免费观在线| 成人精品在线视频观看| 激情综合色播激情啊| 亚洲欧洲精品天堂一级| 在线一区二区三区| 春色校园综合激情亚洲| 亚洲色图欧美激情| 国产91对白在线观看九色| 亚洲欧洲一区二区在线播放| 日本道免费精品一区二区三区| 一区二区三区蜜桃网| 538prom精品视频线放| 91在线精品一区二区三区| 欧美激情一区二区三区全黄| 精品亚洲aⅴ乱码一区二区三区| 亚洲一区在线观看网站| 亚洲妇女屁股眼交7| 亚洲一区免费视频| 亚洲国产毛片aaaaa无费看| 亚洲国产成人av好男人在线观看| 欧美精品一区二区三区很污很色的| 国产精品456露脸| 伊人色综合久久天天| 国产亚洲欧洲997久久综合| 91麻豆精品国产91久久久久久| 99久久婷婷国产综合精品电影| 精品综合久久久久久8888| 91丨九色丨蝌蚪富婆spa| 99精品1区2区| 亚洲成人激情av| 亚洲女人****多毛耸耸8| 水野朝阳av一区二区三区| 亚洲aaa精品| 美女任你摸久久| 懂色av噜噜一区二区三区av| 狠狠狠色丁香婷婷综合激情 | 亚洲精品在线观看网站| 欧美久久久久久蜜桃| 欧美日韩亚洲高清一区二区| 成人黄色大片在线观看| av亚洲产国偷v产偷v自拍| 在线观看亚洲专区| 欧美精品一区二区三区视频| 亚洲男同1069视频| 九九国产精品视频| 在线一区二区观看|