用户在sqlserver中保存的多行texbox中的格式化不显示格式化 - 在其他页面的多行文本框中获取时的线条中断 [英] User given Formating in Multi line texbox saved in sqlserver not showing formating like --Line Break when fetched in a multiline textbox of Other Page

查看:105
本文介绍了用户在sqlserver中保存的多行texbox中的格式化不显示格式化 - 在其他页面的多行文本框中获取时的线条中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多行文本框,如电子邮件正文我在用户给定的格式中保存用户输入 IN USER GIVEN FORMATTING ,但当我在另一页中获取此信息时,具有相同的多行文本框,然后所有信息都有格式化 - 作为换行符。



删除喊叫[/编辑]

i have a multiline textbox like as a Email body i save the user input IN USER GIVEN FORMATTING in user given formatting, but when i fetch it this information in another page , having same multi line textbox ,then all the information having formatting --- as line break.

Removed shouting[/Edit]

推荐答案

如果你想保存换行符sql server,你需要转换如下代码

当你找到像Environment.NewLine或\ n \\\ rr这样的新行字符时,你需要替换该代码。您从enterprize manager运行它的tsql代码并查看输出。

If you want to save line break in sql server, you need to transform code like as follows
When you found new line charecter like Environment.NewLine or "\n\r" then you need to replace that code. tsql code you run it from enterprize manager and see the output.
'This is line 1.' + CHAR(13)+CHAR(10) + 'This is line 2.'





c#需要在应用程序中实现的代码



c# code that you need to implement from your application

string data = "Good Morning\r\nI am fine";
string newData = data.Replace("\r\n","CHAR(13)+CHAR(10)");
and that newData will be store/read to sql server.


这篇关于用户在sqlserver中保存的多行texbox中的格式化不显示格式化 - 在其他页面的多行文本框中获取时的线条中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆