Converting html data written as a Image (In Sql Server) back to html ?

K

KK

Hi,

I need to save certain content to SQL server and then
use SQL Server indexing facility to search. SQL Server
have recomended using Image data type with a filter
type (for .htm, .doc etc..)

Now, because of this I save normal html content also
in binary format in the Image field.

When reading, i read the data to a byte array. Now
I want to convert this to a string and save or display.

How do I do that? What is the class I should use to
convert the byte array to a string?


rgds
KK
 
D

DalePres

I am curious why you used a blob rather than a varbinary type? varbinary
will handle up to 8000 characters of HTML. That's a lot of HTML.

In either case, the Encoding.GetString() method will convert a byte array to
a string.

HTH

DalePres
MCAD, MCDBA, MCSE
 

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