Overview
In this example, we show how to use DataAccess API to write some values from one Solution to another one.
On this page:
What is the DataAccess API?
DataAccess is an API that empowers you with the capability to access classes and methods, facilitating communication between projects. This API also empowers developers to create external programs within Visual Studio, enabling them to effectively interact with a specific project.
Script
string remoteIP = "127.0.0.1"; object server = null; DataAccess access = new DataAccess(); server = access.SetServer(remoteIP, "Administrator", ""); if (server is string) { @Info.Trace("OfficeServices::Connect - Error: " + server); access = null; } bool sus = access.SetCurrentValue("Tag1", 123, 192, DateTime.UtcNow, server, 0, false);
Where:
- remoteIP can be substituted with the IP address of the remote computer, making it versatile and adaptable to different connections.
- DataAccess instantiates a new object to access methods provided by this API, granting access to its functionalities.
- access.SetServer establishes a connection to the associated project while utilizing the "Administrator" user. An empty password ("") signifies that no password authentication is required for this user.
- access.SetCurrentValue assigns a value of 123 and quality of 192 to a designated "Tag1," which is typically a tag created within the client project.
In this section...