473,387 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

combobox.selectedvalue problem

Hello,

I have a combobox populated by a dataset filled with data from a SQL view.
In the view I have combined two fields to create one.
I can't set my combobox.selectedvalue to this value. Any other field in the
view works, but this one leaves the combobox empty...

The purpose behind this is to display what the user is to select, along with
a description of each item.

Any suggestions?
Thanks in advance,
Amber
Nov 22 '05 #1
3 1841
Amber,
Try aliasing the combined fields in the SQL statement. For example:
"select (Fname || '-' || Lname) as Name from myTable"

You can then reference the combined fileds as follows in the combobox as
follows:

combobox.selectedvalue="Name"

Hope this helps,
Rich

"amber" wrote:
Hello,

I have a combobox populated by a dataset filled with data from a SQL view.
In the view I have combined two fields to create one.
I can't set my combobox.selectedvalue to this value. Any other field in the
view works, but this one leaves the combobox empty...

The purpose behind this is to display what the user is to select, along with
a description of each item.

Any suggestions?
Thanks in advance,
Amber

Nov 22 '05 #2
Amber,
Try aliasing the combined fields in the SQL statement. For example:
"select (Fname || '-' || Lname) as Name from myTable"

You can then reference the combined fileds as follows in the combobox as
follows:

combobox.selectedvalue="Name"

Hope this helps,
Rich

"amber" wrote:
Hello,

I have a combobox populated by a dataset filled with data from a SQL view.
In the view I have combined two fields to create one.
I can't set my combobox.selectedvalue to this value. Any other field in the
view works, but this one leaves the combobox empty...

The purpose behind this is to display what the user is to select, along with
a description of each item.

Any suggestions?
Thanks in advance,
Amber

Nov 22 '05 #3
Hi.
Thanks for the reply.
That's exactly what I have done.

Me.cboSeason.DisplayMember = "DisplayDesc"

Where

DisplayDesc is alias for:
STR_DISPLAY_VALUE + ' ' + STR_VALUE_DESC

Amber

Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Supa Hoopsa | last post by:
I have a databound combobox within a datagrid. I have set the DisplayMember and ValueMember. BUT, how do I capture the Value (SelectedValue) when the user changes the selection?
7
by: charliewest | last post by:
Using .Net CF, i have created a 2 dimension ArrayList, and "binded" this list to a ComboBox control using the "DataSource" property. I have set the DisplaySource and ValueMember properties as well....
6
by: Mike Caputo | last post by:
Shouldn't I be able to set the selected item of a combobox with the SelectedValue property? The ComboBox has four items, the values are 1 through 4. Here's an example of what I'm trying to do: ...
4
by: al | last post by:
Greetings, As I understands it, SelectedValud of combobox reads its value from ValueMember property of the combobox. This doesn't work with me. What happens is just randome update. This is the...
30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
7
by: Simon Verona | last post by:
I posted this in dotnet.languages.vb.controls but thought I'd post here as well.. I have a combobox that is bound to a dataview generated from a dataset. The dataset has a single table...
5
by: Peter M. | last post by:
I'm struggling with combobox databinding with something I consider a bug... I'm binding my combobox to an array of structs. The struct exposes two public properties, ID and Name, to be used as...
0
by: Frnak McKenney | last post by:
Can I use a bound ComboBox for both browsing and editing? I'm working on a small, standalone database application using Visual C#.NET 2003 and an Access data file. In order to keep the number...
1
by: Aleksey Timonin | last post by:
Hi guys, I have a comboBox binded to DataTable: comboBox.DataSource = MyDataTable; comboBox.ValueMember = "id"; comboBox.DisplayMember = "id";
11
Frinavale
by: Frinavale | last post by:
This question is going to sound a little crazy but.........How do you set the selected item in a ComboBox? I am populating a ComboBox with a bunch of instances of a custom private class: For...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.