Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sql error - missing a (;) at the end of sql statement
- INSERT INTO photoDB(fileNames)
- VALUES('" + Path.GetFileName(fileName) + "')
- ON DUPLICATE KEY UPDATE fileNames = 1
- SqlConnection conn = new SqlConnection("ConnectionString");
- SqlCommand command = new SqlCommand();
- command.Connection = conn;
- command.CommandText = "INSERT INTO photoDB (fileNames) VALUES(@fileName) ON DUPLICATE KEY UPDATE fileNames = 1;";
- command.Parameters.Add(new SqlParameter("@filename", System.Data.SqlDbType.VarChar).Value = Path.GetFileName(fileName));
- command.ExecuteNonQuery();
Add Comment
Please, Sign In to add comment