private void TestConnection() { SetServerStatus(CONNECTING); SetTaskbarState(CONNECTING); SetLoadingStatus(true); DisplayNotifyBox("Connecting", "Please wait while the application attempts to connect to the database"); new System.Threading.Thread(() => { Classes.DatabaseManager dbManger = new Classes.DatabaseManager(); connectionWorking = dbManger.ConnectionWorking(); if (connectionWorking) { SetServerStatus(CONNECTED); SetTaskbarState(CONNECTED); DisplayNotifyBox("Connected", "Successfully connected to the database"); } else { SetServerStatus(NOT_CONNECTED); SetTaskbarState(NOT_CONNECTED); DisplayNotifyBox("Not connected", "Could not connect to the database. Please check your internet connection"); } SetFormState(connectionWorking); SetLoadingStatus(false); }).Start(); }