class DBParameter Member of iAnywhere.MobiLink.Script
Represents a bound ODBC parameter.
DBParameter is required to execute commands with parameters. All parameters must be in place before the command is executed.
For example, the following C# code uses DBCommand to execute an update with parameters:
public void handleUpload(UploadData ud) { UploadedTableData UTDAdmin = ud.GetUploadedTableByName("Admin"); IDataReader AdminIns = UTDAdmin.GetInserts(); DBCommand stmt1 = _conn.CreateCommand(); DBParameter p_id = new DBParameter(); DBParameter p_data = new DBParameter(); stmt1.CommandText = "INSERT INTO Admin(admin_id,data) VALUES (?,?)"; p_id.DbType = SQLType.SQL_BIGINT; stmt1.Parameters.Add(p_id); p_data.DbType = SQLType.SQL_VARCHAR; p_data.Size = 30; stmt1.Parameters.Add(p_data); stmt1.Prepare(); while (AdminIns.Read()) { p_id.Value = AdminIns.GetInt64(0); p_data.Value = AdminIns.GetString(1); stmt1.ExecuteNonQuery(); } stmt1.Close(); } |
DbType property
Direction property
IsNullable property
ParameterName property
Precision property
Scale property
Size property
Value property
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |