Represents a bound ODBC parameter.
Public Class DBParameter
public class DBParameter
All members of DBParameter class, including all inherited members.
Name | Description |
---|---|
The SQLType of this parameter. | |
The Input/Output direction of this parameter. | |
True if the parameter can be null; otherwise, false. | |
The name of this parameter. | |
The Decimal precision of this parameter. | |
The resolvable digits of this parameter. | |
The size of this parameter, measured in bytes. | |
The value of this parameter. | |
Returns whether the parameter has been modified since creation. |
This class is required to execute commands with parameters. All parameters must be in place before the command is executed.
The following C# code uses the DBCommand interface to execute an update with parameters:
using( DBCommand cstmt = conn.CreateCommand() ) { DBCommand cstmt = conn.CreateCommand(); cstmt.CommandText = "call myProc( ?,?,? )"; cstmt.Prepare(); DBParameter param = new DBParameter(); param.DbType = SQLType.SQL_CHAR; param.Value = "10000"; cstmt.Parameters.Add( param ); param = new DBParameter(); param.DbType = SQLType.SQL_INTEGER; param.Value = 20000; cstmt.Parameters.Add( param ); param = new DBParameter(); param.DbType = SQLType.SQL_DECIMAL; param.Precision = 5; param.Value = new Decimal( 30000 ); cstmt.Parameters.Add( param ); // Execute update DBRowReader rset = cstmt.ExecuteNonQuery(); cstmt.ExecuteNonQuery(); } |
DbType property
Direction property
IsNullable property
ParameterName property
Precision property
Scale property
Size property
Value property
HasChanged field
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |