• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 332
  • Last Modified:

display member for data-bound combo box

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
slightstk
Asked:
slightstk
  • 4
  • 4
1 Solution
 
mdouganCommented:
What do you have set for the DataSource name?  What is the name of the Display Member Column?
0
 
slightstkAuthor Commented:
dataSource name = xyzDataSourceName
display member column = customColumnName
0
 
mdouganCommented:
Can you show your whole code?
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
slightstkAuthor Commented:
Is that necessary?
0
 
mdouganCommented:
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
 
slightstkAuthor Commented:
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
 
mdouganCommented:
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
 
slightstkAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now