|
Group: Forum Members
Posts: 153,
Visits: 462
|
Yes in the programs.cs there is this code: So it appears as though after I saved the database for my application from SQL 2008 Trial Edition and then restored to SQL Express 2008 that the RBS files are not being found on startup and that is why connection manager is displaying. The RBS files are located in the database with the user tables.
//-- ToDo: Configure the security settings //-------------------------------------------- //-- Retrieve the global preferences try { SFSPreferencesBO.RetrieveSecurityPreferences(); } catch { if (ConnectionManager.ShowAvailableConnectionStrings()) { // Set the connections ConnectionManager.SetConnections();
SFSPreferencesBO.RetrieveSecurityPreferences(); } }
Here is the entire programs.cs:
using MicroFour.StrataFrame.Application; using MicroFour.StrataFrame.Data; using MicroFour.StrataFrame.Security; using MicroFour.StrataFrame.Security.BusinessObjects; using System; using System.Collections.Generic; using System.Windows.Forms; using System.Configuration; using System.IO;
namespace visualOfficeNet { static class Program { static Boolean gotConnection = true;
/// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() {
//-- Enable visual styles on the application Application.EnableVisualStyles();
//-- Add event handlers for the application events StrataFrameApplication.ShowGateway += new StrataFrameApplication.ShowGatewayEventHandler( ShowGateway); StrataFrameApplication.InitializingApplication += new StrataFrameApplication.InitializingApplicationEventHandler( InitApplication); StrataFrameApplication.SetDataSources += new StrataFrameApplication.SetDataSourcesEventHandler( SetDataSources); StrataFrameApplication.UnhandledExceptionFound += new StrataFrameApplication.UnhandledExceptionFoundEventHandler( UnhandledExceptionFound); StrataFrameApplication.ShowLoginAndInitializeForm += new StrataFrameApplication.ShowLoginAndInitializeFormEventHandler( ShowLoginAndInitMainForm);
//-- Run the application StrataFrameApplication.RunApplication();
//-- Stop the session monitoring before the application exits to remove the low-level event handlers SessionLock.StopSessionMonitoring();
//-- Forcibly close the application to stop message pumps from looping and preventing the application // from closing System.Environment.Exit(1);
}
/// <summary> /// Gets the connection string if the application will use a custom method to aquire the connection /// string rather than the StrataFrame Connection String Manager (optional) /// </summary> /// <remarks></remarks> /// private static void SetDataSources() { ConnectionManager.ApplicationKey = "visualOfficeNet"; ConnectionManager.ApplicationDefaultTitle = "visualOfficeNet"; ConnectionManager.ApplicationDefaultDescription = "This application connection is used by visualOfficeNet";
//-- Set the required data source information so that the ConnectionManager can gather it // SQL Connection ConnectionManager.AddRequiredDataSourceItem("", "SQL Connection", DataSourceTypeOptions.SqlServer, "visualOfficeNet_Data", "This connection is used by visualOfficeNet for the data.");
ConnectionManager.SetConnections(); }
/// <summary> /// Shows the "Gateway" form (a custom form that gives the user a choice to launch different components /// within the application) (optional) /// </summary> /// <param name="e"></param> /// <remarks></remarks> private static void ShowGateway(ShowGatewayEventArgs e) { if (gotConnection) { //-- Inform the application to not show the "Gateway" form again after the main form has closed e.ShowGatewayAfterMainFormClose = false; } }
/// <summary> /// Shows a login form before a main form is shown and allows security to be checked before the application /// launches the main form (optional) /// </summary> /// <param name="e"></param> /// <remarks></remarks> private static void ShowLoginAndInitMainForm(ShowLoginAndInitFormEventArgs e) { //-- Set the login form to your custom login form (optional) Login.LoginFormType = typeof(CustomLogin);
//-- Show the login form and authenticate the user
e.ShowMainForm = Login.ShowLoginAndAuthUser(true); }
/// <summary> /// Provides a centralized location to add any initialization parameters that need to be set before /// the application is loaded and defines the form types used as main forms by the application /// </summary> /// <param name="e"></param> /// <remarks></remarks> private static void InitApplication(InitializingApplicationEventArgs e) { if (MicroFour.StrataFrame.Data.DataBasics.DataSources.Count < 1) { e.Forms.Clear(); e.Forms.Add(typeof(visualOfficeNet.frmConnectionError)); return; }
//-- Add the main form type //-- If more than one form is added to the collection, they can be chosen by showing a "Gateway" form // and supplying the index of the form to show (At least 1 form type must be added to the collection e.Forms.Add(typeof(visualOfficeNet.frmMain));
//-- ToDo: Add any extra application initialization MicroFour.StrataFrame.UI.Localization.MessageKeyType = MicroFour.StrataFrame.Messaging.MessageKeyDataType.XML; MicroFour.StrataFrame.UI.Localization.MessageLocaleID = MicroFour.StrataFrame.UI.Localization.GetActiveLanguage("visualOfficeNet", "", false); ;
//-- ToDo: Configure the security settings //-------------------------------------------- //-- Retrieve the global preferences try { SFSPreferencesBO.RetrieveSecurityPreferences(); } catch { if (ConnectionManager.ShowAvailableConnectionStrings()) { // Set the connections ConnectionManager.SetConnections();
SFSPreferencesBO.RetrieveSecurityPreferences(); } }
//-- Set the encryption key and vector for the user data SecurityBasics.SetSecurityKeyAndVectorForUserAuthentication("visualOfficeNetSFSecurity");
//-- Start the session locking monitor & set the quick key to lock the application SessionLock.StartSessionMonitoring(); SessionLock.SessionLockKey = Keys.F11;
//-- Set the administrative and security maintenance usernames and passwords //SecurityBasics.AdministratorUserName = "Administrator"; //SecurityBasics.AdministratorPassword = "admin" + DateTime.Now.Day.ToString(); //-- set the admin password so that it changes from day to day SecurityBasics.AdministratorUserName = "rrooker"; SecurityBasics.AdministratorPassword = "maggie5626"; //-- set the admin password so that it changes from day to day
SecurityBasics.AdministratorUserPk = -1;
//SecurityBasics.SecurityMaintenanceUserName = "SecurityUser"; //SecurityBasics.SecurityMaintenancePassword = "mySecurityUserPass1"; SecurityBasics.SecurityMaintenanceUserName = "xxxxxx"; SecurityBasics.SecurityMaintenancePassword = "xxxxxxxxxx";
SecurityBasics.SecurityMaintenanceUserPk = -2;
//-- Set the default actions for security enabled objects within the application SecurityBasics.DefaultPermissionInfo = new PermissionInfo(PermissionAction.Deny, "Access Denied.", DeniedActions.Message); SecurityBasics.DefaultPermissionAction = PermissionAction.Deny; SecurityBasics.DefaultBlockedMsg = "Access Denied."; //SecurityBasics.DefaultBlockedMsgKey = "AccessDeniedKey"; SecurityBasics.BlockedReplacementCharacter = '*'; SecurityBasics.BlockedReplacementRegex = @"[A-Za-z0-9@]";
//-- Determine whether to allow Windows authentication SecurityBasics.AllowWindowsAuth = false; }
/// <summary> /// Catches any unhandled exception within the application and provides a place to log the information /// </summary> /// <param name="e"></param> /// <remarks></remarks> private static void UnhandledExceptionFound(UnhandledExceptionFoundEventArgs e) {
} } }
|