SqlClientFactory.CreateCommand Metoda

Definicja

Zwraca silnie typizowane DbCommand wystąpienie.

public:
 override System::Data::Common::DbCommand ^ CreateCommand();
public override System.Data.Common.DbCommand CreateCommand ();
override this.CreateCommand : unit -> System.Data.Common.DbCommand
Public Overrides Function CreateCommand () As DbCommand

Zwraca

Nowe silnie typizowane wystąpienie klasy DbCommand.

Przykłady

Poniższy fragment kodu zwraca silnie typizowane DbCommand wystąpienie:

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

Dotyczy

Zobacz też