
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:
Open the WebForm1.aspx form.
Drag-and-drop six TextBoxes and six Labels from the Web Forms tab in the Toolbox to the WebForm1.aspx form.
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. |
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 |
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 |
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 |
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 |
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 |
Click the ... button from the ControlBindings property of the DBDataBinders Properties dialog box.
The ControlBinder Collection Editor dialog box displays.
Click the Add button to add as many ControlBinders as necessary. In this tutorial, six ControlBinders are added.
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 |
Click OK.