BackslashEscapesMode Property (MySqlConnection)
Manages EscapeString. It can be set to Enabled, Disabled, or Auto.
Property Value
The default property in
Disabled specifies the use of EscapeString substitution. It can be set to one of three modes:
* Enable means that BACKSLASH_ESCAPES is allowed.
* Disable means that BACKSLASH_ESCAPES is not allowed.
* Auto means that you want to check whether the NO_BACKSLASH_ESCAPES mode is enabled or disabled in the SESSION.sql_mode of the database. Based on this, you can set the mode to either Enabled or Disabled.
Here is an example for C#:
MySqlConnection connection = new MySqlConnection(@"
User Id=...;
Password=...;
Host=...;
Port=...;
BackslashEscapesMode=Enable;
MySqlConnection connection = new MySqlConnection(@"
User Id=...;
Password=...;
Host=...;
Port=...;
");
connection.BackslashEscapesMode = BackslashEscapesMode.Enable;
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2