问题描述
实际上我在sql数据库中保存文本时遇到一个问题。
示例: -
一个A人向B人发送消息下面在文本框中输入的文字
Hai
这是Ram
但是上面的文字正在保存在DataBase中,像Hai this is Ram,同时向B人展示它显示为Hai This is Ram。但我想要的是
Hai
这是Ram在数据库中它也应该像这样保存
是否有可能
Actually i am facing one problem while saving the text in sql database.
Example:-
One "A" person send a message to "B" person like below text entered in the textbox
"Hai
This is Ram"
But the above text is saving in DataBase like "Hai this is Ram" while displaying to "B" person it is showing like "Hai This is Ram". but what i want is
"Hai
This is Ram" in data base also it should save like this
Is it possible
推荐答案
txtMsgBody.InnerText.Replace("\r\n", "<br/>");
"<pre>" + TextValue + "</pre>";
思想代码项目可以实现,但显然有更好的代码:) :)
问候,
Praneet
Thought code project does it, though with a better and a good code obviously :) :)
Regards,
Praneet
这篇关于如何以给定格式将文本从文本框保存到SQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!