CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Save Photo

  1. #1
    Join Date
    Feb 2001
    Posts
    33

    Save Photo

    I'm now writing a programe for the administrative staff to enter all staff members personal information through serval local terminals and the information will be stored in the remote SQL Server. My programme also needs to handle photos of the staff members

    I have the following questions to ask :
    1) Where should I store the photo ?
    I've thought about storing those photos in each local computer. Whenever the
    admin. staff needs to input staff members information, he only needs to press
    a button(links with common dialog box) which will displays the
    directory/file screen for the staff to choose the corresponding filename of
    the photo. But I think it is impossible to store all photos in each local
    computer.

    2) How can I store the photos in the SQL Server? Use what kinds of methods ?

    3) How can I retrieve the images from the remote SQL Server?

    I hope my questions won't be too long !!!
    If you know how to do, please teach me.
    Thank you!!!




  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Save Photo

    SQL server has a datatype Image. This can be used to store any type of data, but is expecially used to store binary data (including pictures).
    To add data to the image field, you must open the file for binary input, read a part of it, and add it to the field using the appendchunk method of the recordset object.
    To retrieve data, you can use the getchunk method of the recordset.

    Tom Cannaerts
    [email protected]

    The best way to escape a problem, is to solve it.
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured