简体   繁体   中英

VB.net Dataset display different column

I am sure this has to a comon thing I just can't find it. I am making a combobox from my data source.

Basically, This is a projects form and the user needs to select the the primary contact which is contrained by the customer id (GETbyCustomerID) set in another field. I have it working... mostly except the combobox only displays the contact ID which is completely useless to the user. I need to know how to display the First and Last name (both are seperate columns in the table). Any help? I am just using the designer.

The ComboBox will have properties for DisplayMember and ValueMember you can set appropriately.

The easiest way to use two columns as the DisplayMember is to return them as one in your query and use that value (in your case - FirstName + LastName as FullName ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM