/// <summary> /// 从配置文件读取连接信息 /// 连接数据库 /// </summary> private bool connectDB() { connectionString = ConfigClass.getInstance().getValue("connectionString"); conn = new MySqlConnection(connectionString); try { conn.Open(); } catch (MySqlException ex) { return(false); } if (conn.State == ConnectionState.Open) { isConnected = true; } return(true); }