教材管理系统 protected void Button2_Click(object sender, EventArgs e)
{
OleDbConnection con = DB.createDB(); //调用用户自定义的DB类的createDB()的方法
OleDbCommand cmd = new OleDbCommand();//声明一个OleDbCommand的 cmd对象,并将其实例化
cmd.Connection = con;
con.Open();
cmd.CommandText = "delete from tb_weihu where id='" + this.txtid.Text + "'";
cmd.ExecuteNonQuery();//用OleDbCommand的ExecuteScalar()方法来执行删除操作
Response.Write("alert('恭喜您,信息删除成功!')");
con.Close();
this.aa();
//this.txtbz.Text = "";
this.txtfy.Text = "";
this.txtjsr.Text = "";
this.Txtnr.Text = "";
this.txtperson.Text = "";
//this.txttime.Text = "";
//this.txtzzrq.Text = "";
this.txtid.Text = "";
}
1