Solved

display member for data-bound combo box

Posted on 2008-10-20
8
321 Views
Last Modified: 2012-05-05
I'm trying to set the display member for a combox to the name of an alias column.  However, whenever I tab out of the "display menber" box the name reverts to none.  It will not allow me to enter in the name of the alias column created in the SQL query.  I'm using VS 2008 is there any work around for this, or am I missing something.
0
Comment
Question by:slightstk
  • 4
  • 4
8 Comments
 
LVL 18

Expert Comment

by:mdougan
ID: 22763042
What do you have set for the DataSource name?  What is the name of the Display Member Column?
0
 

Author Comment

by:slightstk
ID: 22763237
dataSource name = xyzDataSourceName
display member column = customColumnName
0
 
LVL 18

Expert Comment

by:mdougan
ID: 22763532
Can you show your whole code?
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:slightstk
ID: 22764156
Is that necessary?
0
 
LVL 18

Expert Comment

by:mdougan
ID: 22764791
Only if you want people to try to help you.

You don't have to post the entire program, but, any program code related to creating the datasource would help.  

If you are setting these values through the properties window,then, there might not be any code to post.
0
 

Author Comment

by:slightstk
ID: 22764931
That's why I asked, because I am trying to adjust the settings in the properties window.  I data bounded a combobox to a TableAdapter. This tableAdapter has the query in question.  In this query is a subquery with an alias.  I'm trying to use this alias to display info in the combo box.
0
 
LVL 18

Expert Comment

by:mdougan
ID: 22766290
OK, not much I can do for you, sorry.  I bind my controls through datasets I create in code.  Perhaps someone else will be able to comment.  I don't think it is possible to bind a control to a subquery within a query, but then, I've never tried.
0
 

Accepted Solution

by:
slightstk earned 0 total points
ID: 22771476
I found a programitic solution. In VS 2008 this was the solution that worked for me

comboBox.DisplayMember = "Sql_Query_Alias_name"

This can be inserted anywhere; however, I inserted it within the load event for the form and it worked perfectly.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question