我试图用查询的输出填充组合框。我在组合框中显示的是 System.Data.DataRowView 这是我使用的代码:
string subConStr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Master.accdb;Jet OLEDB:Database Password=password";
string query = "SELECT DISTINCT Code FROM MasterTable";
OleDbDataAdapter dAdapterComB = new OleDbDataAdapter(query, subConStr);
System.Data.DataTable source = new System.Data.DataTable() ;
dAdapterComB.Fill(source);
comboBoxSubject.DataSource = source;
comboBoxSubject.DisplayMember = "Subjects";