dotConnect for Salesforce Documentation
Devart.Data.Salesforce Namespace / SalesforceParameterCollection Class / Add Method / Add(String,SalesforceType,Int32) Method
The name of the parameter.
The maximum size, in bytes, of the data the parameter can contain.
Example

In This Topic
    Add(String,SalesforceType,Int32) Method
    In This Topic
    Adds a SalesforceParameter to the SalesforceParameterCollection given the the parameter name, data type, and data size.
    Syntax
    'Declaration
     
    Public Overloads Function Add( _
       ByVal parameterName As String, _
       ByVal type As SalesforceType, _
       ByVal size As Integer _
    ) As SalesforceParameter
    public SalesforceParameter Add( 
       string parameterName,
       SalesforceType type,
       int size
    )

    Parameters

    parameterName
    The name of the parameter.
    type
    size
    The maximum size, in bytes, of the data the parameter can contain.

    Return Value

    The new SalesforceParameter object.
    Example
    The following example creates a SalesforceParameterCollection, adds instances of SalesforceParameter to the collection, and returns a reference to the new SalesforceParameter.
    public void CreateSalesforceParamColl(SalesforceConnection myConn) { 
            SalesforceCommand salesforceCommand = new SalesforceCommand("SELECT * FROM Account WHERE Name = :Name", myConn); 
            SalesforceParameterCollection myParamCollection = salesforceCommand.Parameters; 
            object myParm = new SalesforceParameter("Name", SalesforceType.String, 255); 
            int pIndex = myParamCollection.Add(myParm); 
    }
    Public Sub CreateSalesforceParamColl(myConn As SalesforceConnection)
            Dim salesforceCommand As New SalesforceCommand("SELECT * FROM Account WHERE Name = :Name", myConn)
            Dim myParamCollection As SalesforceParameterCollection = salesforceCommand.Parameters
            Dim myParm As Object = New SalesforceParameter("Name", SalesforceType.[String], 255)
            Dim pIndex As Integer = myParamCollection.Add(myParm)
    End Sub
    See Also