RAD Studio for Microsoft .NET
ContentsIndex
PreviousUpNext
Building an Application with DB Web Controls

The following procedures describe the minimum number of steps required to build a simple ASP.NET database application using DB Web Controls and BDP.NET. After generating the required connection objects, the project displays data in a DBWebGrid with a DBWebNavigator. Additional information is provided for other common DB Web Controls. 

Users should already be familiar with creating an ASP.NET project using BDP.NET. 

Building the simple ASP.NET application with DB Web Controls and BDP.NET consists of three major steps:

  1. Prepare an ASP.NET project with BDP.NET or other connection components.
  2. Drag and drop a DBWebDataSource onto the Designer and set its DataSource property to a DataSet, DataView or DataTable.
  3. Drag and drop a DBWebGrid and other control onto the Designer.
Note: DB Web Controls (Borland.Data.Web namespace) are being deprecated in 2007. You should use standard Web controls instead.

To prepare an ASP.NET project for DB Web Controls

  1. Create an ASP.NET project.
  2. Set up BDP.NET or other data access components, setting the DataSource property to an existing DataSet, DataView, or DataTable.
    Tip: For more information about setting up BDP.NET data access components, see the related procedure for building an ASP.NET database application. Instead of using a DataGrid and adding a DataBind call, in the following procedure you use DB Web Controls without a DataBind call.

To configure a DBWebDataSource

  1. Place a DBWebDataSource component on the Designer.
  2. In the Object Inspector, select the DataSource property.
  3. Select an existing data source (by default, this is called dataSet1).

To configure DB Web Controls

  1. Place a DBWebNavigator component on the Designer.
  2. In the Object Inspector, select a data source in the DBDataSource property drop-down.
  3. In the Object Inspector, select a DataTable from the TableName property drop-down.
    Tip: If no TableName is available, verify that the BdpDataAdapterActive property is set to True.
  4. Place a DBWebGrid on the Designer.
  5. In the Object Inspector, select the data source from the DBDataSource property drop-down.
  6. In the Object Inspector, select a DataTable from the TableName property drop-down. The grid displays data.
  7. Place other DB Web Controls as needed.
  8. Set the values for DBDataSource, TableName, and other properties as appropriate.
    Note: For data-aware Column Controls (such as DBWebTextBox, DBWebImage, DBWebMemo, and DBWebCalendar) additionally set the ColumnName property. For data-aware lookup controls (such as DBWebDropDownList, DBWebListBox, and DBWebRadioButtonList), also set the LookupTableName, the DataTextField, and the DataValueField properties.
  9. Choose RunRun. The application compiles and the HTTP server displays a Web Form with a DBWebGrid displaying data.
Tip: Dragging web components from the Tool Palette
places them in an absolute position on an ASP.NET web form. Double-clicking components in the Tool Palette leaves them in ASP.NET flow layout. Flow layout is much easier to manage. For instance, controls in an absolute position on a web form can overwrite other controls if they change sizes at runtime. Overwriting might occur when you add rows to and remove rows from a grid control, making the grid control change size.

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