《上机实习报告总结结尾.docx》由会员分享,可在线阅读,更多相关《上机实习报告总结结尾.docx(25页珍藏版)》请在优知文库上搜索。
1、上机实习报告总结结尾代码如下;usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsApplicationl(publicpartialclassForm5:Form(publicForm5()(InitializeConiponent();)privatevoidbuttonlClick(objectsender,l
2、ogofrom=newlogo();from.Show();EventArgse)EventArgs e)privatevoidbutton2Click(objectsender,Form2from=newForm2();from.Show();privatevoidbutton3Click(objectsender,EventArgse)s:/.xielw.shijuan试卷(Form3from=newForm3();from.Show();)EventArgs e) privatevoidbutton4Click(objectsender,Form4from二newForm4();from
3、.Show();)代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsApplicationlpublicpartialclasslogo:Formpubliclogo()InitializeComponentO;)privatevoidFormlLoa
4、d(objectsender,EventArgse)()privatevoidbuttonlClick(objectsender,EventArgse)stringconnstring=DataSource=Panlunzhao;InitialCatalog=BOOKSTORE.MDF;IntegratedSecurity=Truezz;SqlConnectionconn=newSqlConnection(Connstring);conn.Open();stringusername=this,username.Text.ToStringO;stringpassword=this,passwor
5、d.Text.ToStringO;SqlCommandm二conn.CreateCommand();m.CommandText=select*frommanagewhereUSername=+username+andPaSSWord=+password+;SqlDataReadersqlda=m.ExecuteReaderO;if(sqlda.Read()(ifs:/.xielw./gongzuobaogao/工作报告(SqIdapassword.ToString().Trim()=password)/MessageBox.Show(恭喜您登陆成功!,登陆成功!,MessageBoxButto
6、ns.OK,MessageBoxIcon.Information);/Form2f=newForm2();/f.Show();Form3from=newForm3();from.Show();)elseMessageBox.Show(密码错误,请重新输入!,错误,MessageBoxButtons.OK,MessageBoxIcon.Information);)elseMeSSageBox.Show(此用户不存在,请您!,MessageBoxButtons.OK,MessageBoxIcon.Information);)conn.CloseO;s:/.xielw.Zdangtuangongzu
7、ozongjie/党团工作总结sqlda.CloseO;)privatevoidbutton2Click(objectsender,EventArgse)username.Text二;password.Text=;)三.会员管理模块代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.CoinponentModel;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;
8、namespaceWindowsApp1ication1(publicpartialclassForm2:Form(protectedSqlConnectionconn;protectedSqlCommandcmd;stringconnstring=DataSous:/./article/述职报告rce=panlunzhao;InitialCatalOg=BOOKSTORE.MDF;IntegratedSecurity=Truezz;publicForm2()(InitializeComponent();)privatevoidForm2Load(objectsender,EventArgse
9、)(Ioadl();load();)protectedvoidIoadl()stringsql=select*fromcustomer”;conn=newSqlConnection(Connstring);conn.Open();SqlDataAdapterda=newSqlDataAdapter(sql,conn);DataSetds=newDataSet();da.Fi11(ds,book);dataGridViewl.DataSource=ds.Tableszzbookz;)protectedvoidload()(conn=newSqlConnection(Connstring);con
10、n.Open();stringsqlselect=,SELECTIDFROMcustomer;cmd=newSqlCommand(sqlselect,conn);SqlDataReaderdr=cmd.ExecuteReaderO;id.Items.Clear();while(dr.Read()id.Items.Add(dr0);dr.Close();)privateDataTableBindData(stringsql)(stringsqlselect=sql;conn=newSqlConnection(Connstring);SqlDataAdapterad=newSqlDataAdapt
11、er(sqlselect,conn);DataSetds二newDataSet();ad.Fill(ds,customer);returnds.TabIeScustomer;)privatevoidbuttonlClick(objectsender,EventArgse)stringsql=select*fromcustomerwhereID=+id.Text.ToStringO+;conn=newSqlConnection(Connstring);conn.Open();SqlCommandcmd=newSqlComniand(sql,conn);SqlDataReaderds=cmd.Ex
12、ecuteReaderO;ds.Read();textBoxl.Text=dsz,11amezz.ToStringO;textBox2.Texts:/.xielw.xuexiaogongzuozongjie学校工作,总结=ds,zLevelszz.ToStringO;textBox3.Text=dsEzzBirthdayzz.ToStringO;textBox4.Text=dsDegreeToStringO;textBox5.Text=dsAddress.ToStringO;textBox6.Text=dsTelephone.ToStringO;textBox7.Text=dszzEmai1z
13、,.ToString();textBox8.Text=dsScore.ToStringO;radioButtonl.Checked二(bool)dszzGender,z;)privatevoidUpdateClick(objectsender,EventArgse)stringsql二,zcustomersetname=ame,LeVelS=LeVels,Birthday=Birthday,Degree=Wegree,AddreSS=AddreSs,Telephone=Te1ephone,EmaiI=EnIai1,Score=ScorewhereID=ID;conn=newSqlConnect
14、ion(Connstring);conn.Open();cmd=newSqlCommand(sql,conn);cmd.Parameters.Add(ID,SqlDbType.Int).Value=id.Text.ToStringO;cmd.Parameters.Add(name,SqlDbType.NVarChar,20).Value=textBoxl.Text.Trim();cmd.Parameters.Add(LeVelS,SqlDbType.SmallInt).Value二textBox2.Text.Trim();cmd.Parameters.Adel(Birthday,SqlDbTy
15、pe.SmallDateTime).Value=textBox3.Text.Trim();cmd.Parameters.Add(Degree,SqlDbType.NVarChar,20).Value=textBox4.Text.Trim();cmd.Parameters.Add(AddreSs,SqlDbType.NVarChar,256).Value=textBox5.Text.Trim();cmd.Parameters.Add(TelePhone,SqlDbType.NVarChar,50).Value=textBox6.Text.Trim();cmd.Parameters.Add(EnIai1,SqlDbType.NVarChar,50).Value=textBox7.Text.Trim();cmd.Parameters.Add(,s