Hi,

I'm trying to keep my data access code separate from the code behind my form. What I am trying to do is populate my combo-box with a list of CompanyNames here's how I'm trying to bind this combo-box to my Companies entity to retrieve the CompanyName:
C Code:
  1. private void frmMain_Load(object sender, EventArgs e)
  2. {
  3.     dal = new DataAccessLayer();
  4.  
  5.     cmbCompanyNameSearch.DataSource = dal.GetcmbCompanyList();
  6. }

and here's the method in my DataAccessLayer:
C Code:
  1. public List<Companies> GetcmbCompanyList()
  2. {
  3.     // Check we have an ObjectContext
  4.     if (entities == null) entities = new CompanySecretaryEntities();
  5.  
  6.         // Create a query from the entityset
  7.     ObjectQuery<Companies> companies = entities.Companies;
  8.     companies.MergeOption = MergeOption.AppendOnly;
  9.  
  10.     // Define the query
  11.     var query = from c in entities.Companies
  12.             select c.CompanyName;
  13.  
  14.     // Execute the query
  15.     List<Companies> results = query.ToList();
  16.  
  17.     // Return the results in a List
  18.     return results;
  19. }
This is giving me the following error:
Error 1 Cannot implicitly convert type 'System.Collections.Generic.List<string>' to 'System.Collections.Generic.List<CompanySecretary.Companies>'