protected void btnPesquisarAluno(object sender, EventArgs e) { try { int Codigo = Convert.ToInt32(txtCodigo.Text); AlunoDAL d = new AlunoDAL(); Aluno p = d.PesquisarporCodigo(Codigo); if (p != null) { pnlDados.Visible = true; txtNome.Text = p.Nome; txtData_Nasc.Text = p.Data_Nasc; txtIdade.Text = p.Idade; txtObjetivo_Graduacao.Text = p.Objetivo_Graduacao; txtGenero.Text = p.Genero; } else { lblMensagem.Text = "Aluno Não Encontrado"; txtCodigo.Text = string.Empty; } } catch (Exception ex) { lblMensagem.Text = ex.Message; } }