8.6. Implementing the Command Class

Commands must implement IDbCommand, which is shown in Listing 8-3. IDbCommand inherits from IDisposable.

Listing 8-3. The IDbCommand interface
 public interface IDbCommand : IDisposable { public void Cancel(); public IDbDataParameter CreateParameter(); public int ExecuteNonQuery(); public IDataReader ExecuteReader(); public IDataReader ExecuteReader(CommandBehavior b); public object ExecuteScalar(); public string CommandText {get; set;} public int CommandTimeout {get; set;} public CommandType CommandType {get; set;} public IDbConnection Connection {get; set;} public IDataParameterCollection Parameters {get;} public IDbTransaction Transaction {get; set;} public UpdateRowSource UpdatedRowSource {get; set;} } ...

Get Essential ADO.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.