Partager via


DatabaseSchemaUpdater Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

'Declaration
Public NotInheritable Class DatabaseSchemaUpdater
public sealed class DatabaseSchemaUpdater

The DatabaseSchemaUpdater type exposes the following members.

Properties

  Name Description
Public propertySupported by Silverlight for Windows Phone Context Gets the data context object that represents the corresponding local database.
Public propertySupported by Silverlight for Windows Phone DatabaseSchemaVersion Get or sets the version of the corresponding local database schema.

Top

Methods

  Name Description
Public methodSupported by Silverlight for Windows Phone AddAssociation<T> Adds a database association, such as a foreign key relationship, to a local database.
Public methodSupported by Silverlight for Windows Phone AddColumn<T> Adds a database column to a local database.
Public methodSupported by Silverlight for Windows Phone AddIndex<T> Adds a database index to a local database.
Public methodSupported by Silverlight for Windows Phone AddTable<T> Adds a table to a local database.
Public methodSupported by Silverlight for Windows Phone Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone Execute Submits schema changes to the local database in a single transaction.
Protected methodSupported by Silverlight for Windows Phone 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.)
Public methodSupported by Silverlight for Windows Phone GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone GetType Gets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows Phone MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone 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 Overview for Windows Phone.

Version Information

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

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.