dotConnect for SugarCRM Documentation
Devart.Data.Sugar Namespace / SugarCommand Class / SugarCommand Constructor / SugarCommand Constructor(String,SugarConnection)
The text of the query.
A SugarConnection object that represents the connection to SugarCRM.
Example

In This Topic
    SugarCommand Constructor(String,SugarConnection)
    In This Topic
    Initializes a new instance of the SugarCommand class with the text of the query and a %% object.
    Syntax
    'Declaration
     
    Public Function New( _
       ByVal commandText As String, _
       ByVal connection As SugarConnection _
    )
    public SugarCommand( 
       string commandText,
       SugarConnection connection
    )

    Parameters

    commandText
    The text of the query.
    connection
    A SugarConnection object that represents the connection to SugarCRM.
    Remarks
    The following table shows initial property values for an instance of SugarCommand.
    Properties Initial value
    CommandText commandText
    CommandTimeout 30
    CommandType System.Data.CommandType.Text
    Connection connection
    Example
    The following example creates a SugarCommand and sets some of its properties.
    public void CreateCommand()
    {
      SugarConnection sugarConnection = new SugarConnection(
          "server=https://your_company.sugaropencloud.eu;user id=admin;password=AmFFA4ZryM;");
      string mySelectQuery = "SELECT * FROM Campaigns";
      SugarCommand sugarCommand = new SugarCommand(mySelectQuery, sugarConnection);
      sugarCommand.FetchSize = 100;
    }
    Public Sub CreateCommand()
      Dim sugarConnection As New SugarConnection( _
        "server=https://your_company.sugaropencloud.eu;user id=admin;password=AmFFA4ZryM;")
      Dim mySelectQuery As String = _
        "SELECT * FROM Campaigns"
      Dim sugarCommand As New SugarCommand(mySelectQuery, sugarConnection)
      sugarCommand.FetchSize = 100
    End Sub
    Requirements

    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

    See Also