如何在绑定到文本框时获取下一行中的特定文本 [英] How to get the particular text in next line while binding to the textbox

查看:58
本文介绍了如何在绑定到文本框时获取下一行中的特定文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上我在一列中保存了两个不同的文本。将该列绑定到文本框时。我想分开两个文本,第二个文本应该在第二行。这应该在将数据仅保存到列中时发生。然后在检索列时,文本应该排在第二行。是否有可能。



示例: -

text1 = Hai这是一个很好的

text2 =他是surya朋友



以上两个文本我将保存在单列中。



从检索文本时文本框中的列文本应该如下所示



Hai这是次要的

他是surya朋友。



喜欢上面的文字我希望在文本框中看到文字。绑定时。



例如,如果我们绑定到label.simply,我们可以将文本保存在数据库中,如下所示



Text1 =Hai这是次要的+< br />+他是surya朋友



如果我们保存如上在数据库中意味着在绑定到标签时它将获取如下所示的数据



Hai这是次要的

他是surya朋友。< br $> b $ b



我要求人们至少说是否可能。所以我可以根据那个搜索....

Actually i am saving two different text in one column. while binding that column to the textbox. i want to separate the two text and the second text should come in second line. this should happen while saving the data into the column only.then while retrieving the column simply the text should come in second line. is it possible.

Example:-
text1=Hai this is nitish
text2=He is surya friend

above two text i will save in the single column.

while retrieving the text from the column in the textbox the text should be like below

Hai this is nitish
He is surya friend.

like the above text i want to see the text in textbox. while binding.

for example if we are binding to the label.simply we can save the text in database like below

Text1="Hai this is nitish"+" < br / > "+"He is surya friend"

if we save like above in database means while binding to the label it will take the data as shown below

Hai this is nitish
He is surya friend.


I request the people to say at least whether it is possible or not. so that i can search according to that....

推荐答案

我认为它很简单

你插入一列假设一个你的查询将是



插入一个值'hai这是nitish'+'
'+'他是surya的朋友。'



当你绑定到文本框时应该被
拆分并绑定到文本框



textBox.Text = textBox.Text .Replace(
,\\\\ n);
i think its simple
you are inserting in one column suppose a so your query will be

insert into a values 'hai this is nitish' + '
' + 'He is surya friend.'

and when you binding to textbox should be split by
and bind into textbox

textBox.Text = textBox.Text.Replace("
", "\r\n");


这篇关于如何在绑定到文本框时获取下一行中的特定文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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