Add(String,SalesforceType,Int32) Method
Adds a
SalesforceParameter to the
SalesforceParameterCollection given the the parameter name, data type, and data size.
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
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