Description:
I have tried the following code to connect to my database;
MySqlConnectionStringBuilder constb = new MySqlConnectionStringBuilder();
constb.Server = "db4free.net";
constb.Port = 3306;
constb.Database = "tsatmtest1";
constb.UserID = "tsauser1";
constb.Password = "Sami1234";
constb.CharacterSet = "utf8";
var consbst = constb.ToString();
MySqlConnection conn1 = new MySqlConnection(consbst);
if (conn1.State == ConnectionState.Open)
{
conn1.Close();
}
conn1.Open();
if (conn1.State == ConnectionState.Open)
{
FindViewById<TextView>(Resource.Id.sndctx12).Text = "Connected";
}
}
it returns "System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.Replication.ReplicationManager'"
I tried this on another mysql database and got the same error.
Please let me know what I shall do.
Regards
How to repeat:
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.Replication.ReplicationManager' threw an exception. occurred
Description: I have tried the following code to connect to my database; MySqlConnectionStringBuilder constb = new MySqlConnectionStringBuilder(); constb.Server = "db4free.net"; constb.Port = 3306; constb.Database = "tsatmtest1"; constb.UserID = "tsauser1"; constb.Password = "Sami1234"; constb.CharacterSet = "utf8"; var consbst = constb.ToString(); MySqlConnection conn1 = new MySqlConnection(consbst); if (conn1.State == ConnectionState.Open) { conn1.Close(); } conn1.Open(); if (conn1.State == ConnectionState.Open) { FindViewById<TextView>(Resource.Id.sndctx12).Text = "Connected"; } } it returns "System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.Replication.ReplicationManager'" I tried this on another mysql database and got the same error. Please let me know what I shall do. Regards How to repeat: Unhandled Exception: System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.Replication.ReplicationManager' threw an exception. occurred