班级学生信息管理系统_学士学位论文内容摘要:

connection = new OleDbConnection(strCon)。 if ( != amp。 amp。 != ) { try { ()。 string strRead = select xh from jibenxinxi where xh=39。 + + 39。 OleDbCommand cmdRead = new OleDbCommand(strRead, connection)。 OleDbDataReader DR = ()。 if (() != true) { string strInsert = insert into jibenxinxi (xh,xm,xb,chshrq,zhzhmm,mz,lxdh,bj,jtdzh,jzhxm,jzhlxdh,jzhgzdw,bzh) values(39。 + xuehao + 39。 ,39。 + xingming + 39。 ,39。 + xingbie + 39。 ,39。 + + 39。 ,39。 + zhengzhimm + 39。 ,39。 + minzu + 39。 ,39。 + lianxidh + 39。 ,39。 + banji + 39。 ,39。 + jiatingdzh + 39。 ,39。 + jiazhangxm + 39。 ,39。 + jiazhanggzdw + 39。 ,39。 + jiazhangdh + 39。 ,39。 + beizhu + 39。 )。 OleDbCommand cmdInsert = new OleDbCommand(strInsert, connection)。 ()。 if ( != null) { SaveImage(strOFImg, xuehao, connection)。 } msgBox(添加成功。 )。 DgvFreshup()。 txtClear()。 ()。 } else { msgBox(该学号已存在。 )。 ()。 } 学 士 学 位 论 文 BACHELOR ’S THESIS 16 } catch (OleDbException CW) { msgBox(())。 } ()。 ()。 } else { msgBox(请输入学号和姓名。 )。 } } private void quxiaobtn_Click(object sender, EventArgs e) { txtClear()。 } private void lltxbtn_Click(object sender, EventArgs e) { try { Read_Image(openFileDialog1, pictureBox1)。 } catch { (加载图片出错 )。 } } private void tjgrxx_Load(object sender, EventArgs e) { DgvFreshup()。 } private void xhtxt_KeyPress(object sender, KeyPressEventArgs e) { if ( != 8 amp。 amp。 !()) { (只能输入数字 , 提示 , , )。 = true。 } } 学 士 学 位 论 文 BACHELOR ’S THESIS 17 public void msgBox(string msg) { (msg, 提示 , , )。 } private void txtClear() { ()。 ()。 ()。 ()。 ()。 ()。 ()。 ()。 ()。 = 0。 = 0。 = 0。 =。 = null。 } public void Read_Image(OpenFileDialog openF, PictureBox MyImage) { = *.jpg|*.jpg|*.bmp|*.bmp。 if (() == ) { try { = ()。 } catch { (您选择的图片不 能被读取或文件类型不对。 , 错误 , , )。 } } } public void SaveImage(string strImg, string xh, OleDbConnection con) { FileStream fs = new FileStream(strImg, , )。 学 士 学 位 论 文 BACHELOR ’S THESIS 18 BinaryReader br = new BinaryReader(fs)。 byte[] imgBytesIn = ((int))。 StringBuilder strB = new StringBuilder()。 (insert into tuxiang (xh,tx) values(39。 + xh + 39。 ,@Photo ))。 OleDbCommand cmd = new OleDbCommand((), con)。 (@Photo, ).Value = imgBytesIn。 ()。 } private string GetText(TextBox TB) { string strText = null。 if ( != ) { strText =。 } return strText。 } private string GetCmbText(ComboBox CmbBox) { string strCom = null。 if ( != 0 amp。 amp。 = ) { strCom = ()。 } return strCom。 } private string GetTxtOF(OpenFileDialog OF) { string strOF = null。 if ( != ) { strOF =。 } return strOF。 } public void dgvwidth(DataGridView dg) { [0].Width = 80。 学 士 学 位 论 文 BACHELOR ’S THESIS 19 [1].Width = 170。 [2].Width = 40。 [3].Width = 80。 [4].Width = 80。 [5].Width = 60。 [6].Width = 80。 [7].Width = 220。 [8].Width = 80。 [9].Width = 130。 [10].Width = 80。 [11].Width = 200。 [12].Width = 200。 } private void DgvFreshup() { OleDbConnection connection = new OleDbConnection(strCon)。 try { string strRead = select xh as 学号 , xm as 姓名 , xb as 性别 , chshrq as 出生日期 , bj as 班级 , zhzhmm as 政治面貌 , mz as 民族 , lxdh as 联系电话 , jtdzh as 家庭地址 , jzhxm as 家长姓名 , jzhlxdh as 家长电话 , jzhgzdw as 家长工作单位 , bzh as 备注 from jibenxinxi。 OleDbDataAdapter DA = new OleDbDataAdapter(strRead, connection)。 DataSet DS = new DataSet()。 (DS)。 = [0]。 dgvwidth(dataGridView1)。 } catch (OleDbException CW) { msgBox(())。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。