GetRemoteDataSourceConnection

This remote business rule will return the connection string associated with a Local Gateway Configuration Data Source.

NOTE: Requires allowRemoteCodeExec = True on Smart Integration Local Gateway.

Parameter details:

  • Data Source: The name of the Local Gateway Configuration Data Source.

Here is the rule in C#:

Copy
// SIC Function to get configured connection string from SIC Gateway
namespace OneStream.BusinessRule.SmartIntegrationFunction.GetRemoteDataSourceSample
{
 public class MainClass
 {
 public DataTable RunOperation()
 {
 DataTable dataTableResults = new DataTable();
             // Get the remotely defined connection string
 string connectionString = OneStreamGatewayService.APILibrary.GetRemoteDataSourceConnection(""); // enter name of DB Connection
 SqlConnection conn = new SqlConnection(connectionString);
            // Insert custom code
 return dataTableResults;
 }
 }
}

Here is the rule in VB.NET:

Copy
' SIC Function to get configured connection string from SIC Gateway
Namespace OneStream.BusinessRule.SmartIntegrationFunction.GetRemoteDataSource_VB
 Public Class MainClass
 Public Shared Function RunOperation() As DataTable
 Dim dataTableResults As New DataTable 
 ' Get the remotely defined connection String
 Dim connectionString As String = OneStreamGatewayService.APILibrary.GetRemoteDataSourceConnection("") ' enter name of DB Connection
 Dim conn As SqlConnection = New SqlConnection(connectionString)
 ' Insert custom code
 
 Return dataTableResults
 End Function
 End Class
End Namespace