Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

When I try to open the connection an error occurred and say:

System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.Replication.ReplicationManager' threw an exception.

This is the part of code:

MySqlConnection _Conn;

public void Conectar()
{
    new I18N.West.CP1250();

    string SC;

    SC = "server = XXX; Port = 3306; database = XXX; user id = XXX; password = XXX; charset = utf8";

    _Conn = new MySqlConnection(SC);

    _Conn.Open();
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
491 views
Welcome To Ask or Share your Answers For Others

1 Answer

If you problem ocorred with Xamarin, you should do:

1) Remove Reference Mysql Data

2) Add Reference Xamarin.Mysql

You can keep yours calls (using MySql.Data.MySqlClient;)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...