Example: Here is my selected path from browserdialog
C:\Users\PHWS13\Desktop
After saving it to database, the path goes like this
C:UsersPHWS13Desktop
My Datatype for the path field is VARCHAR(100)
Here is my SQL query
CREATE DEFINER=`xxxxxxxx`@`%` PROCEDURE `AddFolder`(folder_loc VARCHAR(100))
BEGIN
INSERT INTO `tbl_folder`(`folder_location`) VALUES(folder_loc);
How can I fix this?
C# code:
public void AddFolder(string f)
{
cn.Open();
cmd = new MySqlCommand("call AddFolder('" + f + "')", cn);
cmd.ExecuteNonQuery();
cn.Close();
}
You need to escape
\by using\\instead.Try this at the beginning of your AddFolder method: