473,809 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Concatenating Multiple Values for DataValueField

RF
How can I do something like this

AuthorList.Data ValueField = "au_lname" &"-"& "au_id"

I want to concatenate two columns together. Any ideas??
Nov 18 '05 #1
5 6532
You can't do that. Do it in your SQL instead, so it is one column when it
comes in. Or, if you are using a datatable as the source, create an
appropriate expression column, and use that as the data value field.

"RF" <RF@discussions .microsoft.com> wrote in message
news:3E******** *************** ***********@mic rosoft.com...
How can I do something like this

AuthorList.Data ValueField = "au_lname" &"-"& "au_id"

I want to concatenate two columns together. Any ideas??

Nov 18 '05 #2
RF
Thanks Marina, could you give me quick SQL example? Thanks.

"Marina" wrote:
You can't do that. Do it in your SQL instead, so it is one column when it
comes in. Or, if you are using a datatable as the source, create an
appropriate expression column, and use that as the data value field.

"RF" <RF@discussions .microsoft.com> wrote in message
news:3E******** *************** ***********@mic rosoft.com...
How can I do something like this

AuthorList.Data ValueField = "au_lname" &"-"& "au_id"

I want to concatenate two columns together. Any ideas??


Nov 18 '05 #3
Select Col1 + '-' + Col2 as MyDataValueCol FROM MyTable
"RF" <RF@discussions .microsoft.com> wrote in message
news:B6******** *************** ***********@mic rosoft.com...
Thanks Marina, could you give me quick SQL example? Thanks.

"Marina" wrote:
You can't do that. Do it in your SQL instead, so it is one column when it comes in. Or, if you are using a datatable as the source, create an
appropriate expression column, and use that as the data value field.

"RF" <RF@discussions .microsoft.com> wrote in message
news:3E******** *************** ***********@mic rosoft.com...
How can I do something like this

AuthorList.Data ValueField = "au_lname" &"-"& "au_id"

I want to concatenate two columns together. Any ideas??


Nov 18 '05 #4
RF
Thanks much

P.S. Oracle's concat operator is || instead of +.

"Marina" wrote:
Select Col1 + '-' + Col2 as MyDataValueCol FROM MyTable
"RF" <RF@discussions .microsoft.com> wrote in message
news:B6******** *************** ***********@mic rosoft.com...
Thanks Marina, could you give me quick SQL example? Thanks.

"Marina" wrote:
You can't do that. Do it in your SQL instead, so it is one column when it comes in. Or, if you are using a datatable as the source, create an
appropriate expression column, and use that as the data value field.

"RF" <RF@discussions .microsoft.com> wrote in message
news:3E******** *************** ***********@mic rosoft.com...
> How can I do something like this
>
> AuthorList.Data ValueField = "au_lname" &"-"& "au_id"
>
> I want to concatenate two columns together. Any ideas??


Nov 18 '05 #5
ae
Works good, but to do updates what's your recommendation? Thanks.

"RF" wrote:
Thanks much

P.S. Oracle's concat operator is || instead of +.

"Marina" wrote:
Select Col1 + '-' + Col2 as MyDataValueCol FROM MyTable
"RF" <RF@discussions .microsoft.com> wrote in message
news:B6******** *************** ***********@mic rosoft.com...
Thanks Marina, could you give me quick SQL example? Thanks.

"Marina" wrote:

> You can't do that. Do it in your SQL instead, so it is one column when

it
> comes in. Or, if you are using a datatable as the source, create an
> appropriate expression column, and use that as the data value field.
>
> "RF" <RF@discussions .microsoft.com> wrote in message
> news:3E******** *************** ***********@mic rosoft.com...
> > How can I do something like this
> >
> > AuthorList.Data ValueField = "au_lname" &"-"& "au_id"
> >
> > I want to concatenate two columns together. Any ideas??
>
>
>


Nov 18 '05 #6

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

Similar topics

1
1222
by: Ani | last post by:
I have a questionaire page , which basically has questions with multiple choice answers. I need to accomplish paging on this and there are few questions that are gender specific. According the person who has logged in, if the person is male, i need to generate only those questions specific to males . I have a function that returns the contents of the questionaire in the form of a datatable. I have successfully displayed all the questions...
6
4451
by: Sebi | last post by:
Hello all, I'm thinking about overwriting the ListItem, so it can contain x additional values (not only one). Has anybody ever tried this? Has someone got an example (C#)? Can DropDownList handle overwritten Items, or will additional Data be lost? Thanks for any advice.
3
4936
by: Kevin Pedersen | last post by:
Hello, I am using an editable datagrid. After I save the changes the datagrid shows the old values. I've read the posts about the Page_Load and not binding the datagrid each time. The SQL that is being sent to the database is correct and the changes are eventually being made. If I refresh the page after the update then the new values appear. I noticed that when I put a breakpoint in my update handler everything works fine. When I take...
2
2736
by: DC Gringo | last post by:
I have two listboxes, the first of which is an autopostback=true that allows multiple row selection. When I select multiple values (by holding down CTL) in the first one, it should query the second one. I seem unable to do this as it only sends back the first item I select whether I have the CTL key down or not. Upon the return trip, I can select another one, but it still only sends value for the last one I selected. -- MY LISTBOX --...
5
3538
by: Lie | last post by:
Hi all, I have problem in getting selectedindex of multiple listbox selection in a datagrid. I have a listbox with multiple selection mode inside datagrid. In Edit mode, I need to get back all selected items of that listbox and display it. can anyone help? Thanks
0
984
by: js | last post by:
I am using the Microsoft.Practices.EnterpriseLibrary and trying to bind all the DropDownList controls on a page by calling the following function at Page_Load event. My attempt is make only one trip to the SQL Server and populate all the result sets in a Datasset object then bind each DropDownList to the repective table. How can I achieve this? As you can see, I execute SQL statement multiple times in the sample. private void...
0
1793
by: Nam | last post by:
I want to use the same sqlDataSource for two CheckBoxList controls in ASP.NET 2.0. For simplicity, I am using the case of only two CheckBoxList controls in the following example: My sqlDataSource is bound to a table in my database. The table has four columns, say, col1_ID, col1_value and col2_ID, col2_value. The DataValueField and DataTextField values for CheckBoxList1 are bound to col1_ID and col1_value respectively. And, for...
2
8202
by: keniget | last post by:
Hope I'm posting this in the right place. Has anyone encountered the need to have more than one datavaluefield? At present, I'm returning two columns, a StateID and a StateDesc and they are being put into the datavaluefield and datatextfield respectively. I could REALLY do with binding another column to the dropdownlist as I require additional information about these states...
1
3072
by: dhyder | last post by:
OK, like the title says my error is Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. I have looked into this a lot, but have not been able to find a solution to it. <%@ Page Language="c#" runat="server" debug="true" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.OleDb" %> <script runat="server"> OleDbConnection conn = new...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9601
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
10637
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10379
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
9199
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6881
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
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
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
3
3014
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.