开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜