VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 300,444 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,521 people online right now. Registration is fast and FREE... Join Now!




How to set combobox displaymember to a returned value of a function?

 

How to set combobox displaymember to a returned value of a function?

pmkdatabase

2 Jul, 2009 - 07:17 AM
Post #1

New D.I.C Head
*

Joined: 14 Jun, 2009
Posts: 13

Combobox with bound rowsource, but I want to change the displaymember to a string returned by a procedure. In Access/VBA I would have a little function to build the string, then simply code the recordsource of the cbo as:
CODE

"SELECT ClientIDS, fnGetName([ClientIDS]) AS ClientName FROM tblPerson ORDER BY fnGetName([ClientIDS])".
Pretty straightforward, but I've messed around with this for hours in VS2005/VB to no avail.

User is offlineProfile CardPM
+Quote Post


pmkdatabase

RE: How To Set Combobox Displaymember To A Returned Value Of A Function?

29 Jul, 2009 - 08:51 PM
Post #2

New D.I.C Head
*

Joined: 14 Jun, 2009
Posts: 13

For the archives, I ended up doing it with an SQL function. Probably a stored procedure would work also.

QUOTE(pmkdatabase @ 2 Jul, 2009 - 07:17 AM) *

Combobox with bound rowsource, but I want to change the displaymember to a string returned by a procedure. In Access/VBA I would have a little function to build the string, then simply code the recordsource of the cbo as:
CODE

"SELECT ClientIDS, fnGetName([ClientIDS]) AS ClientName FROM tblPerson ORDER BY fnGetName([ClientIDS])".
Pretty straightforward, but I've messed around with this for hours in VS2005/VB to no avail.


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 01:36AM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month