G
Guest
I've got the following code in my form's Load event handler:
OleDbConnection oleDbConnection = new OleDbConnection(String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}", databaseFilename));
string sqlstr = @"SELECT * FROM Companies";
companyOleDbDataAdapter = new OleDbDataAdapter(sqlstr, oleDbConnection);
companyOleDbDataAdapter.Fill(companyDataSet, "Companies");
DataView dataView = companyDataSet.Tables["Companies"].DefaultView;
companyComboBox.DisplayMember = "CompanyName";
companyComboBox.DataSource = dataView;
After Fill is executed, the dataset contains the 1 table with 1 row. Setting DisplayMember and DataSource both succeed without errors. This is the end of the method. When the control is displayed, nothing is in the combobox. Am I missing a databinding step?
T. Ford
OleDbConnection oleDbConnection = new OleDbConnection(String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}", databaseFilename));
string sqlstr = @"SELECT * FROM Companies";
companyOleDbDataAdapter = new OleDbDataAdapter(sqlstr, oleDbConnection);
companyOleDbDataAdapter.Fill(companyDataSet, "Companies");
DataView dataView = companyDataSet.Tables["Companies"].DefaultView;
companyComboBox.DisplayMember = "CompanyName";
companyComboBox.DataSource = dataView;
After Fill is executed, the dataset contains the 1 table with 1 row. Setting DisplayMember and DataSource both succeed without errors. This is the end of the method. When the control is displayed, nothing is in the combobox. Am I missing a databinding step?
T. Ford