Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
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
 
Old December 13th, 2005, 08:09 AM
Authorized User
 
Join Date: Nov 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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 ~ ~ ~
 
Old December 28th, 2005, 04:34 PM
Registered User
 
Join Date: Dec 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old January 9th, 2006, 01:54 AM
Authorized User
 
Join Date: Nov 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

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.


 
Old January 10th, 2006, 09:02 AM
Authorized User
 
Join Date: Nov 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

    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

 
Old January 11th, 2006, 04:41 AM
Authorized User
 
Join Date: Nov 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 ~ ~ ~





Similar Threads
Thread Thread Starter Forum Replies Last Post
Show/ Hide image while saving file. arnabghosh Javascript How-To 7 June 25th, 2007 11:49 PM
Retrieving and uploading image in Database vijay_83 ASP.NET 2.0 Basics 1 October 4th, 2006 03:25 PM
Retrieving image from sql and saving to disk otsthebus Classic ASP Basics 1 August 5th, 2006 01:51 AM
Retrieving img file from app server using database arun_sunmic Pro JSP 0 January 16th, 2006 06:24 AM
Saving Word file into Database melvik SQL Server 2000 4 November 28th, 2005 09:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.