SqlClientFactory.Instance Field

Definition

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

C#
public static readonly Microsoft.Data.SqlClient.SqlClientFactory Instance;

Field Value

Examples

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

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

Applies to

Toode Versioonid
SqlClient .NET Core 1.0, 1.1, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2
SqlClient .NET Framework 1.0, 1.1, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2
SqlClient .NET Standard 1.0, 1.1, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2