'Declaration Public Shadows ReadOnly Property Parameters As SalesforceParameterCollection
public new SalesforceParameterCollection Parameters {get;}
'Declaration Public Shadows ReadOnly Property Parameters As SalesforceParameterCollection
public new SalesforceParameterCollection Parameters {get;}
static void CreateCommand(SalesforceConnection salesforceConnection, string mySelectQuery, SalesforceParameter[] myParamArray) { SalesforceCommand salesforceCommand = new SalesforceCommand(mySelectQuery, salesforceConnection); string myMessage = ""; for (int i = 0; i < myParamArray.Length; i++) { salesforceCommand.Parameters.Add(myParamArray[i]); myMessage += salesforceCommand.Parameters[i].ToString() + "\n"; } Console.Write(myMessage); try { salesforceConnection.Open(); salesforceCommand.ExecuteNonQuery(); } finally { salesforceConnection.Close(); } } static void Main(string[] args) { SalesforceParameter[] myParams = new SalesforceParameter[] { new SalesforceParameter("OldName", "GenePoint"), new SalesforceParameter("NewName", "GenePoint Inc.") }; SalesforceConnection salesforceConnection1 = new SalesforceConnection("Server=login.salesforce.com; User Id= [email protected];Password=mypassword;Security Token=qweASDzcx1234567890rtyui;"); CreateCommand(salesforceConnection1,"UPDATE Account SET Name = :NewName WHERE Name = :OldName",myParams); }
Public Sub CreateCommand(ByVal salesforceConnection As Devart.Data.Salesforce.SalesforceConnection, _ ByVal mySelectQuery As String, ByVal myParamArray() As Devart.Data.Salesforce.SalesforceParameter) Dim salesforceCommand As New Devart.Data.Salesforce.SalesforceCommand(mySelectQuery, salesforceConnection) Dim myMessage As String = "" Dim i As Integer For i = 0 To (myParamArray.Length - 1) salesforceCommand.Parameters.Add(myParamArray(i)) myMessage = String.Concat(myMessage, " ", salesforceCommand.Parameters(i).ToString()) Next Console.WriteLine(myMessage) Try salesforceConnection.Open() salesforceCommand.ExecuteNonQuery() Finally salesforceConnection.Close() End Try End Sub Sub Main() Dim myP1 As New Devart.Data.Salesforce.SalesforceParameter myP1.ParameterName = "OldName" myP1.Value = "GenePoint" Dim myP2 As New Devart.Data.Salesforce.SalesforceParameter myP2.ParameterName = "NewName" myP2.Value = "GenePoint Inc." Dim myParams(1) As Devart.Data.Salesforce.SalesforceParameter myParams(0) = myP1 myParams(1) = myP2 Dim salesforceConnection1 As New Devart.Data.Salesforce.SalesforceConnection( "Server=login.salesforce.com;User Id= [email protected];Password=mypassword;" & _ "Security Token=qweASDzcx1234567890rtyui;") CreateCommand(salesforceConnection1, "UPDATE Account SET Name = :NewName WHERE Name = :OldName", myParams) 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