Solved

concatenate to db fields in to one datagrid column

Posted on 2006-11-29
5
202 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
  • 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now