OdbcFactory.CreateConnection Method ()


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

Returns a strongly-typed DbConnection instance.

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

public override DbConnection CreateConnection()

Return Value

Type: System.Data.Common.DbConnection

A new strongly-typed instance of DbConnection.

The following code fragment returns a strongly-typed DbConnection instance:

OdbcFactory newFactory = OdbcFactory.Instance;
DbConnection cmd = newFactory.CreateConnection();

.NET Framework
Available since 2.0
Return to top