/// <summary> /// Set connection string into web.config. /// </summary> private void SetConnectionString() { if (!AzureHelper.IsRunningOnAzure) { if (!SettingsHelper.RemoveConnectionString(DBSeparationHelper.ConnStringSeparateName)) { separationFinished.ErrorLabel.Visible = true; string resultStringDisplay = " <br/><br/><strong><add name=\"" + DBSeparationHelper.ConnStringSeparateName + "\" connectionString=\"" + DBSeparationHelper.ConnStringSeparate + "\"/></strong><br/><br/>"; separationFinished.ErrorLabel.Text = GetString("separationDB.removeConnectionStringError") + resultStringDisplay; } } else { string connString = "<add name=\"" + DBSeparationHelper.ConnStringSeparateName + "\" connectionString=\"" + DBSeparationHelper.ConnStringSeparate + "\"/>"; string appSetting = "<Setting name=\"" + DBSeparationHelper.ConnStringSeparateName + "\" value=\"" + DBSeparationHelper.ConnStringSeparate + "\"/>"; separationFinished.AzureErrorLabel.Visible = true; separationFinished.AzureErrorLabel.Text = String.Format(ResHelper.GetString("separationDB.removeConnectionStringErrorAzure"), connString, appSetting); separationFinished.AzureErrorLabel.Text += GetManualCopyText(); } if (PersistentStorageHelper.GetValueFromFile("SeparateDBSites") == null) { if (!separationFinished.ErrorLabel.Visible) { separationFinished.ErrorLabel.Text += "<br />"; } else { separationFinished.ErrorLabel.Visible = true; } separationFinished.ErrorLabel.Text += ResHelper.GetFileString("separationdb.startsites"); } }
/// <summary> /// Set connection string into web.config. /// </summary> private void SetConnectionString() { string connectionStringName = DatabaseSeparationHelper.ConnStringSeparateName; if (!SystemContext.IsRunningOnAzure) { if (!SettingsHelper.SetConnectionString(connectionStringName, databaseDialog.ConnectionString)) { string connStringDisplay = ConnectionHelper.GetConnectionString(databaseDialog.AuthenticationType, databaseDialog.ServerName, databaseDialog.Database, databaseDialog.Username, databaseDialog.Password, 240, true); string resultStringDisplay = "<add name=\"" + connectionStringName + "\" connectionString=\"" + connStringDisplay + "\"/>"; separationFinished.ErrorLabel.Visible = true; separationFinished.ErrorLabel.Text = string.Format(ResHelper.GetFileString("Install.ConnectionStringError"), resultStringDisplay); } } else { string connStringValue = ConnectionHelper.GetConnectionString(databaseDialog.AuthenticationType, databaseDialog.ServerName, databaseDialog.Database, databaseDialog.Username, databaseDialog.Password, 240, true, "English", true); string connString = "<add name=\"" + connectionStringName + "\" connectionString=\"" + connStringValue + "\"/>"; string appSetting = "<Setting name=\"" + connectionStringName + "\" value=\"" + connStringValue + "\"/>"; separationFinished.AzureErrorLabel.Visible = true; separationFinished.AzureErrorLabel.Text = string.Format(ResHelper.GetFileString("Install.ConnectionStringAzure"), connString, appSetting); } bool dbEngineSupportsOpenqueryCommand = !DatabaseSeparationHelper.IsUsingAzureDatabase; if (!dbEngineSupportsOpenqueryCommand) { separationFinished.AzureErrorLabel.Visible = true; separationFinished.AzureErrorLabel.Text += GetManualCopyText(); } if (PersistentStorageHelper.GetValueFromFile("SeparateDBSites") == null) { if (!separationFinished.ErrorLabel.Visible) { separationFinished.ErrorLabel.Text += "<br />"; } else { separationFinished.ErrorLabel.Visible = true; } separationFinished.ErrorLabel.Text += ResHelper.GetFileString("separationdb.startsites"); } }