ComponentOne DataObjects for .NET
BeforeGenerateSql Event (C1ExpressTable)

C1.Data.Express.2 Assembly > C1.Data.Express Namespace > C1ExpressTable Class : BeforeGenerateSql Event
Fired before generating the SQL SELECT statement for fetching table data from the database.
Syntax
'Declaration
 
Public Event BeforeGenerateSql As ExpressGenerateSqlEventHandler
public event ExpressGenerateSqlEventHandler BeforeGenerateSql
Event Data

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

PropertyDescription
ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause. (Inherited from C1.Data.GenerateSqlEventArgs)
ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause. (Inherited from C1.Data.GenerateSqlEventArgs)
ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause. (Inherited from C1.Data.GenerateSqlEventArgs)
ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause. (Inherited from C1.Data.GenerateSqlEventArgs)
The IDbCommand object containing the generated SQL SELECT statement. (Inherited from C1.Data.GenerateSqlEventArgs)
Filter conditions used to fill the data set. These are all filter conditions for all table views in the data set. You need to extract the filter conditions for the particular table view from this argument. (Inherited from C1.Data.GenerateSqlEventArgs)
SQL statement. The programmer can set this argument in the event code to set or modify the SQL SELECT statement used for fetching data. Alternatively, the programmer can set or modify the Command argument to specify the complete command to be executed. (Inherited from C1.Data.GenerateSqlEventArgs)
Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it. (Inherited from C1.Data.GenerateSqlEventArgs)
The table name populated with the SQL SELECT statement.  
Remarks
See Also