How to read and insert files from Application directory in to Data base in C#
-
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.
-
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.
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 -
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.
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