Solved

concatenate to db fields in to one datagrid column

Posted on 2006-11-29
5
204 Views
Last Modified: 2010-04-23
I would like to append first name and last name that appear in 2 fields into 1 field in my datagrid

please help !
0
Comment
Question by:prowebinteractive
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 7

Expert Comment

by:Dimandja
ID: 18039341
0
 

Author Comment

by:prowebinteractive
ID: 18039511
I tried this doesnt seem to work.... im getting a "0" in the field
0
 
LVL 7

Expert Comment

by:Dimandja
ID: 18039601
Can you show some code?
0
 

Author Comment

by:prowebinteractive
ID: 18039616
       Dim SqlString As String = "SELECT a.accountNumber, SU.fname + ' ' + SU.lname AS repName, p.nom, p.prenom, p.telHome, d.dealerName, ST.statusName AS accountStatus FROM accounts AS a INNER JOIN profiles AS p ON a.accountNumber=p.accountNumber INNER JOIN dealers AS d ON a.dealerId=d.dealerId INNER JOIN sysusers AS SU ON d.repId=SU.sysUserId LEFT JOIN accountStatus AS ST ON a.accountStatus=ST.statusId WHERE p.profile_type=1 and (a.accountStatus != 1 AND a.accountStatus != 8) AND a.deleted='false' ORDER BY ST.priority"
        Dim da As MySql.Data.MySqlClient.MySqlDataAdapter = New MySql.Data.MySqlClient.MySqlDataAdapter(SqlString, conn)
0
 
LVL 7

Accepted Solution

by:
Dimandja earned 500 total points
ID: 18039968
You have a typo.  Your concatenation should read (notice the comma between the apostrophies):


SU.fname +  ',  ' + SU.lname AS repName
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question