LoadDataSet

The LoadDataSet method uses the LoadCollection method of an IDO to query either an IDO collection or a database table and return the results to the user.

Syntax

public DataSet LoadDataSet( string strSessionToken,
                            string strIDOName,
                            string strPropertyList,
                            string strFilter,
                            string strOrderBy,
                            string strPostQueryMethod,
                            int iRecordCap )

Parameters

Name Description
strSessionToken This is the session token obtained through a call to the CreateSessionToken API.
strIDOName This is the name of the IDO collection.
strPropertyList This is a comma-delimited list of the IDO properties.
strFilter This parameter allows you to filter the results of the operation. You can use ny valid SQL WHERE clause syntax.
strOrderBy This is a comma-delimited list of properties that govern the order in which the result set should be sorted. To sort a given property in descending order, use the DESC keyword after the property name.
strPostQueryMethod This parameter specifies a method to execute once for each row in the result set after the query is completed. This is the equivalent of the PQ option in Load/Save Overrides and uses the same syntax.
iRecordCap

This parameter determines how many records are to be retrieved in one request. Values are:

  • -1 – 200 records are retrieved.
  • 0 – All records are retrieved.
  • Any other positive integer – The specified number of records are retrieved.

Output

Returns a System.Data.DataSet that contains the results of the query. The returned data can be filtered by any IDO-level filters. For information about IDO filters, see the online help.

This is an example output DataSet:

<DataSet xmlns="http://frontstep.com/IDOWebService">
  <xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="UserNames">
    <xs:element name="UserNames" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="IDO">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="UserId" type="xs:decimal" minOccurs="0"/>
                <xs:element name="Username" type="xs:string" minOccurs="0"/>
                <xs:element name="UserDesc" type="xs:string" minOccurs="0"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
    </xs:element>
  </xs:schema>
  <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
    <UserNames xmlns="">
      <IDO diffgr:id="IDO1" msdata:rowOrder="0">
        <UserId>1</UserId>
        <Username>sa</Username>
        <UserDesc>WinStudio Admin user</UserDesc>
      </IDO>
      <IDO diffgr:id="IDO2" msdata:rowOrder="1">
        <UserId>2</UserId>
        <Username>jdelacruz</Username>
        <UserDesc>Juan Dela Cruz</UserDesc>
      </IDO>
    </UserNames>
  </diffgr:diffgram>
</DataSet>

Example

string sessionToken = "b/XdI6IQzCviZOGJ0E+002…5vl903teP0jSDwkFs";
string ido = "UserNames";
string properties = "UserId, Username, UserDesc, _ItemID";
string filter = string.Empty;
string orderBy = "UserId";
string postQueryMethod = string.Empty;
int recordCap = -1;
 
IDOWebService.DOWebServiceSoapClient soapClient = new 
IDOWebService.DOWebServiceSoapClient();
DataSet users = soapClient.LoadDataSet( sessionToken, ido, properties, filter, orderBy, postQueryMethod, recordCap );