storing byte array (byte[] C#) in database

  • How to store byte[] values into database (single column) and How to convert back to byte[]?

  • I looked up reading and writing images to and from the database, because I think the concept would be similar. A nice explanation with some C# code is here:

    http://www.akadia.com/services/dotnet_read_write_blob.html

  • One more thing...this article uses the"image" data type. You should also research the binary and varbinary datatypes that I believe can be written and read in the same way. Someone correct me if I'm wrong.

    Hope this helps.

  • Yeah, use varbinary instead of image.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply