How to read only one field of a table
I have a database called HARPIA. In this database i have a table called GENERO, and in this table i have three fields (N_GENERO, GENERO, N_TRIBO).
I would like to read only the values into the field N_GENERO and show its values in a Combobox called cboGenero.
To do this i used the code below but its not so good. I have some problems with this code.
There is anybody that can help me.
Whats the correct code to use?
thisAdapter = new OleDbDataAdapter(
"SELECT n_genero FROM genero WHERE genero = '+ nomegenero'", dbBanco.thisConnection);
thisBuilder = new OleDbCommandBuilder(thisAdapter);
thisDataSet = new DataSet();
thisAdapter.Fill(thisDataSet,"genero");
cboGenero.text = thisDataSet.Tables ["genero"].Columns ["n_genero"];
}

AdministratorRank #675 · 3.6K reputationPosted Feb 26, 2003, 3:17 AM EST
AdministratorRank #675 · 3.6K reputationPosted Feb 26, 2003, 5:59 AM EST
AdministratorRank #675 · 3.6K reputationPosted Feb 26, 2003, 6:50 AM EST
AdministratorRank #675 · 3.6K reputationPosted Feb 28, 2003, 3:47 AM EST