I have a record that is causing a problem during MySQL insert that is caused by a é in the string.
string sql_log = "INSERT INTO _logs_sql (sql_expr, sql_date, sessionID, adminUsername, the_id) VALUES (@sql_expr, @sql_date, @sessionID, @adminUsername, @the_id)";
myCommand.CommandText = sql_log;
myCommand.Parameters.AddWithValue("@sql_expr", _sql.Replace("'", "''"));
myCommand.Parameters.AddWithValue("@sql_date", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
myCommand.Parameters.AddWithValue("@the_id", tmp_theID);
myCommand.Parameters.AddWithValue("@sessionID", tmpSessionID);
myCommand.Parameters.AddWithValue("@adminUsername", tmp_username);
Should this value be valid in an MySQL table? If so, how would I remedy the issue?
An exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.DLL but was not handled in u ...
Go to the complete details ...