Click here to Skip to main content
15,915,093 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a task that if am entering the address in the textbox like anna nagar it should display 'an' instead of anna nagar or street it should display 'st' kindly suggest me with some code
Posted

You can use substring method to extract the first two elements of a string returned from database in code behind. Check this out:
substring[^]
 
Share this answer
 
v2
 
Share this answer
 
Try this query. This will only select first 2 characters from left.

Select Left( LOCATION ,2)as 'TruncatLocation' from table_name
 
Share this answer
 
v2

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