Saving Database Image Blob RRS feed

  • Question

  • i have a SQL sevrer database with the Images stored as BLOBs in the database which makes the database very bulky and large. Since i know that its not a good approach to store the images in the database i am trying to retrievve the images and store them as image in one folder and just store the path to the image in the database so that i could improve performance of the application i am developing. also the size of the image is very big.

    i would be grateful if you could let me know :
    1. how to retrieve the images and save them on the PC
    2. how to resize the image ... it could be 5cm X 5 cm  (Currently its direclty store at 5Megapixel resolution, dont remember the size)

    a sample code would be highly appreciated.

    best regards

    Tuesday, June 19, 2007 5:35 AM

All replies

  • Hi there,

    for your first question look at my other thread:
    Here is a sample how to store and retrieve Images from a Database. I use an OleDB Connection, but I also got a sample with the SQLClient-Class if you need them

    Sorry, but I have to pass on your second question.

    Tuesday, June 19, 2007 5:59 AM
  • Hi Sonam Kesang,
      I am moving this thread from Visual Basic Express Edition forum to the .NET Framework Data Access and Storage forum, since the issue is related to image data access to SQL server. There are more experts in the .NET Framework Data Access and Storage forum.
    Thanks for your understanding!
    Thursday, June 21, 2007 6:39 AM
  • Here are some samples for the first question

    For the second one, you might be able to use classes from System.Drawing namespace of .NET Framework that allow manipulated with images


    Thursday, June 21, 2007 10:53 AM
  • Hi Lars,


    Please post the code. I am also playing around with SQLPutData without much success.


    Monday, June 25, 2007 7:31 AM