winforms - LINQ Select mutiply columns as data source for combobox C# -
i have combobox must contain list of clients from(client table) own estate(estate table). both tables contains clientid fields. want clientid estate table valuemember , client name client table displaymember of combobox this:
clientcombobox.datasource = ownerquery; clientcombobox.displaymember = "clientname"; clientcombobox.valuemember = "clientid";
i have query gives me clientname:
var ownerquery = (from own in agencycontext.client join clname in agencycontext.estate on own.clientid equals clname.clientid select own.clientname);
how can clientid , clientname form 1 query source combobox.
change:
var ownerquery = (from own in agencycontext.client join clname in agencycontext.estate on own.clientid equals clname.clientid select own.clientname);
to:
var ownerquery = (from own in agencycontext.client join clname in agencycontext.estate on own.clientid equals clname.clientid select own);
Comments
Post a Comment