MySqlConnection critical error e0434352
Posted by: Joseph Cameron
Date: December 14, 2013 10:07PM

VS 2013, NET 4.5
MySQL Connector Net 6.7.4
UnmanagedExports.1.2.6 (RGiesecke nuget package)

C unmanaged accessing NET DLL.
calling conventions work with ms sql db.
just don't understand why I am having the trouble with MySQL.

Creating a new connection causes critical error e0434352.

return connectionString is correct if return before MySqlConnection.

[DllExport("connect",
CallingConvention = CallingConvention.StdCall)]
public static string connect([MarshalAs(UnmanagedType.LPStr)]string _url,
[MarshalAs(UnmanagedType.LPStr)]string _database,
[MarshalAs (UnmanagedType.LPStr)]string _login,
[MarshalAs(UnmanagedType.LPStr)]string _password)
{
MySqlConnection connection;
connectionString = "Server=127.0.0.1;Uid=root;Pwd=;";

// connectionString = "SERVER=" + _url + ";" + "DATABASE=" +
// _database + ";" + "UID=" + _login + ";" + "PASSWORD=" + _password + ";";

connection = new MySqlConnection(connectionString);
return ("after connection");

try
{
connection.Open();
return ("Ok");
} catch( Exception ex )
{
return (ex.ToString());
}
}

Options: ReplyQuote


Subject
Written By
Posted
MySqlConnection critical error e0434352
December 14, 2013 10:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.