473,671 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can you get 2 datafields displayed in a combo box?

How can you get 2 datafields displayed in a combo box, and still return just
one of the fields?

I need to return a company name in order to help users visually determine
who a rep works for, but need only the repcode to pass on to another
variable.

SC

Nov 18 '05 #1
3 1140
Set the DataTextField and the DataValueField properties of the DropDownList
control to the column names of the corresponding columns. If you have the
MSDN Library installed there are examples in the topics for these
properties.

Hope this helps
Martin
<me@privacy.net > wrote in message
news:u5******** *****@tk2msftng p13.phx.gbl...
How can you get 2 datafields displayed in a combo box, and still return just one of the fields?

I need to return a company name in order to help users visually determine
who a rep works for, but need only the repcode to pass on to another
variable.

SC

Nov 18 '05 #2
Martin - thanks for the response -

A follow-up question -

If I am in my select statement formatting the first of the 2 fields, for
example:

select
'(' + company + ')' as company1,
salesrepname as Salesrepname

would I need to put in the field only (company), or the result of the AS
(company1) or would it be the string formatted '('+company+')' ?

Thanks,

SC

"Martin Dechev" <de*******@hotm ail.com> wrote in message
news:eh******** ******@TK2MSFTN GP10.phx.gbl...
Set the DataTextField and the DataValueField properties of the DropDownList control to the column names of the corresponding columns. If you have the
MSDN Library installed there are examples in the topics for these
properties.

Hope this helps
Martin
<me@privacy.net > wrote in message
news:u5******** *****@tk2msftng p13.phx.gbl...
How can you get 2 datafields displayed in a combo box, and still return

just
one of the fields?

I need to return a company name in order to help users visually determine who a rep works for, but need only the repcode to pass on to another
variable.

SC


Nov 18 '05 #3
The column name will be what you specify with the AS clause, in your example
the table in the dataset should have columns with names "company1" and
"Salesrepna me". The same if it is DataReader.

Hope this helps
Martin
<me@privacy.net > wrote in message
news:ut******** ******@TK2MSFTN GP12.phx.gbl...
Martin - thanks for the response -

A follow-up question -

If I am in my select statement formatting the first of the 2 fields, for
example:

select
'(' + company + ')' as company1,
salesrepname as Salesrepname

would I need to put in the field only (company), or the result of the AS
(company1) or would it be the string formatted '('+company+')' ?

Thanks,

SC

"Martin Dechev" <de*******@hotm ail.com> wrote in message
news:eh******** ******@TK2MSFTN GP10.phx.gbl...
Set the DataTextField and the DataValueField properties of the

DropDownList
control to the column names of the corresponding columns. If you have the
MSDN Library installed there are examples in the topics for these
properties.

Hope this helps
Martin
<me@privacy.net > wrote in message
news:u5******** *****@tk2msftng p13.phx.gbl...
How can you get 2 datafields displayed in a combo box, and still
return just
one of the fields?

I need to return a company name in order to help users visually

determine who a rep works for, but need only the repcode to pass on to another
variable.

SC



Nov 18 '05 #4

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

Similar topics

3
281
by: | last post by:
How can you get 2 datafields displayed in a combo box, and still return just one of the fields? I need to return a company name in order to help users visually determine who a rep works for, but need only the repcode to pass on to another variable. SC
6
279
by: | last post by:
How can you get 2 datafields displayed in a combo box, and still return just one of the fields? I need to return a company name in order to help users visually determine who a rep works for, but need only the repcode to pass on to another variable. SC
0
945
by: | last post by:
How can you get 2 datafields displayed in a combo box, and still return just one of the fields? I need to return a company name in order to help users visually determine who a rep works for, but need only the repcode to pass on to another variable. SC
10
7125
by: truptivk | last post by:
Hello all, I have a situation and I'd appreciate it if any of you could help me. I am not sure if this is js or html but here goes. I have a main combo box (mcb) which I'm displaying some values. Based on what the user chooses, 2 combo boxes should be displayed on same page. The first combo box (CB1), should be filled with some values. The second, (CB2) however, should get loaded on basis of what is chosen in CB1. UNtil then, CB2 should be...
0
8392
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8819
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8597
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8669
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5692
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4403
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2809
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2049
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.