 |
| VB How-To Ask your "How do I do this with VB?" questions in this forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

December 13th, 2005, 08:09 AM
|
|
Authorized User
|
|
Join Date: Nov 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Saving/Retrieving Image file to Database
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 ~ ~ ~
__________________
~ ~ ~ There is no Right, There is no Wrong, KNOWLEDGE is Only the POWER ~ ~ ~
|
|

December 28th, 2005, 04:34 PM
|
|
Registered User
|
|
Join Date: Dec 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

January 9th, 2006, 01:54 AM
|
|
Authorized User
|
|
Join Date: Nov 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 ~ ~ ~
|
|

January 9th, 2006, 04:57 PM
|
|
Registered User
|
|
Join Date: Dec 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

January 10th, 2006, 09:02 AM
|
|
Authorized User
|
|
Join Date: Nov 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 ~ ~ ~
|
|

January 10th, 2006, 02:17 PM
|
|
Registered User
|
|
Join Date: Dec 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

January 11th, 2006, 04:41 AM
|
|
Authorized User
|
|
Join Date: Nov 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 ~ ~ ~
|
|
 |