Skip to main content
A newer version of this page is available. .

XafApplication.DatabaseUpdateMode Property

Specifies the mode of updating the database.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

[Browsable(false)]
[DefaultValue(DatabaseUpdateMode.UpdateOldDatabase)]
public DatabaseUpdateMode DatabaseUpdateMode { get; set; }

Property Value

Type Default Description
DatabaseUpdateMode **UpdateOldDatabase**

A DatabaseUpdateMode enumeration value.

Available values:

Name Description
Never

Specifies that the database is never updated. In this instance, update of the database should be performed manually on the database server.

UpdateDatabaseAlways

Specifies that the database is updated at every application run. Do not choose this mode when the Application Server is in use.

UpdateOldDatabase

Specifies that the database is updated when its version is older than the application version.

Remarks

Use this property to specify the mode for application database update. By default, the DatabaseUpdateMode.UpdateOldDatabase value is set for this property. However, the DatabaseUpdateMode.UpdateDatabaseAlways value is set in VB solution templates for the debug mode:

Public Class Program
   Public Shared Sub Main()
      '...
      Dim _application As MySolutionWindowsFormsApplication = _
      New MySolutionWindowsFormsApplication()
      If System.Diagnostics.Debugger.IsAttached Then
         _application.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways
      End If
      '...
    End Sub
End Class

This is done because of the difficulty in incrementing versions in VB projects.

Note

Do not set the DatabaseUpdateMode property to DatabaseUpdateMode.UpdateDatabaseAlways when the Application Server is in use.

For details on the database update process, refer to the Update Application and Database Versions using the ModuleInfo Table topic.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DatabaseUpdateMode property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also