SqlClientFactory.Instance Field


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

Gets an instance of the SqlClientFactory. This can be used to retrieve strongly typed data objects.

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

public static readonly SqlClientFactory Instance

The following code fragment uses the Instance property to retrieve a SqlClientFactory instance, and then return a strongly typed DbCommand instance:

SqlClientFactory newFactory = SqlClientFactory.Instance;
DbCommand cmd = newFactory.CreateCommand();

.NET Framework
Available since 2.0
Return to top