Changed the requirements of the integrity checking form to need a connection string. The login form willl now attempt to use the connection string setting but failing that it will use the server name in the combo box. The main form will use the app's connection string setting.

This commit is contained in:
2018-02-10 21:39:09 -06:00
parent 2dd754ed29
commit 36bbd29917
3 changed files with 16 additions and 12 deletions
+9 -1
View File
@@ -98,7 +98,15 @@ namespace AdvertsingProfitControl
private void checkIntegrityToolStripMenuItem_Click(object sender, EventArgs e)
{
var form = new FrmIntegrityCheck();
//Check to see if the properties of the program have a last known good connection string.
var connectionString = Properties.Settings.Default.ConnectionString;
if(connectionString == string.Empty)
{
//If the connection string isn't set then attempt to use the connection string
//that is in this form's combo box.
connectionString = "Data Source=" + serverNameComboBox.Text + ";Initial Catalog=AdvertisingProfitControl;Integrated Security=True;MultipleActiveResultSets=True;App=EntityFramework";
}
var form = new FrmIntegrityCheck(connectionString);
form.ShowDialog();
}
}