Click here to Skip to main content
15,898,723 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can store Image in SQL Database with control Image Size?
I want to store image in database table within a fixed size (300KB). Now how can i reduce a Image size from 2500KB to 300KB?
Posted

You can use Image/CLOB datatypes to store your image files. However images are stored as bytes rather than image in the tables and you cannot provide size. If you are using "Byte" datatype for image field then you can set the size. You need to convert image to their corresponding bytes before you can save into the database. similarly when you select from the database, you have to convert in to the correct image format before you can display image in any controls.
 
Share this answer
 
v2
Hey you can store you image in a varbinary column in the db and pull the image directly out from there. Just set the values of the image before converting it to a byte array and then insert it. Then simply read the values back out. If you need a code sample I will gladly provide it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900