I need to store the full path of images into MySQL database from c# form and write the following code to achieve this:
string correctFileName3 = System.IO.Path.GetFileName(dialog.FileName);
string ApplicationPath = Application.StartupPath.Substring(0, Application.StartupPath.Length - 10);
ApplicationPath = ApplicationPath.Replace("\\", "\\\\");
string consultant_logo = ApplicationPath + "\\images\\" + correctFileName3;
I want to insert consultant_logo as a string in the database by this insert query:
String insertQuery = "Insert Into ubc.projectinfo(`projectName`, `companyName`, `projectNumber`,
`projAddress`, `nameOfConCompany`, `consultantPhone`, `nameOfEng1`, `nameOfEng2`, `nameOfEng3`,
`consultantAddress`, `phoneEng1`, `phoneEng2`, `phoneEng3`,`ubc_logo`, `company_logo`, `consultant_logo`)
VALUES ('" + projectNameText.Text + "','" + companyNameText.Text + "' ,'" + projectNumber.Text + "','"+
projAddress.Text+ "','"+ nameOfConCompany.Text+ "','"+consultantPhone.Text+"', '"+ nameOfEng1.Text + "',
'"+ nameOfEng2.Text+ "', '"+ nameOfEng3.Text+ "' , '"+consultantAddress.Text+"','"+ phoneEng1.Text+ "',
'"+ phoneEng2.Text + "','"+ phoneEng3.Text + "', '"+ubc_logo+"','"+company_logo+"',
'"+consultant_logo+"')";
but this error occurred "you have an error in your SQL syntax";