Click here to Skip to main content
15,901,205 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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....
Posted
Updated 10-Jul-13 20:49pm
v4

1 solution

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");
 
Share this answer
 
v2
Comments
ntitish 11-Jul-13 2:59am    
here problem is i am binding the data to text box through designing with data source .....
ntitish 11-Jul-13 3:08am    
for binding to the label if we want text in the second line means. we have to pass the <br/> in between the text and we can save in the database while retrieving the data from the database it automatically the text will come in second line because of <br/> like that there is no solution ha sir...
Dholakiya Ankit 11-Jul-13 3:09am    
then what's the issue try this <%#Eval("banner_url").toString().Replace("
", "\r\n") %>
ntitish 11-Jul-13 3:14am    
Sorry to ask this stupid question .....actually i had adought while saving only if i save like below means nsert into a values 'hai this is nitish' + '"\r\n"' + 'He is surya friend.'
ntitish 11-Jul-13 3:16am    
here below is my code sir.

string plan4 = row.ItemArray[2].ToString();
string POC = row.ItemArray[8].ToString();
string Text = plan4 + "< br/ >" + DateTime.Now.ToString() + POC;

SQLHelp datahelper1 = new SQLHelp();
string cmdText = "Update xCC_Diagnoses set Plan4='" + Text + "',currentplanofcare='' where DXID=" + Convert.ToInt32(row.ItemArray[6].ToString()) + "";
int j = datahelper1.Execute_datamodify_Proc(cmdText);


in place of < br / > what should i write sir.......

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900