dotConnect for Zoho CRM Documentation
Devart.Data.Zoho Namespace / ZohoConnection Class / CreateCommand Method
Example

CreateCommand Method (ZohoConnection)
Creates and returns a ZohoCommand object associated with the ZohoConnection.
Creates and returns a ZohoCommand object associated with the ZohoConnection.
Syntax
'Declaration
 
Public Shadows Function CreateCommand() As ZohoCommand
 

Return Value

A ZohoCommand object.
Remarks
You can use this method as an alternative to common ZohoCommand constructors.
Example
In this sample ZohoCommand object is created. It is automatically associated with ZohoConnection that created it.
public void CreateZohoCommand(string myConnString)
{
  ZohoConnection zohoConnection = new ZohoConnection(myConnString);
  ZohoCommand zohoCommand = zohoConnection.CreateCommand();
  zohoCommand.CommandText = "INSERT INTO Accounts (\"Account Name\", Phone) VALUES ('Test','555-555-555')";
  zohoConnection.Open();
  try
  {
    zohoCommand.ExecuteNonQuery();
  }
  finally
  {
    zohoConnection.Close();
  }
}
Public Sub CreateZohoCommand(ByVal myConnString As String)
  Dim zohoConnection As New ZohoConnection(myConnString)
  Dim zohoCommand As ZohoCommand = zohoConnection.CreateCommand()
  zohoCommand.CommandText = "INSERT INTO Accounts (\"Account Name\", Phone) VALUES ('Test','555-555-555')"
  zohoConnection.Open()
  Try
    zohoCommand.ExecuteNonQuery()
  Finally
    zohoConnection.Close()
  End Try
End Sub
See Also