Saving the FolderBrowserDialog Selected Path or escape character to MySQL Database, using C#

Home / Asp.net / Saving the FolderBrowserDialog Selected Path or escape character to MySQL Database, using C#

Example: Here is my selected path from browserdialog

C:\Users\Project\XXXX

After saving it to database, the path goes like this

C:UsersProjectXXXX


Solution: 

You need to escape \ by using \\ instead.
String Path =Path.Replace("\\","\\\\");
 

edgedoll.com

Comments(0)

Leave a Comment