Your signatur to call "mysql_real_escape_string" is not correct!
[ DllImport( "libmySQL.dll", EntryPoint="mysql_real_escape_string" )]
unsafe public static extern ulong mysql_real_escape_string(void *mysql, System.Text.StringBuilder to, string from, ulong length);
-> ulong is a 64 bit value (.Net) but in C/C++ is ulong a 32 bit value.
uint is the correct value to works fine in:
"unsafe internal static string Escape(string str, MySQLConnection conn)"
#MySqlUtil.cs#
CPrototypes.mysql_real_escape_string(conn.Handle, to, str, (uint)bytes.Length);
#CPrototypes.cs#
[ DllImport( "libmySQL.dll", EntryPoint="mysql_real_escape_string" )]
unsafe public static extern ulong mysql_real_escape_string(void *mysql, System.Text.StringBuilder to, string from, uint length);
Very good project, nice
Thomas