private DataViewManager dsview; private DataTable dtgen; MySqlConnection myconn = new MySqlConnection("server=localhost;database=octupus_db;userid=root;password=sys"); MySqlDataAdapter sqlgender = new MySqlDataAdapter("Select * from gender", myconn); MySqlCommandBuilder comgen = new MySqlCommandBuilder(sqlgender); sqlgender.TableMappings.Add("gendermapping","gender"); DataTable dtgen = new DataTable("gender"); sqlgender.Fill(dtgen); cbxgender.Items.Add(dtgen.Rows()"sex".ToString);
My problem looks simple, but i cannot crack it. I have connected to my DB, extracted the data populated it to a Data table. But somehow i can't link this data table with my combo box but its failing.
my table is called gender, and the field that i am interested is called sex
Any ideas are welcome.