Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 329
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

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