Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataContext Class

The data context is an object representing the database, a proxy, containing Table objects that represent the tables in the database.

System.Object
  System.Data.Linq.DataContext

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

public class DataContext : IDisposable

The DataContext type exposes the following members.

  NameDescription
Public methodSupported by Silverlight for Windows PhoneDataContext(String)Initializes a new instance of the DataContext class by referencing a file source.
Public methodSupported by Silverlight for Windows PhoneDataContext(String, MappingSource)Initializes a new instance of the DataContext class by referencing a file source and a mapping source.
Top

  NameDescription
Public propertySupported by Silverlight for Windows PhoneChangeConflictsReturns a collection of objects that caused concurrency conflicts when SubmitChanges was called.
Public propertySupported by Silverlight for Windows PhoneDeferredLoadingEnabledSpecifies whether to delay-load one-to-many or one-to-one relationships.
Public propertySupported by Silverlight for Windows PhoneLoadOptionsGets or sets the DataLoadOptions associated with this DataContext.
Public propertySupported by Silverlight for Windows PhoneLogSpecifies the destination to write the SQL query or command.
Public propertySupported by Silverlight for Windows PhoneMappingReturns the MetaModel on which the mapping is based.
Public propertySupported by Silverlight for Windows PhoneObjectTrackingEnabledInstructs the framework to track the original value and object identity for this DataContext.
Top

  NameDescription
Public methodSupported by Silverlight for Windows PhoneCreateDatabaseCreates a database.
Public methodSupported by Silverlight for Windows PhoneDatabaseExistsDetermines whether the associated database can be opened.
Public methodSupported by Silverlight for Windows PhoneDeleteDatabaseDeletes the associated database.
Public methodSupported by Silverlight for Windows PhoneDispose()Releases all resources used by the DataContext.
Protected methodSupported by Silverlight for Windows PhoneDispose(Boolean)Releases resources used by the DataContext.
Public methodSupported by Silverlight for Windows PhoneEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneExecuteDynamicDeleteCalled inside delete override methods to redelegate to LINQ to SQL the task of generating and executing dynamic SQL for delete operations.
Protected methodSupported by Silverlight for Windows PhoneExecuteDynamicInsertCalled inside insert override methods to redelegate to LINQ to SQL the task of generating and executing dynamic SQL for insert operations.
Protected methodSupported by Silverlight for Windows PhoneExecuteDynamicUpdateCalled inside update override methods to redelegate to LINQ to SQL the task of generating and executing dynamic SQL for update operations.
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows 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 PhoneGetChangeSetProvides access to the modified objects tracked by DataContext.
Public methodSupported by Silverlight for Windows PhoneGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetTable(Type)Returns a collection of objects of a particular type, where the type is defined by the type parameter.
Public methodSupported by Silverlight for Windows PhoneGetTable<TEntity>()Returns a collection of objects of a particular type, where the type is defined by the TEntity parameter.
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneRefresh(RefreshMode, IEnumerable)Refreshes a collection of entity objects according to the specified mode.
Public methodSupported by Silverlight for Windows PhoneRefresh(RefreshMode, Object)Refreshes an entity object according to the specified mode.
Public methodSupported by Silverlight for Windows PhoneRefresh(RefreshMode, Object[])Refreshes an array of entity objects according to the specified mode.
Public methodSupported by Silverlight for Windows PhoneSubmitChanges()Computes the set of modified objects to be inserted, updated, or deleted, and executes the appropriate commands to implement the changes to the database.
Public methodSupported by Silverlight for Windows PhoneSubmitChanges(ConflictMode)Sends changes that were made to retrieved objects to the underlying database, and specifies the action to be taken if the submission fails.
Public methodSupported by Silverlight for Windows PhoneToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public Extension MethodSupported by Silverlight for Windows PhoneCreateDatabaseSchemaUpdaterCreates a DatabaseSchemaUpdater object based on the specified data context. (Defined by Extensions.)
Top

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft