使用换行符将Multiline Textbox中的值保存到SQL Server中 [英] Save the value from Multiline Textbox into SQL Server with line break

查看:199
本文介绍了使用换行符将Multiline Textbox中的值保存到SQL Server中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多行文本框调用txtDesc。用户可以键入多行值,例如:

................................ ..

海。

我是机器人。

请喂我。

..... ................................

I got one multiline textbox call txtDesc. The user can key in multiline value such as :
..................................
Hai.
I'm robot.
Please feed me.
..................................

I want to save into database with the line break and will display it back later as user key in.(entered)

if i save the value as below code, the line break will not save.



===

可以表是地址1

和字段是

...

add_id bigint

my_address text

===

如何实现这一目标?



谢谢。


===
may table is "address1"
and field is
...
add_id bigint
my_address text
===
how to make this happen?

Thank you.

推荐答案

http://stackoverflow.com/questions/4883613/asp-net-text-with-linebreak-from-multi-line-文本框保存在数据库中 [ ^ ]

http://stackoverflow.com/questions/20536431/save-the-value-from-multiline -textbox-into-sql-server-with-line-brea [ ^ ]


计算换行后字符串的每个长度,保存带有长度的数据,当你想稍后显示时从数据库中获取长度,以便你知道在哪里显示换行符
count each length of a string after line break, save the data with length, when you want to display later get the length from database so that you know where to display line break


这篇关于使用换行符将Multiline Textbox中的值保存到SQL Server中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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