dotConnect for Salesforce Documentation
Devart.Data.Salesforce Namespace / SalesforceParameterCollection Class / Add Method / Add(String,SalesforceType) Method
The name of the parameter.
One of the SalesforceType values.
Example

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

    Parameters

    parameterName
    The name of the parameter.
    type
    One of the SalesforceType values.

    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); 
            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])
            Dim pIndex As Integer = myParamCollection.Add(myParm)
    End Sub
    See Also