EngineManagerCreateEngine Method (CreateEngineOptions)

Creates an IEngine object using the specified options.

Namespace:  Dundas.BI
Assembly:  Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (24.3.0.1000)
Syntax
public static void CreateEngine(
	CreateEngineOptions options
)

Parameters

options
Type: Dundas.BICreateEngineOptions
The options for creating the engine.
Exceptions
ExceptionCondition
ArgumentNullExceptionoptions is .
ArgumentOutOfRangeException The host identifier is too long (The length of the host identifier plus the length of the computer name plus 3 must be less than MaxNameLength.
Remarks
Once this method is called, the current engine instance may be accessed using Current.
Examples

This example demonstrates how to create the Dundas BI engine start the Dundas BI engine, log on, and shutdown the Dundas BI engine.

C#
using Dundas.BI;
using Dundas.BI.AccountServices;

   ...

// Create the engine.
EngineManager.CreateEngine(
    // Path to the application's data folder. Type: System.String
    @"C:\Program Files\Dundas Data Visualization Inc\Dundas BI\Instances\Instance1\www\BIWebsite\App_Data"
);

try
{
    EngineManager.StartEngine();

    // Create a caller context not associated with any session.
    using(Engine.Current.GetService<ICallerContextService>().CreateAndSetCurrentContext(null))
    {

        LogOnResult logOnResult = Engine.Current.GetService<ILogOnService>().LogOn(
            // The account name. Type: System.String
            "admin",
            // The password. Type: System.String
            "1234",
            // Delete other sessions for the logon to succeed. Type: System.Boolean
            true,
            // Culture to associate with the session, or null to use the default. Type: System.Globalization.CultureInfo
            null
        );

        // Set the current session ID.
        Engine.Current.GetService<ICallerContextService>().CurrentContext.SetCurrentSessionId(
            logOnResult.Session.Id
        );

    }

}
finally
{
  // Shutdown the engine. 
    EngineManager.ShutdownEngine();
}
See Also