Skip to main content

AutoCreateOption Enum

Lists the values that specify the action which is performed when a session is connected to a data store.

Namespace: DevExpress.Xpo.DB

Assembly: DevExpress.Data.v22.1.dll


public enum AutoCreateOption


Name Description

A session will try to automatically create the database if it doesn’t exist. It will also create or update the database schema for any persistent classes currently being used.


A session will automatically create or update the database schema for the persistent classes currently being used. If the database doesn’t exist, it won’t be created by a session.


A session will not automatically create the database or update the database schema. The database schema is still queried and checked to match the currently used persistent class metadata.


A session will never query the database for schema to validate against persistent class metadata. This will suppress the SchemaCorrectionNeededException, but a database error may occur during data operations if the schema is not compatible with run-time persistent classes metadata.


The values listed by this enumeration can be used when instantiating a data access layer. Additionally, you can set the mode for a specific Session, using the Session.AutoCreateOption property.

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


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