Wednesday, March 7, 2012

how to store Linefeeds to a database and retrieve them

hello all,

I have a multi line textbox and want to store the content of the textbox to a database. I want to preserve the linefeeds so that I display the message as it is typed by retrieving it. Can anyone please explain how to store the linefeeds to the database. Once i store the linefeeds to the database, I can restore them using the Replace("\n","<br/>) method. But I can't figure out how to store the \n 's in the database in the first place.

Thanx in advance

look into Environment.NewLine.

|||

The Environment.Newline is for VB.net

But in C#, \n is automatically stored in the database and I jus need to replace it with <br /> using replace method.

Thanx for the reply

No comments:

Post a Comment