Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

concatenate to db fields in to one datagrid column

Posted on 2006-11-29
5
Medium Priority
?
207 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 2000 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

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.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

916 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