public static void ReleaseSingleton() { if (mSingleton != null) { mSingleton.Dispose(); } }
private void btnMSTestConnection_Click(object sender, EventArgs e) { DbUtilMSSQL util = new DbUtilMSSQL(); util.Connect(tbMSHostname.Text + "," + tbMSPort.Text, tbMSDatabase.Text, tbMSUser.Text, tbMSPassword.Text); TestConnectionForm form = new TestConnectionForm(); if (util.IsConnected && util.DatabaseExist(tbMSDatabase.Text)) { form.SetText("Connection successfull."); form.SetDetails(util.ConnectionInfo); } else { form.SetText("Connection failed."); form.SetDetails(util.ConnectionInfo); } form.Show(); util.Dispose(); }