Solved

display member for data-bound combo box

Posted on 2008-10-20
8
322 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…

726 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