Solved

concatenate to db fields in to one datagrid column

Posted on 2006-11-29
5
198 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
Comment Utility
0
 

Author Comment

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

Expert Comment

by:Dimandja
Comment Utility
Can you show some code?
0
 

Author Comment

by:prowebinteractive
Comment Utility
       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
Comment Utility
You have a typo.  Your concatenation should read (notice the comma between the apostrophies):


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

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

771 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

11 Experts available now in Live!

Get 1:1 Help Now