Click here to Skip to main content
15,912,504 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi to All,
I have long text in my database table column.. i want to retrieve only 50 characters... how can i do this one.. please help me with sample code or links..


Thank you..
Posted

SQL
select Cast(column  as varchar(50))from table1
 
Share this answer
 
simple first retrieve complete string into a variable in .net.
The write the below code:

string stringVariable = "get the values from database here";
string stringValue = stringVariable.Substring(0,50) // this returns only 50 values.
stringValue haves the required 50 length.
 
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