RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DataStoreCommand Class

Provides execution of SQL statements and execution of stored procedures.

Pascal
DataStoreCommand = class(DbCommand, IDbCommand, ICloneable, IDisposable);
C++
class DataStoreCommand : public DbCommand, public IDbCommand, public ICloneable, public IDisposable;

Ado.Net20.cs

DataStoreCommand provides execution of SQL statements and execution of stored procedures.  

DataStoreCommand is an implementation of the .NET DbCommand class. 

After associating a command object with a connection object, the CommandText property should be set to a SQL statement or a stored procedure name. If a stored procedure name is used, the CommandType property should be set to CommandType.StoredProcedure. Then the command can be executed using one of these methods:

  • ExecuteReader: Executes a command that returns rows. Most SELECT statements should use this method. If the actual command has no rows, the resulting DataStoreDataReader returns false from the DataStoreDataReader.Read method and the DataStoreDataReader.FieldCount property yields 0.
  • ExecuteNonQuery: Executes a command that does not return rows, such as INSERT, UPDATE, DELETE and DDL statements. If the actual command has result rows, they are discarded at the server.
  • ExecuteScalar: Retrieves a single value from a resulting row. CommandText can be assigned a different value after executing one statement.

 

DbCommand (MSDN) 

DataStoreDataReader 

CommandText 

CommandType 

FieldCount 

ExecuteNonQuery 

ExecuteReader 

ExecuteScalar 

Read

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!