private void buttonConnectRepository_Click(object sender, EventArgs e) { try { SerRepository = new MS_SqlServerIPSerializer(@textBoxUser.Text, @textBoxPassword.Text, @textBoxIP.Text, @textBoxPort.Text, @textBoxDBName.Text); SerRepository.RegisterType(typeof(TaxonNames)); SerRepository.Activate(); ConnRepository = SerRepository.CreateConnection(); buttonConnectRepository.Text = "Connected"; buttonConnectRepository.BackColor = Color.Yellow; repositoryConnection = true; } catch (Exception f) { MessageBox.Show("An error according to Your Values has occured", "Check Values", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } startcheck(); }