Hi,
I am working with c#.net. In my application i want to give facility to
user to add image. I use open dialog box to select image, it will work
properly i.e on button click open dialog is open select any image and
display in picture box.
So i want to store that selected image into specified folder and that path stored into database, for furhter retrivation.
Please guide me to overcome from that problem
Loading


Nir Bar107 reputationPosted Oct 1, 2009, 1:36 AM EDT
To copy a file:
System.IO.File.Copy( sourceFullFileName, targetFullFileName); // Both arguments are Strings
If you need to create a directory to place the files in:
System.IO.Directory.CreateDirectory( directoryName); // Will create all directories and subdirectories as required
Please mark this post as an answer if it helps you
Nir
Nir Bar107 reputationPosted Sep 30, 2009, 11:50 PM EDT
System.IO.File class can be used to copy files
System.IO.Directory can be used to create directory
Please mark this post as an answer if it helps you
Nir
Vikas AhlawatRank #2,648 · 525 reputationPosted Oct 1, 2009, 1:01 AM EDT
Roei BarRank #1,271 · 1.4K reputationPosted Oct 1, 2009, 2:02 AM EDT
always make sure that DirecTory.Exists is False before trying to create a new one
you can use this code for assistance:
http://www.redmondpie.com/inserting-in-and-retrieving-image-from-sql-server-database-using-c/
Nagesh R14 reputationPosted Oct 1, 2009, 2:15 AM EDT