Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 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 January 1st, 2007, 03:19 AM
Registered User
 
Join Date: Jan 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Images to Database

I wish to have a piece of code that help me save pictures of employees of a company and see them some other time.
Database used is SQL Server 2000.

 
Old January 10th, 2007, 07:07 AM
Registered User
 
Join Date: Dec 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ahmad_diab85 Send a message via Yahoo to ahmad_diab85
Default

helllo...
1-u gonna but all picture u used in same folder.
2-u are going to save the path of the image .
3-then u will put image box and open the image depending on the path


ahmad diab,,,,,,

 
Old January 10th, 2007, 01:43 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Depends on what you want to do. Are you trying to store a Byte Representation of an image in SQL or are you just wanting to store the path of the image in the database?

The latter of the 2 is trivial since you would just be inserting a varchar value of [path/to/image]

The former requires that you load the image into memory from a users HD, convert that image into a Byte Stream and then pass that byte stream into SQL (Column Type image) Using GDI you will be able to reassamble and view the image when pulling it from a database.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old January 10th, 2007, 01:52 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Take a look at this article for an implementation of both ideas:

http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=414

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Load Images from and Save Images to a Database cyndie VB.NET 2 August 17th, 2008 06:42 AM
Images in database anujrathi ASP.NET 2.0 Professional 1 January 22nd, 2008 05:28 AM
Images in Database ldoodle Classic ASP Databases 0 April 24th, 2006 03:28 AM
Images in a database rayncarnation Access 1 October 15th, 2005 02:30 PM
images and database Lucian Ion Classic ASP Databases 0 July 1st, 2005 11:58 AM





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