Skip to main content
It is necessary to query data from a database when writing applications. Archive providers are designed for this. They handle the complex business logic of filtering and flattening the complex relationships in the database into a simple flat table. While archive providers make complex queries possible through web services, they of course work in and with their lower-level data types executed in the belly NetServer.

NetServer Core vs web services

This section shows how to query an archive provider both using the core NetServer API, as well as the NetServer Web Services API. There are subtle differences between core and web services APIs, but for the most part, they are the same. One of the biggest differences is how value types are returned (integers, Double, and DateTime). Both examples represent a query that selects all sales where the sale project ID is set to 47.
NetServer Core

Example

The following example demonstrates how a PersonProvider is used to query data from the database.
Here we have initially created an archive provider of type Person. PersonProvider is a specially designed archive provider:
  1. Retrieve the list of columns that can be handled by this archive provider through the GetAvailableColumns method.
  2. Retrieve the Entities that are supported by this archive provider via the GetAvailableEntities method.
  3. GetAvailableColumns() and GetAvailableEntities return data lists of type ArchiveColumnInfo and ArchiveEntityInfo respectively.
In the above example, we have retrieved the ColumnInfo and EntityInfo from the PersonProvider and displayed them in 2 list-boxes. PersonProvider -screenshot Finally, we have retrieved the set of rows satisfying the above query and displayed them in another Listbox. Result -screenshot

NetServer REST WebApi

Using the Sale endpoint and issue an OData query (see documentation):

NetServer REST Agent Service

Using the RESTful Agent Find endpoint (see documentation):