With the Data Engine library, you can import data from an SQL database to the DataEngine table into a queryable collection of objects in your code.
To connect Data Engine to Database, you need to follow the steps given below:
Initialize a new workspace folder relative to the project root directory using the Init method of the Workspace class.
Initialize the connection string to the database file whose data you wish to import to the DataEngine base tables.
Create SqlConnection and SqlCommand objects to get hold of the desired data that needs to be imported.
Create an instance of the DbConnector class and pass the Workspace, SqlConnection and SqlCommand objects initialized above, as parameters to its constructor. Use the DbConnector’s GetData method to create a DataEngine table containing the imported data.
After the connection has been established, the queries can be defined and executed to fetch the desired data. Refer to the Transform Data topic for more information.