J
John
Hi,
I am having problems with binding a dataset to a combo box. I have created
an query in Access 2002 called procModels. I want to be able to call it and
retrieve the data from the query. I have included some code below. Any
help will be appreciated.
sql = "EXECUTE procModels";
OleDbConnection dbConn = new OleDbConnection(connString);
OleDbDataAdapter dbAdapter = new OleDbDataAdapter(sql, dbConn);
DataSet ds = new DataSet();
dbAdapter.Fill(ds, "tblModels");
return ds;
databinding code:
this.modelComboBox.DataSource = ds.Tables["tblModels"];
Thanks in adavance
this.modelComboBox.DisplayMember = "tblModels.strCode";
I am having problems with binding a dataset to a combo box. I have created
an query in Access 2002 called procModels. I want to be able to call it and
retrieve the data from the query. I have included some code below. Any
help will be appreciated.
sql = "EXECUTE procModels";
OleDbConnection dbConn = new OleDbConnection(connString);
OleDbDataAdapter dbAdapter = new OleDbDataAdapter(sql, dbConn);
DataSet ds = new DataSet();
dbAdapter.Fill(ds, "tblModels");
return ds;
databinding code:
this.modelComboBox.DataSource = ds.Tables["tblModels"];
Thanks in adavance
this.modelComboBox.DisplayMember = "tblModels.strCode";