Results 1 to 10 of 10

Thread: inserting pictures into access database

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331

    inserting pictures into access database

    Hello

    I am creating a c# application that will use access database. The application is about a property agent that has details of houses for sale.

    My question is, how do you store the pictures in access, and how can you add and delete them from C# application

    A example program will be most gratefull.

    Many thanks in advance

    Steve
    steve

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    Here is a photo album (stores and retrieves images from a database) written in C#.

    C# Photo Album
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You may not want to store the image in the database directly. Instead, create a folder to save the images to, and then store that file path in the database. This will yield much better performance.

  4. #4
    Addicted Member MasterBlaster's Avatar
    Join Date
    Jul 2002
    Location
    Seattle
    Posts
    196
    Originally posted by hellswraith
    You may not want to store the image in the database directly. Instead, create a folder to save the images to, and then store that file path in the database. This will yield much better performance.
    What Hellswraith said, and If you only store the path in the database you can store the images on Network drives, cd's ect. Then your app will not limited by the size of the disk Access is on. Image databases like to eat up disk space.
    "And most of the evils of society can, in fact, be cured through information. We have a society that has been disinformed and based on the disinformation has made irrational choices. And that's what I mean by 'ignorance.' People, who ordinarily might be smart, are deprived of the data by which to make a rational decision, don't have the data to do it."
    Frank Zappa

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331
    thanks for your help.

    There is one more question.

    I am using a numericUpDown control to allow the users to insert numbers.

    But l am having trouble saving and retrieving them from the database.

    This is the code l am using so far

    Code:
    numNoBedrooms.value = m_dtHouses.Rows[m_rowPosition]["Bedrooms"].ToString();
    m_dtHouses - is the data table
    m_rowPosition - is the current record

    Thanks in advance

    Steve
    steve

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331
    Just one more question.

    I think storing the path in the database is the best way to do it. But in the database what data type do l set the field to.

    My pictures are in a folder called: c:\Houses\pictures.

    Thanks in advance

    Steve
    steve

  7. #7
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    On the other hand, if you store the images outside the database, you can't simply distribute one file with all the data, it's bound to be a group of files.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331
    Thanks for you help

    But is it possible to have some code examples

    Thanks


    Steve
    steve

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331
    Hello

    Still need help with this.
    steve

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I haven't done database handling in ages, so I don't have examples.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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