O'Reilly logo

A Programmer's Guide to .NET by Alexei Fedorov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.4. Commands

Commands – implemented as OleDbCommand and SqlCommand classes – are the only way to execute SQL statements and stored procedures in ADO.NET. Both managed providers implement the IDbCommand interface and inherit the following properties.

  • CommandText This property (of a String type) specifies the SQL statement, name of the stored procedure or table (for the OLE DB managed provider only) to be executed against the data store. The meaning of the contents of this property depends on the value set for the CommandType property.

  • CommandTimeout This property (of an Integer type) specifies the number of seconds to wait before terminating the attempt to execute a command and generating an error. The default value is 30 seconds.

  • CommandType ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required