I am using the following technique for populating a combobox in winforms:
var customer = (new Customer[] { new Customer { CustomerID = -1, CustomerRef = "[Please Select]" } }).Concat(
from c in ctx.Customers
orderby c.CustomerRef ascending
select c).ToList();
cboCustomerRef.DataSource = customer;
cboCustomerRef.ValueMember = "CustomerID";
cboCustomerRef.DisplayMember = "CustomerRef";
Would it be possible to achieve the same result, but with only selecting the two relevant columns (CustomerID and CustomerRef) from customer rather than all columns.
Is there a better way to do this?
Thank you...