Export (0) Print
Expand All

SqlClientFactory.CreateCommand Method

Returns a strongly typed DbCommand instance.

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

public override DbCommand CreateCommand()

Return Value

Type: System.Data.Common.DbCommand
A new strongly typed instance of DbCommand.

The following code fragment returns a strongly typed DbCommand instance:

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft