473,406 Members | 2,369 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,406 software developers and data experts.

Dotnet Combox Datasource

how to read the valuemember of the combox whose data source is a detaset. i have assigned the properties of displaymember and valuemember . display member cis visible but i cant get the value member behind it..........
Sep 13 '07 #1
2 1233
dip_developer
648 Expert 512MB
how to read the valuemember of the combox whose data source is a detaset. i have assigned the properties of displaymember and valuemember . display member cis visible but i cant get the value member behind it..........
suppose customer_name is displaymember and customer_id is valuemember ...........
you can have it by..........

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim custid As String =CType(cmyCombo.SelectedValue,String)
  3.  
if valuemember is not set.....then you can have it by .........

Expand|Select|Wrap|Line Numbers
  1.  Dim custid As String = CType(myCombo.SelectedItem, DataRowView).Row("customer_id ")
Sep 13 '07 #2
Plater
7,872 Expert 4TB
Sometimes (as is the case with a dataset)
the SelectedValue property returns an entire Row instead of just what is defined as the "valuemember".
You could check this by saying:
Expand|Select|Wrap|Line Numbers
  1. MessageBox.Show(mycombobox.SelectedValue.GetType().Name);
  2.  
That will tell you the name of the object it is returning, which frequently sheds some light on the problem.
Sep 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: raj | last post by:
Please Help with the combox DisplayValue property private void cboClient_SelectionChangeCommitted(object sender, System.EventArgs e) { String strSQL; strSQL = "SELECT F.FollowUpPerson FROM...
4
by: Charles A. Lackman | last post by:
Hello, I have a combox that I am trying to get to work in the following fashion. As you type in the combox that the item that matches what you are type is selected. as you type a last name:...
2
by: Alpha | last post by:
I have a window application. On one of the form, there is a listbox and a few combox. The lstSchItem has a dataview as a datasource. The comboxes are bind to its selected value but through the...
5
by: Greg McKnight | last post by:
This may be the second time this post is showing, I accidentally shut down my browser. Sorry if it is a repeat. I am a newbie to VB.net, so please forgive me if these are simple questions. ...
2
by: Daylor | last post by:
hi. i have 2 combobox on form. after i load the form. when i select the first combobox , i want to filter the datatable that attached to the second combobox. i wrote :
2
by: Bob | last post by:
The scenario is that of the employees table wherein there's an EmployeeId and a ReportsTo field in the same table. The combobox is one in a datagrid view that lets you select an employee from the...
1
by: neo1ra | last post by:
Hi, I'm doing a search combox to pop up and specific record. Everything is working fine until I make a change to the record that I'm working on and try to move to other record. A error message...
1
by: dewgan | last post by:
I have a form with a combox box where the list is populated via a linked table. This works fine. I have a text box that is filled with the name selected in the combox box. That name is then added...
0
by: gyanendar | last post by:
Hi All, I am using DataGridview and there is a Combobox column is present in the datagrid. I am binding the DataGridViewComboboxcolumn with a DataSource. DataGridViewComboBoxColumn cmbInstType...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.