Harness proD API Help
EPLAN.Harness.API Namespace / Library Class / CreateSqlLibrary Method / CreateSqlLibrary(String,String) Method
Server name.
The name of the database being created.
Example
In This Topic
    CreateSqlLibrary(String,String) Method
    In This Topic
    Create new MS SQL Server library using windows authentication.
    Syntax
    public SqlLibraryConnection CreateSqlLibrary( 
       string server,
       string databaseName
    )

    Parameters

    server
    Server name.
    databaseName
    The name of the database being created.

    Return Value

    Connection to the created MS SQL Server library.
    Exceptions
    ExceptionDescription
    Api is not in an initialized state. You can get current state from Status property. If API is uninitialized, you can initialize it by calling Init(String,String[]) method. If API is in failed state, you can not resurrect it.
    Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property.
    Argument is null.
    The operation was not successful.
    Remarks

    After this method is called the new MS SQL Server library is only created, not connected.

    If connection is required use the ConnectToLibrary(BaseLibraryConnection,String,Boolean) method and pass it the returned library connection.

    Example
    This example shows how to create new MS SQL Server library using windows authentication.
    Library library = Library.GetInstance();
    
    library.CreateSqlLibrary("server", "database name");
    This example shows how to create new MS SQL Server library and connect to it.
    Library library = Library.GetInstance();
    
    SqlLibraryConnection connection = library.CreateSqlLibrary("server", "database name");
    library.ConnectToLibrary(connection);
    See Also