Designing the Web Application

In this step we design the Web application and add three Table controls. The PRODUCTS table is the main table from which the data is read. The CATEGORIES and PROVIDERS tables load data into combo boxes. Additionally, a DBDataBinder control is added to bind the PRODUCTS data to the text fields on the form.

To design the Web Application:

  1. Open the WebForm1.aspx form.

  2. Drag-and-drop six TextBoxes and six Labels from the Web Forms tab in the Toolbox to the WebForm1.aspx form.

  3. Drag-and-drop two DBCombo controls, three Table controls, and one DBDataBinder control from the Pick Data Provider Web Extensions tab in the Toolbox to the WebForm1.aspx form.

NOTE–

Do not confuse these controls with the controls found in the Toolbox under the Pick Data Provider tab. These controls are used with Windows form applications only.

  1. Set the properties for the Labels from the Properties dialog box. In this tutorial, the properties are set as:

 

Label

Text Property

Label1

Product ID

Label2

Description

Label3

Category

Label4

Provider

Label5

Stock

Label6

Price

 

  1. Set the properties for the TextBoxes from the Properties dialog box. In this tutorial, the properties are set as:

 

TextBox

(ID) Property

TextBox1

txtProductID

TextBox2

txtDescription

TextBox3

txtCategories

TextBox4

txtProvider

TextBox5

txtStock

TextBox6

txtDatabase

 

  1. Set the properties for the Buttons from the Properties dialog box. In this tutorial, the properties are set as:

 

Button

Text Property

(ID) Property

Button1

Read

btnRead

Button2

Save

btnSave

Button3

Delete

btnKill

Button4

New

btnZero

 

  1. Set the properties for the Table controls from the Properties dialog box. In this tutorial, the properties are set as:

 

Table

(Name) Property

ConnectionName Property

TableName Property

Table1

t_Products

Connection1

PRODUCTS

Table2

t_Providers

Connection1

PROVIDERS

Table3

t_Providers

Connection1

CATEGORIES

 

  1. Set the properties for the DBDataBinder control from the Properties dialog box. In this tutorial, the properties are set as:

 

DBDataBinder

Table Property

DBDataBinder1

t_Products

 

  1. Click the ... button from the ControlBindings property of the DBDataBinders Properties dialog box.

The ControlBinder Collection Editor dialog box displays.

  1. Click the Add button to add as many ControlBinders as necessary. In this tutorial, six ControlBinders are added.

  2. Set the properties for each of the new ControlBinders. In this tutorial, the properties are set as:

 

ControlBinder

Control Property

FieldName Property

ControlBinder1

txtProductID

@ID

ControlBinder2

txtCategories

CATEGORY

ControlBinder3

txtDescription

DESCRIPTION

ControlBinder4

txtPrice

PRICE

ControlBinder5

txtProviders

PROVIDER

ControlBinder6

txtStock

STOCK

 

  1. Click OK.