logicalunatic
Programmer
I'm working on a project where some (ntext) in a MSSQL database is to be displayed on the web. I've been able to successfully replace all CRLF (VB-vbCrLf or C#-"\r\n") with Breaks but I'm wondering if there is a better way to do it. In ASP 3.0 I would just use...
which is quite easy.
The way I've done it in .Net is...
Could I have done this easier? Perhaps in the repeater?
Thanks in Advance...
LogicaLunatic
Code:
Replace(x_string,vbCrLf,"<br />")
The way I've done it in .Net is...
Code:
//Replace1 the \r\n in t_comments with <br />
DataRow dr;
string x_comments;
for (int i=0 ; i < ds.Tables["t_reviews"].Rows.Count ; i++)
{
dr = ds.Tables["t_reviews"].Rows[i];
x_comments = dr["t_comments"].ToString();
dr["t_comments"] = x_comments.Replace("\r\n","<br />");
}
//End Replace1
Thanks in Advance...
LogicaLunatic