I’m using the following to read out values from my database:
while (reader.Read())
{
newsLabel.Text += "<div style='float:left;'>" + reader["body"] + "</div>";
}
I was wondering. How do I reduce the value of “body” to just 0,20 characters?
Is there a Substring function I can use?
Many thanks
You can do that as shown below. Make sure to check for DbNull.