|
Subject:
|
Saving/Retrieving Image file to Database
|
|
Posted By:
|
davekrunal46
|
Post Date:
|
12/13/2005 7:09:08 AM
|
If we want to save/retrieve an image file (*.bmp, *.ico etc..) in database then by converting image file into binary we can save to database with the help of "AppendChunk" and "GetChunk" Methods.. (will get basic idea from 'msdn.microsoft.com' use keywords:"GetChunk, ApplendChunk')
Is there any other short and efficient method ??
~ ~ ~ There is no Right, There is no Wrong, KNOWLEDGE is Only the POWER ~ ~ ~
|
|
Reply By:
|
haianoop
|
Reply Date:
|
12/28/2005 3:34:58 PM
|
You can EASILY do it using a RDO data control Place a picture box and bind it to the RDO data control. Use the same methord as you do to save text data to database. ADO data control allows you to retrive pictures, but you cant save pic data to dayabase
|
|
Reply By:
|
davekrunal46
|
Reply Date:
|
1/9/2006 12:54:32 AM
|
To haianoop,
As you said, We cannot save images to database, its wrong, we can, by using AppendChunk & GetChunk methods you can first convert images to binary data then save it to database. And also by using 'Stream' class you can easily store images into database..
~ ~ ~ There is no Right, There is no Wrong, KNOWLEDGE is Only the POWER ~ ~ ~
|
|
Reply By:
|
haianoop
|
Reply Date:
|
1/9/2006 3:57:55 PM
|
Yes ofcourse you can SAVE Pictures using AppendChunk & GetChunk methods. But i suggested you an easier methord (Not Really Professional) of doing this using a Picturebox bound to a RDO data control.
|
|
Reply By:
|
davekrunal46
|
Reply Date:
|
1/10/2006 8:02:45 AM
|
I agree with you my friend, mine method was professional, Anyway need your intoduction because we are an indian. My name is Krunal from ahmedabad.
~ ~ ~ There is no Right, There is no Wrong, KNOWLEDGE is Only the POWER ~ ~ ~
|
|
Reply By:
|
haianoop
|
Reply Date:
|
1/10/2006 1:17:14 PM
|
The methord i suggested have some benifits over your method. In your method to retrive and show it in a picture box you will be doing these things 1, Read data from database and writes to a temperary file 2, Loads the file to the picture box 3, Deletes the temp file these process takes much time than my method This time difference will be significant when you need to load THUMB images of a 1000 image files to a grid for enabling SEARCH facilites in your Software
|
|
Reply By:
|
davekrunal46
|
Reply Date:
|
1/11/2006 3:41:30 AM
|
Give me an example of code or your method, it sounds interesting & time saving
~ ~ ~ There is no Right, There is no Wrong, KNOWLEDGE is Only the POWER ~ ~ ~
|