0

I want to create database and store their images. I want to know which method is the best. Saving the path of each of the images into the table or something else? What is the correct datatype for that? After that I will retrieve the image from web application. I use ASP.NET

Quango
  • 12,338
  • 6
  • 48
  • 83
nick
  • 21
  • 3
  • Possible duplicate of [store image in database or in a system file?](http://stackoverflow.com/questions/766048/store-image-in-database-or-in-a-system-file) –  Feb 18 '16 at 14:03

1 Answers1

0

you can use image datatype for storing larger image sizes , For smaller images (below 256K in size) you can use varbinary datatype in sql. You have to convert the Image file either in to bytes Array or Image Stream before saving it to the Database.

praveen
  • 1,355
  • 1
  • 9
  • 10
  • if i save the path of image in a string , is it wrong?if i use varbinary what mean that?i still have to store the image into a folder? – nick Feb 18 '16 at 14:20
  • if you are storing images in a seperate folder with the same path as permanent means you can store the path in database with text datatype itself – praveen Feb 18 '16 at 14:24
  • i don't store images somewhere i just want to manage the images wherever they are. i want to display the images. in my table (in db) and the column name picture what is the best datatype? – nick Feb 18 '16 at 14:38
  • which database are you using ? – praveen Feb 18 '16 at 14:41