November 30th, 2009

You are currently browsing the articles from Information City written on November 30th, 2009.

Saving image to MSSQL image field

Been trying to save an image to the MSSQL database’s image field and found out that there are two different file size utilized when saving it from:

1. Loaded image to Picturebox and saving the picturebox’s image back to database by converting it to memory, back to byte. (1440054 byte)
2. Saving the image directly from file using filestream to read the file, loading it into memory then convert it to byte. (105543 byte)
3. Loaded image to Picturebox and saving the picturebox’s image back file and from file using filestream to read the file, loading it into memory then convert it to byte. (106655 byte)

Original file size: 103kb

Comparing all the three, method number 2 seemed to be the right choice but I am shocked to know the size being utilized when trying method #1.

Written by admin on November 30th, 2009 with no comments.
Read more articles on Knowledge Base and Personal and Programming.