Web API Edition | ComponentOne
Services / Data Engine Services / Manage Data Sources
In This Topic
    Manage Data Sources
    In This Topic

    DataEngine services provide API to analyze the data from multiple data sources, including SQL server, SSAS server and structured files from the file system. This topic will help you determine a suitable method to setup the DataEngine in your application. You can use the following methods to configure DataEngine, according to your project requirements.

    Note: In order to specify the data source easily in your Web API application, you can map the data source settings into keys. Make sure the key is unique for each data source settings in your application.

    AddDataEngine Methods

    When you are working with complex or large data in your application, we suggest you to use AddDataEngine and AddDataEngine<T> methods. These methods generate memory mapped files to save the fields and result data, which makes them the fastest methods for large data processing. For more information about DataEngine methods, see Data Engine WebApi using C1 Template.

    Method Description Elements
    AddDataEngine(string name, DbCommand command, DbConnection connection = null,
    string workspace = null, string tableName = null)
    Adds a DataEngine data.
    • name: Unique value to describe the data source.
    • command: ADO.NET command object for retrieving data from the database. If connection is null, the user should make sure the connection in command is open before calling this method.
    • connection: An open ADO.NET connection object for connecting to the database or set to null.
    • workspace: Path in the server's file system where DataEngine data is saved in files. If it is set to null or not set, the default workspace is used.
    • tableName: The name of the DataEngine table. If it is set to null or not set, the value of the name parameter is used.
    AddDataEngine<T>(string name, Func<IEnumerable<T> dataGetter, string workspace = null, string tableName = null) Adds DataEngine data from an arbitrary IEnumerable.
    • name: Unique value to describe the data source.
    • dataGetter: Function to get the arbitrary IEnumerable.
    • workspace: Path in the server's file system where DataEngine data is saved in files. If it is set to null or not set, the default workspace is used.
    • tableName: The name of the DataEngine table. If it is set to null or not set, the value of the name parameter is used.
    AddDataEngine(string name, string workspace, string tableName)
    Adds a DataEngine data which data files already exist.
    • name: Unique value used to describe the data source.
    • workspace: Path in the server's file system where DataEngine data is saved in files. If it is set to null or not set, the default workspace is used.
    • tableName: The name of the DataEngine table. If it is set to null or not set, the value of the name parameter is used.

    AddDataSource Methods

    When you are working with data sources and do not wish to generate the data files on the API server, we suggest you to use AddDataSource and AddDataSource<T> methods. These methods do not generate any cache files to save the data, therefore the aggregated result data is recalculated for every analysis. For more information about DataSource methods, see Data Engine WebApi using C1 Template.

    Method Description Elements
    AddDataSource(string name, Func<IEnumerable> dataSourceGetter)
    Adds an in-memory data using a function.
    • name: Unique value to describe the data source.
    • datasourceGetter: Function used to return the in-memory data.
    AddDataSource(string name, IEnumerable datasource) Adds an in-memory data.
    • name: Unique value to describe the data source.
    • datasource: The in-memory data.

    AddCube Method

    When you are working with cube data from any SQL Server Analysis Service, we suggest you to use the AddCube method. This method does not generate any data files in your application, therefore for any analysis, a MDX query is sent to the server and the aggregated data is returned back from the server. Performance of this method mostly depends on the SSAS server. For more information about AddCube method, see Data Engine WebApi using SSAS Service.

    Method Description Elements
    AddCube(string name, string connectionString, string cubeName) Adds a cube data.
    • name: Unique value to describe the data source.
    • connectionString: String that specifies information about a data source and the means of connecting to it.
    • cubeName: Name of the cube data source.
    See Also