In my Project, I used SQL Server to store data from Factory studio. The machine installed Factory studio and machine installed SQL Server is different. The dataset in Factory studio " TagHistorian
Insert the following code in the Script to execute the query:
After that, you will be able to manipulate the Tag created in the first step, which contains a text with the value of remaining capacity in the SQL server.
Note: The line command from number 3 should not be called in CodeBehind, the reason for that is, if the Query fails in CodeBehind it can cause performance issues because CodeBehind is just one thread, so you should call a Task doing a trigger in CodeBehind and this Task execute the Query… The task is another thread.