我正在尝试使用 MySql.data.dll 将我们框架的数据库层从 SQLServer 迁移到 MySQL。我在 MySQL 中有以下生成的查询:
select * from `user` where `user_domainname` = 'domain\beth';
MySQL 将上述字符串中的 '\b' 解释为响铃字符,而 SqlServer 不解释任何此类转义字符。MySQL中的解决方案 -
select * from `user` where `user_domainname` = 'domain\\beth';
要在 C# 中执行此操作,我必须用 \b 替换每个 \b 或其他此类字符,考虑到我最终会进行的此类转换的数量,这对我来说不是一个非常可行的选择。
So my question is- Is there any option in MySQL to avoid it interpreting such special characters at the database level. If not what is there any api I can use to perform such a transformation. I did check out the MySqlHelper class but could not find anything useful there.
Thanks in advance,
Bharath