Click here to Skip to main content
15,887,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Quote:
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 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();
}


What I have tried:

I have watched all the others forum but i didn't find nothink good for me or the solutions didn't solve nothink...
Posted
Comments
David Crow 2-May-18 14:02pm    
What exactly is your question? Does the code you've shown have something to do with the
TypeInitializationException being thrown? If so, how? Are you missing a try/catch block?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900