Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

Implement IDBConnectionString Interface

  • Last UpdatedJun 10, 2024
  • 1 minute read

The IDBConnectionString Interface can be used to secure the connection string configuration specified in theFarm Configuration Wizard's Database Settings screen. Custom data can be passed to the interface method by setting the inner text for the data source node.

Using this, the connection string can be moved from the configuration file to the DLL in order to enhance security. When creating a data source in Central Configuration, select the option "Connection Provider" and specify the dll generated in the Assembly Path field.

PROCEDURE

Dll REFERENCE

System

System.Data

Workflow.NET.NET2

NAMESPACE USED

System.Collections.Generic

System.Text

Workflow.NET

Workflow.NET.Storage

Workflow.NET.Interfaces

Workflow.NET.Engine

Workflow.NET.Engine.Interfaces

A sample implementation code is shown below.

public class GetConnectionString:IDBConnectionString

{

public GetConnectionString()
{

}
public GetConnectionString(string ParamAttributeFromConfigFile)
{


}


#region IDBConnectionString Members

  /// <summary>

/// This method gets called from skelta when a connection string is expected for DB operation.

/// </summary>

/// <param name="AppName">Application Name.</param>

/// <param name="InnerTextValueFromDataSourceNode">This parameter is maintained for backward compatibility and does not provide any value </param>

/// <returns></returns>


public string GetConString(string AppName,object InnerTextValueFromDataSourceNode)
{

return"server=localhost;database=skelta;uid=sa;pwd=;Pooling=False;";

}
#endregion

}

Related Links
TitleResults for “How to create a CRG?”Also Available in