Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 13th, 2005, 08:09 AM
Authorized User
 
Join Date: Nov 2005
Location: , , India.
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 ~ ~ ~
Reply With Quote
  #2 (permalink)  
Old December 28th, 2005, 04:34 PM
Registered User
 
Join Date: Dec 2005
Location: Thrissur, Kerala, India.
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

Reply With Quote
  #3 (permalink)  
Old January 9th, 2006, 01:54 AM
Authorized User
 
Join Date: Nov 2005
Location: , , India.
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 ~ ~ ~
Reply With Quote
  #4 (permalink)  
Old January 9th, 2006, 04:57 PM
Registered User
 
Join Date: Dec 2005
Location: Thrissur, Kerala, India.
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.


Reply With Quote
  #5 (permalink)  
Old January 10th, 2006, 09:02 AM
Authorized User
 
Join Date: Nov 2005
Location: , , India.
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 ~ ~ ~
Reply With Quote
  #6 (permalink)  
Old January 10th, 2006, 02:17 PM
Registered User
 
Join Date: Dec 2005
Location: Thrissur, Kerala, India.
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

Reply With Quote
  #7 (permalink)  
Old January 11th, 2006, 04:41 AM
Authorized User
 
Join Date: Nov 2005
Location: , , India.
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 ~ ~ ~
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Show/ Hide image while saving file. arnabghosh Javascript How-To 7 June 26th, 2007 12:49 AM
Retrieving and uploading image in Database vijay_83 ASP.NET 2.0 Basics 1 October 4th, 2006 04:25 PM
Retrieving image from sql and saving to disk otsthebus Classic ASP Basics 1 August 5th, 2006 02: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



All times are GMT -4. The time now is 11:53 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.