Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I want to store images in sqlite db. Can someone suggest how to do it.

Regds
SNI
Posted
Updated 28-Dec-19 23:55pm
Comments
[no name] 12-Jul-13 8:18am    
I would suggest that you do some research. A simple google search for "store images in sqlite db" returns 27,200,000 results.

1 solution

An image is stored in most databases, include SQLite, as a so-called BLOB (binary large object). So create a table that has one column being of datatype BLOB. The other columns could things like image name, image data, etc.

For an example on how to fill and read a the table with a BLOB see this example here:http://stackoverflow.com/questions/625029/how-do-i-store-and-retrieve-a-blob-from-sqlite[^]

I would recommend reading one of the tutorials about SQLite first, in order to get a general overview on how SQL commands are formatted and sent to the database and how results are to be retrieved.
 
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