.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to get concatenate two column names value in a single one in mysql?

Posted By: Pratima B     Posted Date: March 23, 2010    Points:2   Category :ASP.Net
Hi,

I have 2 column first name and Last name I have to concatenate these 2 value into one while display in my asp.net web application.
For eg.

FirstName LastName
Amar M
Sunil Malhotra

Responses
Author: Syed Shakeer Hussain             
Posted Date: March 24, 2010     Points: 5   

Hi,
below is the code for concatenating 2 column names

SqlCommand cmd=new SqlCommand("select fname,lname from tablename where id="+txtid.Text+"",conn);
SqlDataReader dr=cmd.ExecuteReader();
if(dr.Read())
{
lable1.Text=dr["fname"].ToString()+dr["lname"].ToString();
}




Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend