Tracking Forums, Newsgroups, Maling Lists
Home Submit Tracker Forums
  Advanced Search


Concatenate Two Cells Into A Single Cell?

Query for Concatinate two cells into a single cell

View 9 Replies (Posted: Jun 30, 2010 12:05 PM)

Sponsored Links:

Related Forum Messages For ASP.NET category:
SQL Reporting :: Joined Tables - Concatenate Rows Into Single Row?
Im having a go at doing a report for my application. I have 2 tables, one which lists a loan we have given to a customer, and another table which lists repayments against the loans.

I want to display each loan and how much is outstanding against it. My problem is that each loan is repeated in the table for each repayment against it. So when i try to sum up the loans awarded to a customer, if they only have one loan and have made 3 repayments against it, it sums up the amount awarded against each record.

eg, if i award a customer a loan of £200, and they make 3 repayments of £50, 3 records appear in the table. The amount awarded is repeated against each repayment, and when i total a customers loan amounts, it totals 3 x £200.

I have put the details into the grouping row, where it is grouped by loan_id, displaying the toal of repayments instead of each repayment. This stops it repeating in the table, but when i total the amount awarded field it still calculates 3 x £200.

I tried calculating the total on the report item after grouping but you cannot calculate on a report item.

Is there a way to stop the table from repeating the amount awarded against each repayment? Or even a way in the SQL statement of the dataset to make it display a total of repayments rather than each repayment. Cant see how to calculate a total repaid as i would need to pass a Loan_id in as a parameter.

Posted: Feb 13, 2010 01:08 PM

View 3 Replies!   View Related
SQL Server :: How To Concatenate Multiple Rows Of Single Table
I've a table where one person teaches multiple classes. It looks like this.


Id    Name      Class        Subject
2       Sam        12       English
2       Sam        10       Maths
2       Sam        10       English
2       Sam         8        History
2       Sam        12       Economics

Here Sam teaches Class 12 - English & Economics, Class 10 - Maths & English, Class 8 - History

I want to display the result like this -

Id           Name          Class         Subject
2             Sam             12            English, Economics
2             Sam             10            Maths, English
2             Sam              8             History

How to concatenate multiple Rows?

Posted: Mar 08, 2011 06:22 AM

View 6 Replies!   View Related
Forms Data Controls :: Concatenate Gridview Rows To Single String
i need to concatenate the gridview rows to a single string if the gridview count is more than 100 then i need to perform the concatenation as 100 comma seperated  and the next has to be carried over to the next string say if the count of gridview is 1000 then i need to concatenate the string as string1= 1to 100(Ex: a,b,c....) then string2=101-200 string3= 201-300... and so on. in case if i had to use String builder for this.. tel me how to proceed with this.

Posted: Jan 28, 2010 12:37 PM

View 2 Replies!   View Related
Preserve Spaces In GridView Cells When Cell Contents Added In C# Code-behind?
I'm trying to provide functionality for a client where his Excel spreadsheet will be displayed on webpages as-is. I was able to implement the reading of Excel worksheets with Koogra ( Now, I'm pulling my hair out trying to preserve what Excel's Accounting format for cells has. In Excel, the value 5,000,000 is displayed as '$  5,000,000' using the Accounting cell format. I finally figured out the correct .NET format to make a Double formatted the same (see code below). But when I render the gridview, all imbedded spaces are removed - NOT what I need to show. HOW do I preserve the spaces? BTW, when I was curious to know if/how Excel handled this when I save the worksheet as an html formatted file, it uses a style with 'mso-spacerun:yes' but I can't find ANY documentation on that or if that would be available on a GoDaddy website. Again - trying to preserve content including spaces from the C# code-behind to populate GridView cells.


Posted: Jun 27, 2007 11:19 PM

View 10 Replies!   View Related
Forms Data Controls :: Gridview Edit Cells And Auto Update Total In Another Cell?
My goal is to use Gridview control to behave somewhat like an excel spreadsheet... 

where the user can change/enter a value in Cell1

where the user can change/enter a value in Cell2

Cell3 automatically gets updated with the total of (Cell1 * Cell2).  Assuming of course that a formula was placed in Cell3.

In this case ... each row will have EditLink enable.

The user clicks on EditLink.. and the button is replaced with "Update" "Cancel" links.

txtCompensationPercentPayout is now editable

txtCommissionPayoutGross is now editable

The user enters/changes the value of txtCompensationPercentPayout and tabs to the next field.   At this time... I'd like lblCommissionPayoutNet to be updated with the total. The user enters/changes the value of txtCommissionPayoutGross and tabs to the next field.   At this time... I'd like lblCommissionPayoutNet to be updated with the total. 


Posted: Dec 04, 2009 05:04 AM

View 2 Replies!   View Related
Forms Data Controls :: Make Specific Cells In A Dynamic Gridview Clickable And Capture The Cell Info Before Redirecting
I generate dynamic grids based on a count value returned from some DB tables. the code for it goes like this : I give and Id to each grid that is generated.

if (myDataList1.Count >= 1)
for (int i = 0; i < myDataList1.Count; i++)
//retrieving the exact i  count from pageload
ViewState.Add("newCount", i);
//creating the dynamic grid with its corresponding gridview properties.
grvDynamic = new GridView();                   
grvDynamic.ID = "GridView" + (i+3);                  
grvDynamic.AutoGenerateColumns = false;                  
grvDynamic.RowCreated += GridViewRowCreated;                                     
grvDynamic.RowDataBound += grvDynamic_RowDataBound;
//adding bound field columns to retrieve data from stored proc                     
BoundField metric = new BoundField();
metric.HeaderText = "Goal ";
metric.DataField = "metric";
BoundField mtd = new BoundField();
mtd.HeaderText = "MTD";
mtd.DataField = "value_MTD";
BoundField goal = new BoundField();
goal.HeaderText = "Tier Level Achieved";
goal.DataField = "value_goal";
goal.HeaderStyle.Width = Unit.Percentage(10);
BoundField you1 = new BoundField();
you1.HeaderText = "Month End";
you1.DataField = "firstLevel_you";
BoundField you2 = new BoundField();
you2.HeaderText = "Month End";
you2.DataField = "secondLevel_you";
ButtonField singleClick = new ButtonField();
singleClick.CommandName = "clickHyperlink";
singleClick.Visible = false;
BoundField metricId = new BoundField();
metricId.HeaderText = "Metric Id";
metricId.DataField = "metricID";
metricId.Visible = true;
//binding the gridview to data.
grvDynamic.DataSource = data;
grvDynamic.Columns[5].Visible = false;

protected void grvDynamic_RowDataBound(object sender, GridViewRowEventArgs e)
//this basically gets the metric Id's of rows with the ishyperlink flag set to 'Y'. I need to make these particular cells clickable var isClickable = (from md in myDataList3 where md.IsHyperLinkFlag == 'Y' &&

md.value_MTD != null select md.metricID).ToList();
if (e.Row.RowType == DataControlRowType.DataRow)
// Get reference to button field in the gridview.
LinkButton _singleClickButton = (LinkButton)e.Row.Cells[5].Controls[0];

if (isClickable.Contains(Convert.ToInt32(e.Row.Cells[6].Text)))
e.Row.Cells[1].Style["cursor"] = "hand";
e.Row.Cells[1].Style["color"] = "blue";
e.Row.Cells[1].Style["textdecoration"] = "Underline";
e.Row.Cells[1].Attributes.Add("onClick", "window.location ='../HeaderPages/page2.aspx' ");

This code works perfectly fine , depending on the ishyperlink flag in the database...specific cells in the grid are made clickable and then redirected to page2.aspx My Issue: I need to capture which specific cell in which specific grid the user has clicked. store some information in sessions based on the cell clicked and use that information in page2.aspx.

Posted: Aug 03, 2010 03:54 PM

View 5 Replies!   View Related
ADO.NET :: Convert SQL Concatenate To LINQ Concatenate Query?
convert the code below to LINQ, converting my project to a wseb version usimg LINQ To SQL. The project contains 10 textboxes to possibly select from, but I'm only providing the first two textboxes to simplify my question.

If Not ((TextBox1.Text = String.Empty) And (TextBox2.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + " where "
If Not (TextBox1.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + "IDENTIFICATION_DATA.NSC IN (" + TextBox1.Text & ")"
End If
If (TextBox1.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + "isnull(IDENTIFICATION_DATA.NIIN) = FALSE"
End If
If Not (TextBox2.Text = String.Empty) Then
If astrixState = 0 Then
If Not (TextBox1.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + " AND IDENTIFICATION_DATA.NIIN IN (" + TextBox2.Text & ")"
ElseIf (TextBox1.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + " AND IDENTIFICATION_DATA.NIIN IN (" + TextBox2.Text & ")"
End If
End If
If astrixState = 1 Then
If Not (TextBox1.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + " OR IDENTIFICATION_DATA.NIIN IN (" + TextBox2.Text & ")"
mySQL_Statement = mySQL_Statement + " AND IDENTIFICATION_DATA.NIIN IN (" + TextBox2.Text & ")"
End If
End If
If astrixState = 2 Then
If Not (TextBox1.Text = String.Empty) Then
mySQL_Statement = mySQL_Statement + "AND IDENTIFICATION_DATA.NIIN NOT IN (" + TextBox2.Text & ")"
mySQL_Statement = mySQL_Statement + " AND IDENTIFICATION_DATA.NIIN NOT IN (" + TextBox2.Text & ")"
End If
End If
End If

Posted: Oct 20, 2010 04:59 PM

View 12 Replies!   View Related
Multiple Single Cell Gridviews Update
I am trying to get an update to work, but am having endless problems.  I don't know if what I am doing is possible or if I am even going about it the right way. I have numerous Gridviews that are bound to a single sqldatasource.  Each Gridview shows one field of a table based on the selection from a drop down box.  The reasoning behind this is to be able to space out the information and include a bit of whitespace to make everything more presentable. Each gridview is made editable (by using editindex=0) to allow the user to update the presented information.

When I try to update the gridviews through an onclick event with sqldatasource5.update() nothing happens.  If I use each individual gvAddress.Updaterow(gvaddress.editindex(), true), gvCity.Updaterow(gvCity.editindex(), true), etc only the first update occurs. All other fields become null.  Now I can see the reasoning behind this as this event is updating all rows from the UpdateCommand in sqldatasource5 and each time the event is called only one field has data in it. I have included some code below to show what is going on.....

ConnectionString="<%&#36; ConnectionStrings:GOAServerConnectionString %>"
SelectCommand="SELECT [ContactID], [Department], [Address], [City], [State], [PostCode], [WorkPhone], [HomePhone], [MobilePhone], [FaxNumber], [EmailName], [ContactType], [Note] FROM
[Contacts] WHERE ([ContactID] = @ContactID)"
UpdateCommand="UPDATE [Contacts] SET [Department] = @Department, [Address] = @Address, [City] = @City, [State] = @State, [PostCode] = @PostCode, [WorkPhone] = @WorkPhone, [HomePhone]
= @HomePhone, [MobilePhone] = @MobilePhone, [FaxNumber] = @FaxNumber, [EmailName] = @EmailName, [ContactType] = @ContactType, [Note] = @Note WHERE [ContactID] = @ContactID"

Posted: Jan 06, 2009 05:15 AM

View 1 Replies!   View Related
Forms Data Controls :: Changing Value In Single Cell?
I have a gridview which shows the contents of the shopping cart. The qty cell is a template control bound to the qty field in the datasource. My ideal scenario is to  have the user highlit the qty, write the new one and press 'enter' to update the sqldatasource but this may not be possible.

My second chose is an Update button to update the data but this erases the data from the other fields not listed as key.

I have tried the edit and update functions but then all fields are editable and I dont't want that, just the qty cell. If I change the read only atrribute to true on the ones that I don't want edited, then it erases the information from those fields.

Posted: Dec 14, 2010 07:55 PM

View 6 Replies!   View Related
C# - Saving Multiple Items Per Single Database Cell?
i have a countries list. Each user can check multiple countries. Once saved, this "user country list" will be used to get whether other users fit into countries certain user chose.

Question is what would be the most efficient approach to this problem...

I have one, one to save user selection as delimited list like Canada,USA,France ... in single varchar(max) field but problem with it would be that once user from Germany enters page i perform this check on. To search for Germany i would be needed to get all items and un-delimit each field to check against value or to use sql 'like' which again is pretty damn slow...

Just to make sure, many users will have their own selections of countries from which and only they want to have users to land on their page. While millions of users will reach those pages. So the faster approach will be the better.

technology, MSSQL and ASP.NET

Posted: May 13 10 at 9:45

View 5 Replies!   View Related
Databases :: How To Update Single Cell Of Excel Sheet Using Oledb Connection
i got some codes from net  by using that i can update a excel sheet ,but there we have to specify some header fields name in command string like as fallows ,

Update [Sheet1$] set ProductName="IBG" where ProductId=5

but i want to update a single cell of excel sheet only,let say O12 cell i want to change somedata,how it is possible that i don't know.

Posted: Feb 02, 2008 12:10 PM

View 13 Replies!   View Related
Forms Data Controls :: Gridview Multiple Hyperlink In A Single Cell?
How to add individual hyperlink on comma separated values in single cell? For Eg: I have customer name comma separated in a single cell. I want each customer name as a single individual link.

Posted: Feb 23, 2011 05:04 AM

View 2 Replies!   View Related
Forms Data Controls :: Mixture Of Formatted Text Within A Single GridView Cell?
Using Visual Studio 2008 (but have VWD 2010 available). Desire is populate a cell from a number of database items that have been concatenated together. Exampler would be Smith, John, 2010, Going After an Ideal Solution, 500 pages. Gridview allows me to set the cell format, but for the entire cell.  I would like to present this as a mixture.

Posted: Jun 28, 2010 04:38 PM

View 6 Replies!   View Related
Forms Data Controls :: How To Show Textbox In Gridview Cell Like Excel Cell
I want to show Gridview cell like Excel cell, I don't want to show Textbox.

Am writting this code in gridview.

<asp:TemplateField HeaderText ="1 St Week">
<ItemTemplate >
<asp:Label ID ="lbl1week" runat ="server" Text ="Present"></asp:Label>
<asp:TextBox ID ="txt1week" runat ="server" ></asp:TextBox>

Posted: Nov 05, 2009 06:20 AM

View 2 Replies!   View Related
Forms Data Controls :: Gridview And Sql Bit - Check The Cell With The Bit Value To Change The Cell Color
I have a grid view populated with some data included bit fields and I made an export to excel function For each row i need to check the cell with the bit value to change the cell color, but the cell is always empty, even if is the field is set to False or True. foreach (GridViewRow row in gv.Rows)

Posted: Apr 30, 2010 08:58 AM

View 2 Replies!   View Related
Web Forms :: Menu Control Blank Cell / Remove Empty Cell?
I am using ASP.Net Menu Control with following properties

<asp:Menu ID="gNav" StaticTopSeparatorImageUrl="/_layouts/images/Avnet/globalNavSeparator.gif" StaticBottomSeparatorImageUrl="/_layouts/images/Avnet/globalNavSeparator.gif" runat="server" Orientation="Horizontal" StaticEnableDefaultPopOutImage="false">

However, when I run the code a black cell is automatically created to the right-hand of each menuitem at the toplevel. This is giving me problems in centering the text.

This empty cell has width of 3px. Can anyone please help me findout how to remove this empty cell.

Posted: Sep 16, 2009 07:05 PM

View 9 Replies!   View Related
Forms Data Controls :: GridView Control Cell Turns Grey When Updating Cell?
I'm having a weird problem where the GridView cell that I'm programmatically updating turns grey, and throws a null error when attempting to save row. I have been searching all day and have not been able to find a solution. I'm guessing there is a problem with my code, so here it is:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Posted: Feb 11, 2010 10:36 PM

View 5 Replies!   View Related
Forms Data Controls :: How To Set Height And ItemSource (Business Object As DataSource For Cell) For Every Cell
How to set Height and ItemSource(Business Object as DataSource for Cell) for every Cell in DataGrid/ Grid? Shown below is part of code I am currently using with Grid Control. What I am currently doing is that I am using ListBoxItem, set Item Height and ItemSource at ListBoxItem Level, Add ListBoxitem to ListBox and then Add ListBox to Grid, It leaves me with just one row and multiple columns in the Grid, which is perhaps not the best way of doing it as it doesn't allow me to take benefits from UI Virtualization of Grid.


I am open to use any control i.e. Grid/ DataGrid provided it allows me to set Cell Height and item source at Cell level. In my requirement, Cell height depends on the Item duration and size of image, which means the height of the cells may not be same across cells in any particular row.

Posted: Mar 24, 2010 09:25 AM

View 3 Replies!   View Related
Forms Data Controls :: How To Cell Editing Clicking In A Particular Cell
I have been trying to edit just a cell on row of the grid, but i didnt know how do implant it.

There is a telerik grid on page where this grid has 4 columns. The type of coluns are the following:
textbox, textbox, textbox and combobox.

the first textbox its type is numeric, the second is a date and third is character.

I show how the grid will be:

price    |    date             |   name    |   city
$1.89      9/10/2009          James      New york

the combobox city there is a list of cities where It gets in database

When the page shows, the grid shows too with all the registers with it.

when the user clicks in some cell the cell show a field for example a textbox for user types there.

There must be validation in all fields. Numeric field must just permit numeric characters, date field only date...

I need to implement it on code behind. Is it possible?

Posted: Sep 30, 2009 12:36 PM

View 6 Replies!   View Related
C# - How To Fill Gridview Cell-by-cell Only With Available Amount Of Images
I want to populate GridView below with images:

<asp:GridView ID="GrdDynamic" runat="server" AutoGenerateColumns="False">

The code below iterates through directory, then I collect image titles and want them to be populated in gridview. code in bold is not working well, gridview is only filled with the last image in list.

how to fill gridview cell-by-cell only with available amount of images?

Posted: Mar 8 10 at 20:51

View 1 Replies!   View Related
MVC :: Concatenate SQL Results?
I am working on an application that requires a lot of data sets being sent to the client when application starts. To avoid multiple trips to the server I want to combine all the data together and send it as one piece. I cannot build one single SQL statement, it's going to be many. Should I just put SQL results together like strings?

Posted: Mar 23, 2011 07:07 PM

View 14 Replies!   View Related
Concatenate String And Use As Variable Name?
What I'm doing is I'm sending a parameter with the URL like show.aspx?d=1 and on another page receive it with response.querystring("d"). Then I have a bunch of strings j1, j2, j3... I'm trying to concatenate the number with the letter "j" like response.write("j" & d) to write the string but it's never that easy, is it? I also tried to first put it in another variable like showd = "j" & d then response.write(showD) but to the same effect...

Actually I'm trying to make something like a christmas calendar, where it would show a different joke every day...So how do I fix this?

Posted: Nov 18, 2008 01:12 PM

View 14 Replies!   View Related
Concatenate Two Strings With Delimiter
want to concatenate two strings with delimiter '-' ,the problem is if the second string is null also ,'-' displays.(eg)

string1 ="test"
result = test-
expected result = test

Posted: Apr 01, 2009 03:53 AM

View 8 Replies!   View Related
SQL Server :: How To Concatenate The Row Values
I want to concatenate the row values in field.I am having 123 rows in one column.So i have to insert those 123 row values into 123 column values.

For that I used cursor now i m getting the result like this


So i want this values in one row so that i can write that in insert query to insert those values in other table as multiple column values.

Posted: Jul 30, 2010 12:02 PM

View 1 Replies!   View Related
Evaluate Expression To Add Not To Concatenate?
I am preparing string expression to use it to insert statement like

str="insert into franchise (xx,yyy,xxxxx) values (" + rblxx.SelectedIndex + 1 .............

when I do so it simply concats the thing like value of  rblxx.SelectedIndex "0" and 1 makes 01 and not 1.suggest some function and trick to add the numeric values not concat. I tried using System.Convert.ToInt32 but not worked for me.

Posted: Oct 10, 2010 05:30 AM

View 2 Replies!   View Related
ADO.NET :: Concatenate Linq To String?
Below is sample linqtosql, is there possible to concate linq in select statement.becuz i wan to return vary number of column



Posted: Sep 24, 2010 02:44 AM

View 3 Replies!   View Related
C# - Concatenate The Html Tag And Textbox.text
i need to concatenate the html tag like <br/> and to the textbox.text in textbox. i have used this txtMessage.Text + <br/> + strgetlist; but it is displaying TaskName<br/>Project1,project2.. how to give break and space between thest two.

Posted: Feb 12 10 at 10:57

View 4 Replies!   View Related
Concatenate Two Session Values In Web Application?
concatnate two session values. I need to concatnate 

Session["probmgremail"].ToString();and Session["TextBox2"].ToString();

The output should be a combination of two values seperated by a semicolon(;).

The session values are email address. 

Posted: May 10, 2010 06:53 PM

View 2 Replies!   View Related
DataSource Controls :: Concatenate TableName With Int?
I have the following code:


In this line, I wanted to assign the table to the datatable of dtCA1 and dtCA2.

Posted: Jun 07, 2010 07:29 AM

View 2 Replies!   View Related
Concatenate Two Columns In Subsonic Datasource?
Does anyone know how I can concatenate two columns in my subsonic datasource? I want to display a first and last name in this dropdownlist but I don't want to put them in the same SQL column.

Posted: Mar 20, 2010 04:07 AM

View 2 Replies!   View Related
Concatenate Data Fields As Binding Expression?
I am wondering if it is possible to concatenate two fields in custom binding expression in the formview templated field:

I tried this

Eva(("ContactFirstName")+ ", " + "(ContactLastName))

Posted: Oct 31, 2007 07:30 PM

View 4 Replies!   View Related
Web Forms :: Concatenate - QueryString With Special Character
In My Project I'm passing QuerySting Value as "A+B&C , Inc" its an whole value i'm not concatenating the value its an single value, in server side i'm failed to achieve this value as A+B&C , Inc

Posted: Oct 29, 2009 12:35 PM

View 9 Replies!   View Related
Localization :: Concatenate Resources In Inline Script
Is there a way to concatenate resources in inline script.  For example I have the following [Code]....

Posted: Apr 01, 2010 06:42 PM

View 2 Replies!   View Related
C# - Concatenate Two Nodes When Using The HTML Agility Pack In App's?
I am using the agility pack to do some screens scraping and my code so far to get titles is:

foreach (HtmlNode title in root.SelectNodes("//html//body//div//div//div[3]//div//div//div//div[3]//ul//li[1]//h4"))
string titleString = "<div class="show">" + title.InnerText + "</div>";

Before the title I want a timestamp related to the title and it has the node /html/body/div/div/div[3]/div/div/div/div[3]/ul/li[1]/ul/li/span. How can I get this value next to the title? So something like: string titleString = "<div class="show">" + time.InnerText + " - " + title.InnerText + "</div>";

Posted: Oct 29 10 at 13:10

View 1 Replies!   View Related
Web Forms :: How To Concatenate Two Fields For A Drop Down List
I have a stored procedure named spGetCustomerByCustID that returns all of the fields for a customer whose CustID matches the parameter.  I'm using this to populate a drop down with the last names of the customers.

I want the drop down list to be populated with a concatenation of the LastName and the FirstName in that order with a comma and space separating them. So it would be like "Smith, John".  It should be easy since my procedure is returning both values.  I don't understand how to do this though.  I'm not sure if it should be done with the DataTextField or the SelectedValue.

this is the ddl now:


Posted: May 12, 2010 02:10 PM

View 4 Replies!   View Related
Databases :: Concatenate Fields In Sql Parametrized Query?
I need to concatenate two fields(Firstname,Lastname) in my sql parameterized. I want a scenario where a single text acts a placeholder for both the firstname and lastname.

Currently this is what I have


Posted: Jun 30, 2009 05:04 PM

View 4 Replies!   View Related
C# - Concatenate Different Values From A Specific Column To A Same Line
I Have a DataTable with a lot of Rows and Columns.

Some of these Rows have the Same "OrderId", actually these rows are almost the same, but I have a specific value in the "TagList" Column that I have to put in the previous row.

Making a unique Row with all the TagList values inside the TagList Column.

I'll give a example below:

Line 1:
ID: 1
Name: John
OrderId: 1500
TagList: AG75

ID: 2
Name: John
OrderId: 1500
TagList: BG99

I wanna do it:
ID: 1
Name: Mark
OrderId: 1500
TagList: AG75, BG99

ie: Concatenate the TagList's values when they have the same OrderId.

Posted: Jan 18 at 17:47

View 1 Replies!   View Related - Listview Concatenate Data Items In Code Behind?
I have a listview with some data bound to it.

In this data are column for an address.

How would I go about accessing these data items in code behind so I can concatenate them into one easy variable and miss out columns that have no data in, i have fields:


I don't have a problem with the concatenation just accessing the data items.

I am getting data out via a dataset and binding it to a listview.

Is it possible to access data items in the code behind to format or do whatever i want with them then showing it in the list view such as, concatenating the address fields into one variable?

so instead of writing:

DataBinder.Eval(Container.DataItem, "address") & ", " & DataBinder.Eval(Container.DataItem, "address1") & ", " & DataBinder.Eval(Container.DataItem, "town") etc...

in the actual list view i could do this in the code behind in a string variable then show the variable in the list view?

'select command
Dim cmdSchedule As SqlCommand = New SqlCommand()
cmdSchedule.Connection = keypadSQL
cmdSchedule.CommandText = "spSchedule".....

Posted: Feb 10 at 11:27

View 1 Replies!   View Related
ADO.NET :: Concatenate Two Columns (text And Date) In A Dropdownlist?
I am trying to concatenate two columns (text and date) in a dropdownlist. In sql query: SelectCommand="SELECT [name] + ' , ' + [date] AS abc FROM [table] ">It gives this error: The data types nvarchar(max) and date are incompatible in the add operator.

Posted: Nov 29, 2010 02:18 PM

View 2 Replies!   View Related
Copyright © 2005-08, All rights reserved