The IDbCommand InterfaceThe Command class is another core component for any .NET managed data provider. The Command object implements the IDbCommand interface and is responsible for formulating a database statement or command and passing it on to the underlying data source. This is the main class that is leveraged by a concrete DBCommandWrapper class. The Command object is responsible for returning results as a DataReader, a scalar value, or as parameters. Classes that implement the IDbCommand interface must often define additional functions to add provider-specific functionality. For example, like the SqlCommand, the XmlFileCommand class defines the ExecuteXmlReader method in addition to providing an implementation for all the other methods defined by the IDbCommand interface. Listing B.4 illustrates how the XmlFileCommand implements the IDbCommand interface. Listing B.4. XmlFileCommand Implements IDbCommand
|