Selecting part of text from sql database in asp.net
I have a nvarchar field in sql database .. for example I have 4000 character in this field but I want to select only 200 first character开发者_JS百科 and display in a label .
how can I do this ?
In the underlying query:
SELECT
LEFT(fld, 200)
FROM T ...
Select Left(YourColumn, 200) as 'First200'
From dbo.YourTable
Or
Select SubString(YourColumn, 1, 200) as 'First200'
From dbo.YourTable
Information on Left and Substring
精彩评论