RAD Studio for Microsoft .NET
ContentsIndex
PreviousUpNext
Adding Aggregate Values with DBWebAggregateControl

You can use DBWebAggregateControl to apply one of several standard aggregation functions to a data column. The control displays the aggregate value in a text box, which also support a linked caption.

Note: DB Web Controls (Borland.Data.Web namespace) are being deprecated in 2007. You should use standard Web controls instead.

To create and configure a DBWebAggregateControl

  1. Create a new ASP.NET web application and add your database connection, data adapter, dataset, and DBWebDataSource component to the application..
  2. Set the Active property of BdpDataAdapter to True.
  3. Place a DBWebAggregateControl component on the Web Form Designer.
  4. Set the DBDataSource property of the DBWebAggregateControl to your DBWebDataSource1, which is the default name of the DBWebDataSource component.
  5. Set the TableName property.
  6. Choose the AggregateType property value from the drop down list.
  7. Choose the ColumnName property from the drop down list. The text box is filled with the value based on the type of aggregate you selected and the values in the column you selected.
    Note: If you think there may be NULL values in your selected column, set the IgnoreNullValues property to True, otherwise you may get an error.

To set the caption for DBWebAggregateControl

  1. In the Object Inspector enter the caption in the Caption property field.
  2. Choose a position from the CaptionPosition property drop down list.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!