开发者

Newline in SQL Server

开发者 https://www.devze.com 2023-01-14 19:59 出处:网络
Can anybody tell me how to sa开发者_C百科ve newline in database and also retrieve it in a same manner using asp.net.SQL Server does no processing at all to data sent in. If you send this

Can anybody tell me how to sa开发者_C百科ve newline in database and also retrieve it in a same manner using asp.net.


SQL Server does no processing at all to data sent in. If you send this

aaa
bbb

ccc

Then this is exactly what is stored, complete with characters 13 and 10

If you are having problems, then it's likely chars 13 and 10 do not get into SQL Server or the page is removing them because they are suppressed whitespace in HTML.

To summarise, the problem is almost certain not to be with SQL Server


You can use System.Environment.NewLine in .Net to save the newline. If you simply press enter I think SQL saves it as \r\n.


you can try \r\n or \n


You want to use FormView to submit to a database?

http://sfvt.wordpress.com/2010/09/06/asp-net-tutorial-formview-insert-to-database/

0

精彩评论

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

关注公众号