Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to read and insert files from Application directory in to Data base in C#

How to read and insert files from Application directory in to Data base in C#

Scheduled Pinned Locked Moved C#
csharpdatabasetutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    ChandrakanthGaddam
    wrote on last edited by
    #1

    Hi Good morning. My query is,i have Some application. In that application i have some one sub directory. In that directory i have 3 jpg files. i want to read those files from directoiry and i need to store the Image file name, Image bytes into data base. Once completion of reading files from the directory i need to delete those files.Can any one sunggest me how to approach that.

    D L 2 Replies Last reply
    0
    • C ChandrakanthGaddam

      Hi Good morning. My query is,i have Some application. In that application i have some one sub directory. In that directory i have 3 jpg files. i want to read those files from directoiry and i need to store the Image file name, Image bytes into data base. Once completion of reading files from the directory i need to delete those files.Can any one sunggest me how to approach that.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      I can tell you that this is a install-time problem, not run-time. The database should be populated with this information when the application is installed. If you're going to delete the image files, why are you even adding them to the app?? Just populate the database with the data at install-time. Why? Because a normal user cannot modify anything under Program Files. When someone launches an app, the app inherits the security token of the user (the app runs AS the user who launched it). Normal users do not have Write or Modify permissions to anything under Program Files.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      1 Reply Last reply
      0
      • C ChandrakanthGaddam

        Hi Good morning. My query is,i have Some application. In that application i have some one sub directory. In that directory i have 3 jpg files. i want to read those files from directoiry and i need to store the Image file name, Image bytes into data base. Once completion of reading files from the directory i need to delete those files.Can any one sunggest me how to approach that.

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Just write code for each of the steps you outlined. Storing byte arrays in a database is the topic of many articles. Come back here if you have a specific question. :)

        Luc Pattyn [My Articles] Nil Volentibus Arduum

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups