473,231 Members | 1,740 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,231 software developers and data experts.

SelectionBox + dataset confusion

I have an dataset that populates a selectionbox. I'd like to get the
value of the column "id" of the selected item in the selectionbox
afterwards. How would I do this?
Jun 27 '08 #1
3 1075
"SelectionBox"? I've never heard of such a control. Probably you mean one of
the List derived controls like ListBox or dropdownList, etc. These usually
have a property called SelectedValue which would represent the ID vs.
SelectedText representing what the user "sees" when they make a selectio.
-- Peter
To be a success, arm yourself with the tools you need and learn how to use
them.

Site: http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://ittyurl.net
"sweetiecakes" wrote:
I have an dataset that populates a selectionbox. I'd like to get the
value of the column "id" of the selected item in the selectionbox
afterwards. How would I do this?
Jun 27 '08 #2
Yes, sorry, I accidently confused the name. I mean a ComboBox. But I
want this ID to be consistent with the database one. How would I do this?

Peter Bromberg [C# MVP] wrote:
"SelectionBox"? I've never heard of such a control. Probably you mean one of
the List derived controls like ListBox or dropdownList, etc. These usually
have a property called SelectedValue which would represent the ID vs.
SelectedText representing what the user "sees" when they make a selectio.
-- Peter
To be a success, arm yourself with the tools you need and learn how to use
them.

Site: http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://ittyurl.net
"sweetiecakes" wrote:
>I have an dataset that populates a selectionbox. I'd like to get the
value of the column "id" of the selected item in the selectionbox
afterwards. How would I do this?
Jun 27 '08 #3
If you are databinding the control from a DataSource (DataSet, DataTable,
DataReader) that comes out of the database, you need to set the ValueMember
and the DisplayMember properties of your comboBox to the names of the ID
column and the display text column in your datasource.
-- Peter
To be a success, arm yourself with the tools you need and learn how to use
them.

Site: http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://ittyurl.net
"sweetiecakes" wrote:
Yes, sorry, I accidently confused the name. I mean a ComboBox. But I
want this ID to be consistent with the database one. How would I do this?

Peter Bromberg [C# MVP] wrote:
"SelectionBox"? I've never heard of such a control. Probably you mean one of
the List derived controls like ListBox or dropdownList, etc. These usually
have a property called SelectedValue which would represent the ID vs.
SelectedText representing what the user "sees" when they make a selectio.
-- Peter
To be a success, arm yourself with the tools you need and learn how to use
them.

Site: http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://ittyurl.net
"sweetiecakes" wrote:
I have an dataset that populates a selectionbox. I'd like to get the
value of the column "id" of the selected item in the selectionbox
afterwards. How would I do this?
Jun 27 '08 #4

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

Similar topics

11
by: Nikki | last post by:
Is it possible to sort a dataset rather than a dataview? I have a web service that returns a dataset which I would like to sort before returning it (this is so the sorting is standardised and so...
4
by: Andrew Carlson | last post by:
I have a class that performs a few methods on a dataset. That dataset then fills a grid on a form. What I would like to do is to assign a particular dataset to the class at runtime. For...
35
by: MuZZy | last post by:
Hi All, I got a issue here and hope someone can help me: Let's consider this code: // =================== CODE START ================================= using System; using System.Data; ...
9
by: Dave | last post by:
Compilier will not recognize DataSet object. As you can see below is from a test simple form with no other code. I'm just trying to get any Aspx form to recognize the DataSet object. You can...
2
by: Steve | last post by:
Hello, Here is my scenario. I have a MDIForm, and 2 Child forms (ChildForm1 and ChildForm2). The child forms can only be opened by their own toolbar icon on the MDIForm. When I open ChildForm1, I...
2
by: Rob Richardson | last post by:
Greetings! I have a database with a table named Holdings. I has VB.Net create a .xsd file for it so that I could use a typed dataset with it. The table has 21 rows. If I use ordinary...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
12
by: Whoever | last post by:
Hi, I'm trying to return an XmlDocument or XmlNode converted from a typed dataset. public XmlNode whatever() { MyTypedDataSet ds = new MyTypedDataSet(); return new XmlDataDocument(ds); }
1
by: Richard Lewis Haggard | last post by:
I'm having a problem with what appears to be some sort of confusion with references. I have a single solution with a dozen projects which has been working quite nicely for a while. The references...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.