dotConnect for SQLite Documentation
Devart.Data.SQLite Namespace / SQLiteConnection Class / RegisterAuthorizer Method
A handler to register. Pass a null reference (Nothing in Visual Basic) to remove the registered handler.

On this page
    RegisterAuthorizer Method
    On this page
    Registers a handler that SQLite calls to authorize actions of SQL statements when they are compiled.
    Syntax
    'Declaration
     
    Public Sub RegisterAuthorizer( _
       ByVal handler As SQLiteAuthorizerHandler _
    ) 
    public void RegisterAuthorizer( 
       SQLiteAuthorizerHandler handler
    )

    Parameters

    handler
    A handler to register. Pass a null reference (Nothing in Visual Basic) to remove the registered handler.
    Remarks

    The connection must be open. Otherwise, a System.InvalidOperationException is thrown.

    You cannot register more than one authorizer. When you register a new one, the previous one is unregistered. When the connection is closed, including when it returns to the connection pool, the authorizer is unregistered.

    If the handler returns SQLiteAuthorizerReturnCode.Deny or throws an exception, the statement is rejected with an SQLiteException that has the SQLiteErrorCode.Auth error code. The exception thrown by the handler is available in the InnerException property.

    The authorizer isn't called for the statements that dotConnect for SQLite executes to retrieve metadata and to manage TransactionScope transactions.

    The handler must not do anything that will modify the connection it is registered in. This includes SQL statement preparation and execution, data retrieval, and so on.

    For more information and examples, see Restricting SQL Statements with an Authorizer.

    Exceptions

    Exception Description
    InvalidOperationException Thrown when the connection is not open.
    See Also