I don\'t know what may be wrong but that\'s what I get when I try to start the program:
The type initializer for MySql.Data.MySqlClient.Replication.ReplicationMana
I guess the problem is with your connection string
For instance your connection string should be like this
Server=myServerAddress; Database=myDataBase; Uid=myUsername; Pwd=myPassword;
To know more Click Here..!!!
Hope this helps
Happy Coding
It could be a bad reference to the DLL. Make sure the dll is the right verson for the .net you're using. I also had the same issue and found that in the app.config file i was defining log4net configurations for my logger and that was the issue. i had to define a different config file for log4net so that mysql would work.
Are you sure with that connection string?! Try to change it to:
conn.ConnectionString = "server=127.0.0.1;uid=root;pwd=test;database=snipper;"
Follow this reference:
http://dev.mysql.com/doc/refman/5.0/en/connector-net-programming-connecting-connection-string.html
Just found the problem... I hadn't enable "SQL Server Debugging". It worked well when I did. Thanks everyone!
I had the same error, but a different solution. First I tried the enable "SQL Server Debugging", but that didn't change anything (I still don't know why this setting would make a difference).
The solution for me was the user rights on the server. The application runs with the Task Scheduler under a user account. Only the domain of this user account was changed. So the MySQL Connection didn't have enough rights.