Convert blob field or byte data to read in text box

D

Devhead

i have a blob field in an sql server column field that stores html text. how
do i convert it so that it is readable in a text control. right now when i
convert using:

byte [] byteBlob = (byte[]) TMSFinding.Rows[0]["DetailedDescription"];

System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();

txtbxDetailedDescription.Text = enc.GetString(byteBlob);

right now it returns the text with the html tag info(<HTML>, <DIV>, etc.)
 
N

Nicholas Paldino [.NET/C# MVP]

Devhead,

Well, technically, the text is readable. However, you aren't going to
be able to display it in a textbox, because all of the markup is going to
get in the way. You should probably use the web browser control (which you
can add through the ActiveX tab when you add new items to the toolbox) and
then feed the string into that, and it should display correctly.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top