protected void btnExcluir_Click(object sender, EventArgs e) { try { PessoaDAL pDAL = new PessoaDAL(); pDAL.ExcluirDados(Convert.ToInt32(txtCodigo.Text)); lblMensagem.Text = "Usuário excluido da base de dados com sucesso."; pnlDados.Visible = false; txtCodigo.Enabled = true; LimparTela(); } catch (Exception ex) { throw new Exception(ex.Message); } }