Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET SQL-Server
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.

[Edit]Removed shouting[/Edit]
Posted 22-Feb-13 0:21am
sr_24484
Edited 22-Feb-13 7:03am
v5
Comments
_Amy at 22-Feb-13 5:23am
   
Don't shout. Typing the words/sentences in Capital letter is called shouting in internet.
subodhrastogi24 at 22-Feb-13 5:29am
   
Capitals words were to emphasize the important words ..whats d problem _Amy ???
richcb at 22-Feb-13 12:05pm
   
Only capitalize the first letter to signify importance and only if it is a proper noun or the beginning of a sentence.
OriginalGriff at 22-Feb-13 12:12pm
   
See here: http://en.wikipedia.org/wiki/Etiquette_(technology)

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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# 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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 340
1 OriginalGriff 210
2 DamithSL 170
3 Kornfeld Eliyahu Peter 130
4 Peter Leow 95
0 OriginalGriff 7,315
1 DamithSL 5,199
2 Sergey Alexandrovich Kryukov 4,917
3 Maciej Los 4,866
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100