My problem is that i keep getting an error like this:
The type initializer for 'myproject.GV' threw an exception."
GV there is my class. The code looks fine, no errors when running but after I call on the conn with MySqlConnection the problem will appear. Example code I try to call conn is this : GV.conn.Open();
Before I put following code to my program it worked fine. Now it keep throwing errors:
public static class GV
{
public static MySqlConnection conn = new MySqlConnection(
"server=localhost;port=3306;uid=root;database=sysdb_elearn;password=***");
public static MySqlCommand com = null;
public static MySqlDataReader dr = GV.com.ExecuteReader();
public static frmLearnerPanel flp = new frmLearnerPanel();
public static frmLogIn frmLogin = new frmLogIn();
}