asp.net.ph

IDbCommand.CommandText Property

System.Data Namespace   IDbCommand Class


Sets or retrieves the statement to execute at the data source.

Syntax


Script IDbCommand.CommandText [ = strCommand ]

Property Value


strCommand The statement to execute.

The property is read/write with no default value.

Remarks

When the CommandType property is set to StoredProcedure, the CommandText property should be set to the name of the stored procedure. The command executes this stored procedure when you call one of the Execute methods.

Example

The following example initializes an instance of the derived OleDbCommand class, and sets some of its properties.

void setOleDbCommand ( ) {
   OleDbCommand myCmd = new OleDbCommand ( );
   myCmd.CommandText = "SELECT * FROM Categories ORDER BY CategoryID";
   myCmd.CommandTimeout = 15;
}
  C# VB

See Also

IDbCommand Members   Connection   CommandTimeout   CommandType Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph