dotConnect for DB2 Documentation
Devart.Data.DB2 Namespace / DB2ParameterCollection Class
Members Example

In This Topic
    DB2ParameterCollection Class
    In This Topic
    Collects all parameters relevant to a DB2Command as well as their respective mappings to System.Data.DataSet columns.
    Syntax
    Remarks
    The number of parameters in the collection must be equal to the number of parameter placeholders within the command text, or DB2 raises an error.
    Example
    The following example adds instance of DB2Parameter to collection.
    public void AddDB2Parameters()
    {
      // Create db2Connection and db2Command.
    
      db2Command.CommandText = "DELETE Dept WHERE DeptNo = :DeptNo";
      db2Command.Parameters.Add("DeptNo", DB2Type.Int).Value = 50;
      db2Command.ExecuteNonQuery();
    }
    Public Sub AddDB2Parameters()
      // Create db2Connection and db2Command.
    
      db2Command.CommandText = "DELETE Dept WHERE DeptNo = :DeptNo"
      db2Command.Parameters.Add("DeptNo", DB2Type.Int).Value = 50
      db2Command.ExecuteNonQuery()
    
    End Sub 'AddDB2Parameters
    Inheritance Hierarchy

    System.Object
       System.MarshalByRefObject
          System.Data.Common.DbParameterCollection
             Devart.Common.DbParameterBaseCollection
                Devart.Data.DB2.DB2ParameterCollection

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also