well you can store images in database using some binary format or blob data type.
Or you can store the images in a directory and store the location of those images in a table in database.Both the techniques have their own pros and cons.
Images stored in a directory can be managed easily as updating or replacing the images are much simpler as it is just an file operation instead of massive update/insert/delete in database.
Images stored in the directory structure can be accessed from many different standard applications (FTP, web browser, etc) without writing application code.
Performance wise it is faster to store images in directory structure then pulling the images from database.
Your database size remains small.
But there can be some of the compelling reasons somebody wants to store the images in database.
One is, it makes your application more portable( although this can be proved otherwise in case you want to switch to some other DBMS and the blob datatypes differ).
Another reason is security. Images stored in database are considered more secure .
Yet another reason is the amount of data, if it is massive number of images, it might get a little difficult to manage them in file system (checking the duplicate files, naming them etc), so database can be considered an option.
Most DBs support Image or Binary datatype which you can use with images.
First you have to convert image to bytes. Here's a sample code in my blog:
Convert image to byte array and vice versa
and then store bytes to DB. This sample code uses SQL Server but the method can be used with any other DB:
Save binary data to SQL Server with VB.NET
Thanks for the links Teme64...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Hi. Im using vb 2010. I want to dynamically add textboxes to my form by clicking on a button. I've google searched and so far this code worked:
Private Sub btn_addline_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_addline.Click Dim txtB1 As New TextBox Dim i For i = ...