0
我的WinForm應用程序中出現此錯誤:
不支持直接存儲查詢(DbSet,DbQuery,DbSqlQuery)的數據綁定。而是用數據填充DbSet,例如通過在DbSet上調用Load,然後綁定到本地數據。對於WPF綁定到DbSet.Local。對於WinForms綁定到DbSet.Local.ToBindingList()。
這是我的代碼:
ComboBox ValueMember Error
private DataBaseEntities entity = new DataBaseEntities();
categoryComboBox.DataSource = entity.TableName;
categoryComboBox.DisplayMember = "Description";
//ProductType is the Primary Key of the table and is Identity as well
//And when the compiler arrives here, the error is thrown
categoryComboBox.ValueMember = "ProductType";
有人可以幫我解決我的錯誤?
謝謝你。它正在工作。我讀過一篇關於這個錯誤的文章,但還有一個例子。再次感謝@ElectricRouge。 –