데이터 모델 엔터티를 publishingCompanyEntities
이라는 프로젝트에 추가하고 ComboBox를 내 winform에 추가했습니다. 하지만 난 내 콤보 상자에 저자의 내 목록을 바인딩 할 때 데이터 소스가 데이터로 채워 된 바와 같이,하지만 cmoAuthors.Items.Count
0을 반환하지만 cmoAuthors.DataSource.Count
수익률이 항목은ComboBox 데이터 소스 및 엔터티 FrameWork
publishContext = new publishingCompanyEntities();
cmoAuthors.DataSource = publishContext.Authors;
cmoAuthors.DisplayMember = "FirstName";
'cmoAuthors.Invalidate()'를 호출하고'Items.Count'가 업데이트되었는지 확인하십시오. –
아니요, 아직 0을 반환합니다. winform의 comboBox도 비어 있습니다! –
소스를 다음과 같이 변경하면 어떻게됩니까 :'publishContext.Authors.ToList()' –