String Builder Class in asp.net
Posted
by Indranil Mutsuddy
on Stack Overflow
See other posts from Stack Overflow
or by Indranil Mutsuddy
Published on 2010-04-28T10:01:23Z
Indexed on
2010/04/28
10:03 UTC
Read the original article
Hit count: 471
Hiya,
Suppose I want to display text retrieved from data base and I want to display the text applying color, font style etc.
Is that possible?..Below is a sample code which i 've done recently. SqlDataReader myreader; myreader = cmmd.ExecuteReader();
StringBuilder sb = new StringBuilder();
sb.Append("<b>Vaccine</b> <b> Vaccination Date</b> <b> Vaccination Due Date</b> <b> Incomplete Vaccination </b> <b>Dose No.</b> <b> Remarks </b><br/><br/>");
while (myreader.Read())
{
sb.Append(myreader["VaccineID"]);
sb.Append(" ");
sb.Append(myreader["DateOFVaccine"]);
sb.Append(" ");
sb.Append(myreader["NextVaccinationDueDate"]);
sb.Append(" ");
sb.Append(myreader["AnyIncompleteImmunization"]);
sb.Append(" ");
sb.Append(myreader["DoseNumber"]);
sb.Append(" ");
sb.Append(myreader["Remark1"]);
sb.Append("<br/>");
}
lblDisplayDetails.Text = sb.ToString();
myreader.Close();
Thank You
© Stack Overflow or respective owner