Examples
Last updated
Last updated
The following examples can be found on this page:
This example Application demonstrates how to read Australian sensor values via a query statement against a SQL Server Database using the SQL Server Connector.
You can download the files here to try it out for yourself - adjusting the steps to use your own SQL credentials.
Refer to configuration to understand all configuration options of this Connector.
From the Properties blade of the widget to which the SQL Server Connector will be linked, a data grid in our example, select the Data Source tab.
Click the plus icon next to Data Source, then Connection, and select the SQL Server Connector.
Enter a name for the connection and the authentication details: the Server Instance, User Name, and Password. In this case, tick to use variables and use SQL server authentication as a password is needed.
Select the database, tick to specify a query, paste a query, and select the primary key.
In this case, select XCS Master, paste the query below, and select Id as the primary key.
In this example, we are not using access control. Untick Access Control and click Save.
Refer to the data access configuration for more information.
Select the Connection that was just created, select the entity to read, and enter the Data Source name.
In this case, set the Connection to Master Data, set the name to Master Data, and the entity to SQL Query. Save the Data Source.
Select the Data Source we just added, and save the Widget.
Click the Launch button and view the results. Observe that Australian sensor values are returned using a query statement against an entity in a SQL Server database.
See the Import, Export, and Clone - XMPro article for steps to import an Application.
This example Application demonstrates how to read geographical information from an entity in a SQL Server Database using the SQL Server Connector.
You can download the files here to try it out for yourself - adjusting the steps to use your own SQL credentials.
Refer to configuration to understand all configuration options of this Connector.
From the Properties blade of the widget to which the SQL Server Connector will be linked, a data grid in our example, select the Data Source tab.
Click the plus icon next to Data Source, then Connection, and select the SQL Server Connector.
Enter the authentication details: the Server Instance, User Name, and Password. In this case, tick to use variables and use SQL server authentication as a password is needed.
Select the Database.
Enter a Name for the Connection, and click Save. In this case, set the name to Master Data.
Select the Connection that was just created, select the entity to read, and enter the Data Source name.
In this case, set the Connection to Master Data, set the entity to Cities, and the name to City Data. Save the Data Source.
Note that the primary key is auto-populated once the entity is selected.
Select the Data Source we just added, and save the Widget.
Click the Launch button and view the results. Observe that data is returned from the City entity in the SQL Server database.
See the Import, Export, and Clone - XMPro article for steps to import an Application.
Application
C0mp|ex123
Application
C0mp|ex123