Friday, March 30, 2012

problem with line break from NVARCHAR field

I have data saved in nvarchar field in SQL Server and I am displaying it using <= dbReader["my_field"] but even the three or four paragraphs comes as one paragragh and I don't know know where are my line breaks going?

In SQL Server if you want line breaks and well formatted text you must save your text as word in an image column so you can just get the word file back. There could be other ways but this is easy so I use it you could get other answers. Hope this helps.

|||

but this will kill the database size!!

in ASP 3.0 I was doing the following so what is the simillar command in .NET?

<%= Replace(rs("full_story"), vbCrlf, "<br>") %>

|||You were using that against Access or SQL Server?|||SQL Server|||

I found three solutions all long but may do what you want but not with one line of code. Hope this helps.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2003_ta/html/odc_VSTWrdSql.asp

http://codebetter.com/blogs/john.papa/archive/2005/08/09/130476.aspx

http://www.informit.com/guides/content.asp?g=sqlserver&seqNum=151&rl=1

sql

No comments:

Post a Comment