AccountSystem.DeleteRecord.btnDelete_Click C# (CSharp) Method

btnDelete_Click() private method

private btnDelete_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (cmbID.Text == "")
            {
                MessageBox.Show("请选择数据号", "系统错误");
                return;
            }
            try
            {
                
                string connectstring = "provider=Microsoft.jet.OLEDB.4.0;Data Source=accountsystem.mdb;Jet OleDb:Database Password=lxw618";
                string sqlcommand = "delete from [Money] where ID=" + cmbID.Text;
                OleDbConnection aConnection = new OleDbConnection(connectstring);
                aConnection.Open();
                OleDbCommand aCommand = new OleDbCommand(sqlcommand, aConnection);
                aCommand.ExecuteNonQuery();
                aConnection.Close();
                this.btnFresh_Click(sender, e);
                MessageBox.Show("删除成功", "恭喜");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "系统错误");
                this.DeleteRecord_Load(sender, e);
                return;
            }
        }
    }