PC Review


Reply
Thread Tools Rate Thread

Convert blob field or byte data to read in text box

 
 
Devhead
Guest
Posts: n/a
 
      23rd Mar 2005
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.)


 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      23rd Mar 2005
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.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Devhead" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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.)
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read image/blob field with option strict on Piedro Microsoft VB .NET 4 22nd Jul 2004 08:29 AM
how to convert BLOB DB field to readable format (text) Serge Klokov Microsoft C# .NET 4 25th Jun 2004 11:30 AM
How can I save a byte[] to a BLOB field? Luis Microsoft C# .NET 4 3rd Jan 2004 01:08 PM
Re: Convert Oracle BLOB to MS Access text TC Microsoft Access Macros 1 7th Oct 2003 07:28 PM
Convert Oracle BLOB to MS Access text Chris Microsoft Access VBA Modules 0 2nd Oct 2003 12:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:38 AM.