DataContext.Dispose Method (Boolean)

Releases all unmanaged resources used by the DataContext object and possibly also the managed resources as specified.

Namespace:  Microsoft.SharePoint.Linq
Assembly:  Microsoft.SharePoint.Linq (in Microsoft.SharePoint.Linq.dll)

Syntax

'Declaration
Protected Overridable Sub Dispose ( _
    disposing As Boolean _
)
'Usage
Dim disposing As Boolean

Me.Dispose(disposing)
protected virtual void Dispose(
    bool disposing
)

Parameters

  • disposing
    Type: System.Boolean

    true to release both managed and unmanaged resources, false to release only unmanaged resources.

Remarks

Call Dispose when you are finished using this class. The Dispose method leaves this class in an unusable state. After calling Dispose , you must release all references to this class so the garbage collector can reclaim the memory that the class was occupying. For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method. For specific guidance on disposing SharePoint classes, see Best Practices with SharePoint Foundation: Disposing Objects. Note Always call Dispose before you release your last reference to this class. Otherwise, the resources it is using will not be freed until the garbage collector calls this object's Finalize method.

See Also

Reference

DataContext Class

DataContext Members

Dispose Overload

Microsoft.SharePoint.Linq Namespace