Solved

display member for data-bound combo box

Posted on 2008-10-20
8
317 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
Comment Utility
What do you have set for the DataSource name?  What is the name of the Display Member Column?
0
 

Author Comment

by:slightstk
Comment Utility
dataSource name = xyzDataSourceName
display member column = customColumnName
0
 
LVL 18

Expert Comment

by:mdougan
Comment Utility
Can you show your whole code?
0
 

Author Comment

by:slightstk
Comment Utility
Is that necessary?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 18

Expert Comment

by:mdougan
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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 …
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now