当前位置: 首页>>代码示例>>C#>>正文


C# DatabaseVersionMismatchEventArgs类代码示例

本文整理汇总了C#中DatabaseVersionMismatchEventArgs的典型用法代码示例。如果您正苦于以下问题:C# DatabaseVersionMismatchEventArgs类的具体用法?C# DatabaseVersionMismatchEventArgs怎么用?C# DatabaseVersionMismatchEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DatabaseVersionMismatchEventArgs类属于命名空间,在下文中一共展示了DatabaseVersionMismatchEventArgs类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ValidationTesterAspNetApplication_DatabaseVersionMismatch

        private void ValidationTesterAspNetApplication_DatabaseVersionMismatch(object sender, DatabaseVersionMismatchEventArgs e) {
#if EASYTEST
			e.Updater.Update();
			e.Handled = true;
#else
            e.Updater.Update();
            e.Handled = true;
            if (Debugger.IsAttached) {
                e.Updater.Update();
                e.Handled = true;
            } else {
                string message = "The application cannot connect to the specified database, because the latter doesn't exist or its version is older than that of the application.\r\n" +
                    "This error occurred  because the automatic database update was disabled when the application was started without debugging.\r\n" +
                    "To avoid this error, you should either start the application under Visual Studio in debug mode, or modify the " +
                    "source code of the 'DatabaseVersionMismatch' event handler to enable automatic database update, " +
                    "or manually create a database using the 'DBUpdater' tool.\r\n" +
                    "Anyway, refer to the following help topics for more detailed information:\r\n" +
                    "'Update Application and Database Versions' at http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument2795.htm\r\n" +
                    "'Database Security References' at http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument3237.htm\r\n" +
                    "If this doesn't help, please contact our Support Team at http://www.devexpress.com/Support/Center/";

                if (e.CompatibilityError != null && e.CompatibilityError.Exception != null) {
                    message += "\r\n\r\nInner exception: " + e.CompatibilityError.Exception.Message;
                }
                throw new InvalidOperationException(message);
            }
#endif
        }
开发者ID:aries544,项目名称:eXpand,代码行数:28,代码来源:WebApplication.cs

示例2: XVideoRentalWindowsFormsApplication_DatabaseVersionMismatch

        void XVideoRentalWindowsFormsApplication_DatabaseVersionMismatch(object sender,
                                                                         DatabaseVersionMismatchEventArgs e) {
            
#if EASYTEST
            e.Updater.Update();
            e.Handled = true;
#else
            if (this.DropDatabaseOnVersionMissmatch() > 0)
                Application.ExitThread();
            if (Debugger.IsAttached) {
                e.Updater.Update();
                e.Handled = true;
            }
            else {
                throw new InvalidOperationException(
                    "The application cannot connect to the specified database, because the latter doesn't exist or its version is older than that of the application.\r\n" +
                    "This error occurred  because the automatic database update was disabled when the application was started without debugging.\r\n" +
                    "To avoid this error, you should either start the application under Visual Studio in debug mode, or modify the " +
                    "source code of the 'DatabaseVersionMismatch' event handler to enable automatic database update, " +
                    "or manually create a database using the 'DBUpdater' tool.\r\n" +
                    "Anyway, refer to the 'Update Application and Database Versions' help topic at http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument2795.htm " +
                    "for more detailed information. If this doesn't help, please contact our Support Team at http://www.devexpress.com/Support/Center/");
            }
#endif
        }
开发者ID:aries544,项目名称:eXpand,代码行数:25,代码来源:WinApplication.cs

示例3: ReportsTesterWindowsFormsApplication_DatabaseVersionMismatch

        private void ReportsTesterWindowsFormsApplication_DatabaseVersionMismatch(object sender, DatabaseVersionMismatchEventArgs e) {
#if EASYTEST
			e.Updater.Update();
			e.Handled = true;
#else
            if (true) {
                e.Updater.Update();
                e.Handled = true;
            }
#endif
        }
开发者ID:aries544,项目名称:eXpand,代码行数:11,代码来源:WinApplication.cs

示例4: DCSecurityDemoAspNetApplication_DatabaseVersionMismatch

 private void DCSecurityDemoAspNetApplication_DatabaseVersionMismatch(object sender, DatabaseVersionMismatchEventArgs e) {
     try {
         e.Updater.Update();
         e.Handled = true;
     } catch (CompatibilityException exception) {
         if (exception.Error is CompatibilityUnableToOpenDatabaseError) {
             throw new UserFriendlyException(
             "The connection to the database failed. This demo requires the local instance of Microsoft SQL Server Express. To use another database server,\r\nopen the demo solution in Visual Studio and modify connection string in the \"app.config\" file.");
         }
     }
 }
开发者ID:aries544,项目名称:eXpand,代码行数:11,代码来源:WebApplication.cs

示例5: FeatureCenterWindowsFormsApplication_DatabaseVersionMismatch

        //        protected override ShowViewStrategyBase CreateShowViewStrategy() {
        //            return new ShowInSingleWindowStrategy(this);
        //        }

        private void FeatureCenterWindowsFormsApplication_DatabaseVersionMismatch(object sender, DatabaseVersionMismatchEventArgs e) {

#if EASYTEST
			e.Updater.Update();
			e.Handled = true;
#else
            if (true) {
                if (this.DropDatabaseOnVersionMissmatch() > 0)
                    Application.ExitThread();
                e.Updater.Update();
                e.Handled = true;
            } else {
                throw new InvalidOperationException(
                    "The application cannot connect to the specified database, because the latter doesn't exist or its version is older than that of the application.\r\n" +
                    "The automatic update is disabled, because the application was started without debugging.\r\n" +
                    "You should start the application under Visual Studio, or modify the " +
                    "source code of the 'DatabaseVersionMismatch' event handler to enable automatic database update, " +
                    "or manually create a database using the 'DBUpdater' tool.");
            }
#endif
        }
开发者ID:dimajanzen,项目名称:eXpand,代码行数:25,代码来源:WinApplication.cs

示例6: SecuritySystemExampleWindowsFormsApplication_DatabaseVersionMismatch

 void SecuritySystemExampleWindowsFormsApplication_DatabaseVersionMismatch(object sender,
                                                                           DatabaseVersionMismatchEventArgs e) {
     throw new InvalidOperationException(
         "The application cannot connect to the specified database, because the latter doesn't exist or its version is older than that of the application.");
 }
开发者ID:aries544,项目名称:eXpand,代码行数:5,代码来源:WinApplication.cs

示例7: OnDatabaseVersionMismatch

 protected override void OnDatabaseVersionMismatch(DatabaseVersionMismatchEventArgs args) {
     args.Updater.Update();
     args.Handled = true;
 }
开发者ID:paulute,项目名称:eXpand,代码行数:4,代码来源:ServerApplication.cs

示例8: EFDemoWebApplication_DatabaseVersionMismatch

		private void EFDemoWebApplication_DatabaseVersionMismatch(Object sender, DatabaseVersionMismatchEventArgs e) {
			e.Updater.Update();
			e.Handled = true;
		}
开发者ID:aries544,项目名称:eXpand,代码行数:4,代码来源:EFDemoWebApplication.cs

示例9: app_DatabaseVersionMismatch

 void app_DatabaseVersionMismatch(object sender, DatabaseVersionMismatchEventArgs e)
 {
     e.Handled = true;
 }
开发者ID:hazard999,项目名称:FastSchemaProvider,代码行数:4,代码来源:ApplicationReader.cs

示例10: OnVersionMismatch

 void OnVersionMismatch(object sender, DatabaseVersionMismatchEventArgs args) {
     args.Updater.Update();
     args.Handled = true;
 }
开发者ID:dimajanzen,项目名称:eXpand,代码行数:4,代码来源:Contexts.cs

示例11: OnDatabaseVersionMismatch

 protected override void OnDatabaseVersionMismatch(DatabaseVersionMismatchEventArgs args)
 {
     args.Handled = true;
     base.OnDatabaseVersionMismatch(args);
 }
开发者ID:smoo7h,项目名称:PDFScanAndSort,代码行数:5,代码来源:ServerApplication.cs

示例12: Application_DatabaseVersionMismatch

        /// <summary>
        /// http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument2795.htm 
        /// ЗДЕСЬ ПРОИСХОДИТ ОБНОВЛЕНИЕ БД !!!
        /// </summary>
        private void Application_DatabaseVersionMismatch(object sender, DatabaseVersionMismatchEventArgs e)
        {
            if (e.CompatibilityError is CompatibilityDatabaseIsOldError)
            { // если база есть, но другой версии

                SplashScreenStop();

                string compatibilityError = e.CompatibilityError.Message;
                System.Windows.Forms.DialogResult dialog = XtraMessageBox.Show(Strings.WinApplication_CompatibilityDatabaseIsOldWarning,
                    this.ApplicationName, System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Warning);

                if (dialog == System.Windows.Forms.DialogResult.Yes)
                {
                    this.StartSplash();

                    CreateDatabaseBackup();

                    try
                    {
                        SplashScreenSetDisplayText(Strings.SplashScreenText_Application_DatabaseUpdateBegin);

                        e.Updater.Update();
                        e.Handled = true;

                        SplashScreenSetDisplayText(Strings.SplashScreenText_Application_DatabaseUpdateEnd);

                    }
                    catch (Exception ex)
                    {
                        string UpdateError = ex.Message;

                        SplashScreenStop();

                        Config.Data.UserSettings.DBPathIsInstalled = false;
                        Config.Data.UserSettings.Save();

                        string message = String.Format("{0}\n{1}\n{2}", Strings.WinApplication_DatabaseUpdateGlobalError, compatibilityError, UpdateError);

                        ErrorManager.RaiseException(ErrorCode.Application_DatabaseUpdateFailed, message);
                    }
                }
                else
                {// если пользователь отменил обновление
                    ErrorManager.RaiseException(ErrorCode.Application_DatabaseUpdateCanceled, "");
                }

                return;

            }
            else if (e.CompatibilityError is CompatibilityUnableToOpenDatabaseError)
            { // если базы нету совсем

                string compatibilityError = e.CompatibilityError.Message;
                try
                {
                    string databaseDirectory = Path.GetDirectoryName(Config.Data.AppSettings.DatabaseFile);

                    if (Directory.Exists(databaseDirectory) == false)
                        Directory.CreateDirectory(databaseDirectory);

                    SplashScreenSetDisplayText(Strings.SplashScreenText_Application_DatabaseCreateBegin);

                    e.Updater.Update();
                    e.Handled = true;

                    CreateBuiltInObjects();

                    SplashScreenSetDisplayText(Strings.SplashScreenText_Application_DatabaseCreateEnd);

                    //this.SetUserSetting("DBPathIsInstalled", "true");
                }
                catch (Exception ex)
                {
                    string UpdateError = ex.Message;

                    SplashScreenStop();

                    Config.Data.UserSettings.DBPathIsInstalled = false;
                    Config.Data.UserSettings.Save();
                    //Config.SaveAll();

                    string message = String.Format("{0}\n{1}\n{2}", Strings.WinApplication_DatabaseCreateGlobalError, compatibilityError, UpdateError);

                    ErrorManager.RaiseException(ErrorCode.Application_DatabaseCreateFailed, message);

                }

                SplashScreenStop();

                // Показывем форму перовначальной настройки
                ShowFirstLaunchPatameters();
            }
        }
开发者ID:Rukhlov,项目名称:DataStudio,代码行数:97,代码来源:WinApplication.cs

示例13: AIR_ERPAspNetApplication_DatabaseVersionMismatch

 private void AIR_ERPAspNetApplication_DatabaseVersionMismatch(object sender, DatabaseVersionMismatchEventArgs e)
 {
     e.Updater.Update();
     e.Handled = true;
 }
开发者ID:ViniciusConsultor,项目名称:roadmaxweberp,代码行数:5,代码来源:WebApplication.cs


注:本文中的DatabaseVersionMismatchEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。