Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ITable.Attach Method

Allows deserialized entities to be associated with a new instance of a DataContext so that they can be updated or deleted from the database.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method Attach(Object) Attaches an entity to the DataContext in an unmodified state.
Public method Attach(Object, Boolean) Attaches all entities of a collection to the DataContext in either a modified or unmodified state.
Public method Attach(Object, Object) Attaches an entity to the DataContext in either a modified or unmodified state by specifying both the entity and its original state.
Top

For more information about how to use this method, see Data Retrieval and CUD Operations in N-Tier Applications (LINQ to SQL).

If a required member is missing, a ChangeConflictException is thrown during SubmitChanges.

Show:
© 2015 Microsoft