DbDataSource.CreateCommand(String) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a DbCommand that's ready for execution against the DbDataSource.
public System.Data.Common.DbCommand CreateCommand(string? commandText = default);
member this.CreateCommand : string -> System.Data.Common.DbCommand
Public Function CreateCommand (Optional commandText As String = Nothing) As DbCommand
- commandText
- String
The text command with which to initialize the DbCommand that this method returns.
A DbCommand that's ready for execution against the DbDataSource.
Commands returned from this method are already configured to execute against their originating DbDataSource; their Connection does not need to be set, and doing so will throw an exception.
Since these commands have no explicitly-managed connection, it is not possible to use them with transactions, and trying to set Transaction will throw an exception. To use a transaction, get a connection from OpenConnection and create a command against it.
Ürün | Sürümler |
---|---|
.NET | 7, 8, 9, 10 |
.NET geri bildirimi
.NET, açık kaynak bir projedir. Geri bildirim sağlamak için bir bağlantı seçin: