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

Concatenate

Is there an easy way to concatenate two columns (i.e. last name and first
name columns) in a data set so both can show up in a data text field of a
combo box?
Nov 18 '05 #1
3 1621
"Mike Moore" <Mi*******@discussions.microsoft.com> wrote in message
news:6D**********************************@microsof t.com...
Is there an easy way to concatenate two columns (i.e. last name and first
name columns) in a data set so both can show up in a data text field of a
combo box?


Easiest way is to do it in your SQL statement e.g.

SELECT <...other columns...>, FirstName + ' ' + LastName As FullName,
<...other columns...>
FROM <...table(s)...>
WHERE <...criteria...>

Then bind your combo box to the FullName field
Nov 18 '05 #2
This solves the problem by doing the query a special way, which I already
thought was possible, but more work.

what I wanted was a way to combine two columns *after* a query was performed
by setting the datatextfield property a certain way.

Mike Moore


"Mark Rae" wrote:
"Mike Moore" <Mi*******@discussions.microsoft.com> wrote in message
news:6D**********************************@microsof t.com...
Is there an easy way to concatenate two columns (i.e. last name and first
name columns) in a data set so both can show up in a data text field of a
combo box?


Easiest way is to do it in your SQL statement e.g.

SELECT <...other columns...>, FirstName + ' ' + LastName As FullName,
<...other columns...>
FROM <...table(s)...>
WHERE <...criteria...>

Then bind your combo box to the FullName field

Nov 18 '05 #3
"Mike Moore" <Mi*******@discussions.microsoft.com> wrote in message
news:0D**********************************@microsof t.com...
but more work.
Hardly... :-)
what I wanted was a way to combine two columns *after* a query was
performed
by setting the datatextfield property a certain way.


I don't believe so. However, you could abandon the DataSource() and
DataBind() method of populating the dropdown and instead iterate through the
records in the DataSet / DataReader, concatenate the two name fields and
then add them to the dropdown using its Items.Add() method.

However, I think you'll find that is certainly more work...
Nov 18 '05 #4

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

Similar topics

0
by: Nick Heppleston | last post by:
I have a concatenation problem and I was wondering if somebody might be able to offer some help :-) I have the following table structure holding product long descriptions: Part...
30
by: priya | last post by:
Hi How to concatenate two integer Values. Example Program : #include "Port.h" #include "BinaryConversion.h" # include "iostream.h"
8
by: Dixie | last post by:
I have the results of a query to send to a mailmerge with Word 2000. The query produces say 6 to 8 records, where only 1 of the fields is different from record to record. I can only have one...
6
by: Sheldon | last post by:
Hi, I am trying to build a large array using concatenate function in python. So as I loop over the number of arrays, of which there are 12 (4 down and 3 across), I create 3 long arrays by...
14
by: metamorphiq | last post by:
Hello, I'm a Java programmer, so I'm probably asking a very simple question here, but I have trouble solving it :) I'd like to know how you concatenate multiple (4, in my case) char* in C++,...
2
by: exapplerep | last post by:
I've seen how to use VBA code to concatenate two fields into a third by using an expression in the "After Update" property in fields 1 & 2. field3 = field1 + field2 The above code would go...
4
by: Dan | last post by:
Hi all, I am creating a search table where the keywords field is made up of several text fields and this is causing me some problems. I can concatentate the text ok but i can't seem to concatenate...
12
by: parth | last post by:
Hi I want to achieve the following transformation of data using a stored procedure. Source col1 col2(varchar) -------------------------
13
by: sinbad | last post by:
hi, how to concatenate a "hash defined" constant value to another "hash defined" constant string. For example #define ABC 100 #define MYSTR "The value of ABC is" Now i need a string that...
10
by: Aaron Hoffman | last post by:
Hello, I'm hoping someone might be able to offer some guidance to my problem. I have one query in MS Access which consists of 2 tables joined by a SEQUENCE_ID. By joining the two tables I am...
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: 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
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.