I am trying to save a image directory that a user opened into a database. But the symbol "\" is not in the path. It is turning out like C:UsersAshleyDesktopScreenshot_1.png and as you can see it has no \
, which make it an invalid path.
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog open = new OpenFileDialog();
if (open.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image = Image.FromFile(open.FileName);
pictureBox2.Image = Image.FromFile(open.FileName);
MySQL.ExecuteNonQuery(@"UPDATE users SET profile_image_dir = '" + open.FileName + "' WHERE username = '" + User.Details.Username + "'");
MessageBox.Show(""+ open.FileName + "\r\n");
}
On the MySQL.ExecuteNonQuery i am saving it to the database and it is turning out like as i showed before