DataContext.Connection Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets the connection used by the framework.

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

public DbConnection Connection { get; }

Property Value

Type: System.Data.Common.DbConnection

The connection used by the framework.

You can use this property to interoperate with relational ADO.NET code.

The returned connection will be closed unless it has been explicitly opened by the user.

.NET Framework
Available since 3.5
Return to top