Active Query Builder 2 .NET Edition reference
ExecSQL Event
Example 



Invoked when the Event Metadata Provider is requested to execute the SQL statement.
Syntax
'Declaration
 
Public Event ExecSQL As ExecSQLEventHandler
'Usage
 
Dim instance As EventMetadataProvider
Dim handler As ExecSQLEventHandler
 
AddHandler instance.ExecSQL, handler
public event ExecSQLEventHandler ExecSQL
public: __event ExecSQLEventHandler* ExecSQL
Remarks
The metadataProvider parameter refers to the metadata provider invoked the event. The sql parameter contains the query to be executed. The schemaOnly flag indicates that there's no need for data retrieval for this query. Return the IDataReader interface through the dataReader parameter.
Example
private void EventMetadataProvider_ExecSQL(BaseMetadataProvider metadataProvider, string sql, bool schemaOnly, out IDataReader dataReader)
{
    dataReader = null;
 
    if (dbConnection != null)
    {
        IDbCommand command = dbConnection.CreateCommand();
        command.CommandText = sql;
        dataReader = command.ExecuteReader();
    }
}
See Also

Reference

EventMetadataProvider Class
EventMetadataProvider Members

 

 


© Copyright 2005-2012 ActiveDBSoft. All rights reserved.

Send Feedback