acadia
acadia

Reputation: 2333

Create a jpeg file in c:\imagesFolder based on the Image stored in the database in vb.net

I have pictures of each employee stored in SQL database with Image database.

Select pic from empimages where emp_ID=10

give the picture of that employee in binary format.

How do I create a physical jpeg in C:\images folder based on the above query in vb.net.

Thanks

Upvotes: 1

Views: 501

Answers (2)

Jeremy Morgan
Jeremy Morgan

Reputation: 3372

Here is a good tutorial relating to this: Creating Binary Files using Visual Basic

You should be able to just take the data from the blob and write it to a file this way. Hope it helps.

Upvotes: 0

Konrad Rudolph
Konrad Rudolph

Reputation: 545628

In what format do you have the file? As a byte array? In that case, simply write

My.Computer.FileSystem.WriteAllBytes( _
    "C:\images\" & imagename & ".jpg", ImageData, False)

Upvotes: 1

Related Questions