Reputation: 1360
I'm having a problem in saving photo path on the table column. When I click "Saved" on my code, I see that the column table(varchar) remove the back slash. That's a problem for me whenever I want to view the picture from my column photopath.
This is my save filepath that will send on the table when I click save.
saveFileDialog1.InitialDirectory = @"C:\MyPath\image-path\";
After I click saved, I see a wrong result on the column table(varchar)
C:MyPathimage-path
The saved path removed the Backslash. Any help Please
Upvotes: 2
Views: 2383
Reputation: 191
You need to replace slash("\") with double slashes.
Try saveFileDialog1.InitialDirectory = @"C:\\MyPath\\image-path\\";
If not working, Try
string path1 = @"C:\MyPath\image-path\";
string path2 = path1.Replace(@"\", @"\\");
saveFileDialog1.InitialDirectory = path2;
Upvotes: 1