ComponentOne ADO.NET DataExtender
C1.C1DataExtender.2 Assembly / C1.C1DataExtender Namespace / C1DataViewSet Class / ConnectionOpening Event

In This Topic
    ConnectionOpening Event
    In This Topic
    Occurs before C1DataViewSet opens a connection for data and schema fetching or data updating. This event allows you to set up connection properties such as login attributes before it will be opened.
    Syntax
    'Declaration
     
    Public Event ConnectionOpening As ConnectionOpeningEventHandler
    public event ConnectionOpeningEventHandler ConnectionOpening
    Event Data

    The event handler receives an argument of type ConnectionOpeningEventArgs containing data related to this event. The following ConnectionOpeningEventArgs properties provide information specific to this event.

    PropertyDescription
    Gets the connection that is about to be opened.  
    Remarks
    This event is mainly intended to define login attributes in the connection string of the opening connection, but the other properties can be changed as well.

    To make the process of updating the connection string simple and safe you can use an object of the System.Data.Common.DbConnectionStringBuilder type or of a derived class which is appropriate to the type of connection, for example System.Data.SqlClient.SqlConnectionStringBuilder for the System.Data.SqlClient.SqlConnection.

    See Also