DatabaseSchemaUpdater Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Enables local database schema and version changes in Windows Phone applications.

Inheritance Hierarchy

System..::.Object
  Microsoft.Phone.Data.Linq..::.DatabaseSchemaUpdater

Namespace:  Microsoft.Phone.Data.Linq
Assembly:  System.Data.Linq (in System.Data.Linq.dll)

Syntax

Public NotInheritable Class DatabaseSchemaUpdater
public sealed class DatabaseSchemaUpdater

The DatabaseSchemaUpdater type exposes the following members.

Properties

  Name Description
Context Gets the data context object that represents the corresponding local database.
DatabaseSchemaVersion Get or sets the version of the corresponding local database schema.

Top

Methods

  Name Description
AddAssociation<(Of <(T>)>) Adds a database association, such as a foreign key relationship, to a local database.
AddColumn<(Of <(T>)>) Adds a database column to a local database.
AddIndex<(Of <(T>)>) Adds a database index to a local database.
AddTable<(Of <(T>)>) Adds a table to a local database.
Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Execute Submits schema changes to the local database in a single transaction.
Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
GetType Gets the Type of the current instance. (Inherited from Object.)
MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

The database does not change to reflect updates from the DatabaseSchemaUpdater object until the Execute()()() method is called. When that method is called, all changes are submitted to the local database as a single transaction, including version updates. Using a single transaction helps the database maintain integrity, such as in cases where the user exits the application during an upgrade.

For information about using a local database in your Windows Phone application, see Local database for Windows Phone 8.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Phone.Data.Linq Namespace