Click here to Skip to main content
16,013,207 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting data from a database by using stored procedure: (supplied by client, so I cant do much with it)

C#
public void BindScheduleReport()
   {
       DataTable dtScheduleReport = new DataTable();
       dtScheduleReport = objSettingsBAL.GetSchedulereport();
       GVScheduleReport.DataSource = dtScheduleReport;
       GVScheduleReport.DataBind();

   }



1	Medicine <br/> Medicine	Bayrocin <br/> LIvol PFS	10ml/100 chicks <br/> 1ml/1000chicks


--------------
---------------
--------------
--------------
I don't want to print the BR/ tags on the screen. I want them to behave as actual breaks.
Posted
Updated 27-Mar-12 21:25pm
v8

Try this:
C#
string s = "1   Medicine <br/> Medicine Bayrocin <br/> LIvol PFS    10ml/100 chicks <br/> 1ml/1000chicks";
string s2 = s.Replace("<br/>", Environment.NewLine);
 
Share this answer
 
Comments
Member 8609405 28-Mar-12 1:52am    
Hi, griff i am using stored procedure. how to convert a datatable into string is it possible
lets say ur string is in a variable str

i.e.

C#
str = "1 Medicine <br /> Medicine Bayrocin <br /> LIvol PFS 10ml/100 chicks <br /> 1ml/1000chicks"


then use HTML decode as

C#
lblMessage.Text = Server.HtmlDecode(str);


and it will do what you want.
 
Share this answer
 

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