沈阳航空航天大学设计用纸
catch (Exception e1) {
MessageBox.Show(e1.Message); } finally {
myConn.Close(); //关闭数据库连接 } }
private void button5_Click(object sender, EventArgs e) {
string ConnString1 = \ OdbcConnection OdbcConnection(ConnString1);
try {
myConn.Open(); //打开连接 MessageBox.Show(\修改 \ OdbcCommand
myCommand
=
myConn
=
new
myConn.CreateCommand(); //创建命令对象myCommand
string ld_1 = this.textBox1.Text; string ls_2 = this.textBox2.Text;
25
沈阳航空航天大学设计用纸
string ls_3 = this.textBox3.Text; string ls_4 = this.textBox4.Text; string ls_5 = this.textBox5.Text; string ls_6 = this.textBox6.Text;
myCommand.CommandText = \student SET 名称 ='\+ ls_2 + \编号 = \+ ld_1 + \ //UPDATE oki!!
myCommand.Connection = myConn;
int rtn = myCommand.ExecuteNonQuery(); //执行命令返回结果指派给DataReader对象myReader
//object rtn = myCommand.ExecuteScalar(); //ExecuteScalar 统计,查询,只读取首行首列
MessageBox.Show(rtn.ToString() + \商品信息被修改\
this.studentTableAdapter.Fill(this.dataSet1.student);
}
catch (Exception e1) {
MessageBox.Show(e1.Message); } finally {
myConn.Close(); //关闭数据库连接
26
沈阳航空航天大学设计用纸
} } using System;
using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;
using System.Windows.Forms;
namespace _143403030608 {
public partial class Form3 : Form {
public Form3() {
InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) {
if (textBox1.Text == \ {
27
沈阳航空航天大学设计用纸
button2.Enabled = true;
label3.Text = \密码正确,请点击下一步继续\
label3.ForeColor = Color.Blue; } else
{ label3.Text = \密码错误,请查正后输入!\ label3.ForeColor = Color.Red; } }
private void button2_Click(object sender, EventArgs e) {
Form4 frm1 = new Form4(); frm1.Show(); this.Hide(); }
private void button3_Click(object sender, EventArgs e) {
Form1 frm1 = new Form1(); frm1.Show(); this.Hide(); }
28
相关推荐: