Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a table that contain column such as

HouseNo
Street Area City
#23 C Block Malleshwaram Bangalore
#34 M.palya Electronic City Delhi


Now I want to display such as

Address

#23, C Block
Malleshwaram
Bangalore


#34,M.palya
Electronic City
Delhi

Please help me in which way i can do this?
Posted
Updated 1-Aug-12 23:34pm
v2
Comments
pradiprenushe 2-Aug-12 5:33am    
Use some data control like datalist , gridview or listview. Google for these control. About query it is just normal selection query.

Write the following in your stored procedure or SQL query. Try and see if it helps:
SQL
LTRIM(RTRIM(c.HouseNo)) + ', ' + LTRIM(RTRIM(c.Street)) 
+ ' ' + LTRIM(RTRIM(c.Area)) + ' ' + LTRIM(RTRIM(c.City)) 
as Address
 
Share this answer
 
Try writing your query as shown below

SQL
SELECT HouseNo + ', ' + Street
+ CHAR(13) + CHAR(10) --new line feed char
+ Area
+ CHAR(13) + CHAR(10)
+ City AS [Address] FROM [YourTableName]


You can use where clause to only retrieve the required address.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900