CreateCommand Method (SalesforceConnection)
Creates and returns a
SalesforceCommand object associated with the
SalesforceConnection.
In this sample
SalesforceCommand object is created. It is automatically associated with
SalesforceConnection that created it.
public void CreateSalesforceCommand(string myConnString)
{
SalesforceConnection salesforceConnection = new SalesforceConnection(myConnString);
SalesforceCommand salesforceCommand = salesforceConnection.CreateCommand();
salesforceCommand.CommandText = "INSERT INTO Account(Name) Values('New account')";
salesforceConnection.Open();
try
{
salesforceCommand.ExecuteNonQuery();
}
finally
{
salesforceConnection.Close();
}
}
Public Sub CreateSalesforceCommand(myConnString As String)
Dim salesforceConnection As New SalesforceConnection(myConnString)
Dim salesforceCommand As SalesforceCommand = salesforceConnection.CreateCommand()
salesforceCommand.CommandText = "INSERT INTO Account(Name) Values('New account')"
salesforceConnection.Open()
Try
salesforceCommand.ExecuteNonQuery()
Finally
salesforceConnection.Close()
End Try
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