Represents a bound ODBC parameter.
Visual Basic syntaxPublic Class DBParameter
C# syntaxpublic class DBParameter
MembersAll 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. |
RemarksThis class is required to execute commands with parameters. All parameters must be in place before the command is executed.
ExampleThe 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.Close();
} |
DbType property
Direction property
IsNullable property
ParameterName property
Precision property
Scale property
Size property
Value property
HasChanged field
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |
