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 |