ComponentOne DataObjects for .NET
Viewing the SQL Statement Generated when a TableView is Sorted
DataObjects for .NET Task-Based Help > Viewing the SQL Statement Generated when a TableView is Sorted

When a TableView is sorted, the generated SQL statement is available in the AfterGenerateSql event of the C1DataSetLogic component. To configure this component, follow these steps:

  1. Add a C1DataSetLogic component to your project in the same location as the C1SchemaDef component (usually within a data library project).
  2. Select C1DataSetLogic1 and set its SchemaComponent property to the C1SchemaDef component.
  3. Set C1DataSetLogic1's DataSetDef property to the desired data set.
  4. Create an event handler for the AfterGenerateSql event.
  5. Set a new breakpoint there:
    1. In the Debug menu, select New Breakpoint | Break at Function.
    2. Enter C1DataSetLogic1_AfterGenerateSql in the Function text box and click OK.
  6. Run the project and expand e{C1.Data.GenerateSqlEventArgs}.

The e.Sql argument contains the generated SQL statement.