Product Documentation

FairCom ADO.NET Driver - Developer's Guide

Previous Topic

Next Topic

Command Type

CtreeSqlCommand.CommandType property indicates how the FairCom DB SQL database command is to be interpreted. CommandType.Text and CommandType.StoredProcedure are supported. By default, CtreeSqlCommand.CommandType is set to CommandType.Text. If you try to set the CommandType property of CtreeSqlCommand object with any other value, an UnsupportedException is thrown. The other possible value for CommandType is TableDirect. (According to Microsoft documentation, TableDirect is only supported by an OleDB .NET data provider.)

  • CommandType.Text. is used to specify any FairCom DB SQL command.
  • CommandType.StoredProcedure is used to call a FairCom DB Stored Procedure. Set CtreeSqlCommand.CommandText to the name of the stored procedure, without parenthesis () and without parameters. Then set CtreeSqlCommand.CommandType to CommandType.StoredProcedure.
  • Create and add CtreeSqlParameters as needed.
  • Call CtreeSqlCommand.ExecuteReader() to execute the command or stored procedure.