I am using a multiselect file dialog to browse multiple pictures and add them to a datagridview then from there store them in the database.
Something was wrong in term of that I only managed to store the first selected picture (No syntax or runtime errors at all).
Upon inspection I've realized that the file dialog gets the full path of the first image only and uses it for the rest of images.
Sample code:
if (ofd_pic.ShowDialog() == DialogResult.OK)
{
foreach (String file in ofd_pic.FileNames)
{
MessageBox.Show(ofd_pic.FileName);
}
}
That messagebox will always show the path of the first image only and I wasn't able to get the path of every single selected image.
The properties of the file dialog are:
1.Modifiers: Private. 2. MultiSelect: True. 3. RestoreDirectory: True.
Any help?