public DataTable ExibirDados1() { try { DataTable DataT = new DataTable(); dal = new PesquisarGenero1(); DataT = dal.ExibirDados1(); return(DataT); } catch (Exception erro) { throw erro; } }
private void BtnPesquisar_Click(object sender, EventArgs e) { PesquisarGenero1 gen = new PesquisarGenero1(); try { exibirGenero.DataSource = gen.ExibirDados1(); } catch (Exception erro) { MessageBox.Show("Erro ao exibir os dados" + erro); } btnSalvar.Enabled = true; idGenero.Enabled = true; nomeGenero.Enabled = true; }