/// <summary> /// Changes database /// </summary> /// <param name="databaseName"></param> public void ChangeDatabase(string databaseName) { if (0 == NativeConnection.mysql_select_db(databaseName)) { this.Dbname = databaseName; } else { throw new MySqlException("MySQLDriverCS Error: change database failed, perhaps user is not authorized to access that database." + NativeConnection.mysql_error()); } }
/// <summary> /// Exception from native connection /// </summary> /// <param name="nativeConnection"></param> /// <param name="message"></param> public MySqlException(NativeConnection nativeConnection, string message = null) { Number = nativeConnection.mysql_errno(); Message = nativeConnection.mysql_error() + " (" + Number + ")" + (message != null ? "\nContext:\n" + message : ""); }