Define a recordset

Define a recordset

Now you’ll create a recordset to select the data you want to display. A recordset is a set of information extracted from a database by a database query. (In ASP.NET, a recordset is known as a DataSet.) A database query is a way to request data from a database by using specified search criteria, usually in a language called SQL. You then use the information extracted as a source of content for your dynamic pages.

Dreamweaver provides an easy-to-use interface for creating simple SQL queries (you don’t need to know SQL to create a recordset in Dreamweaver).

You’ll create a recordset that selects all of the values from the COMMENTS table in the tutorial database.

  1. In the Cafe Townsend document open in Dreamweaver, place the insertion point below the Customer Comments heading.
  2. Open the Recordset dialog box or (for ASP.NET) the DataSet dialog box by doing one of the following:
    • In the Insert bar’s Application category, click Recordset or (for ASP.NET) click DataSet. This is a picture of the feature being described.
    • Select Window > Bindings to open the Bindings panel; then click Plus (+) and select Recordset or (for ASP.NET) DataSet.

    The Recordset dialog box or (for ASP.NET) DataSet dialog box appears.

    This is a picture of the feature being described.

  3. In the Name text box, enter rs_Comment.
  4. In the Data Source pop-up menu (ColdFusion) or Connection pop-up menu (other server page types), select connTownsend.

    The Recordset or DataSet dialog box updates with data from the database.

    This is a picture of the feature being described.

  5. If a user name and password are associated with the data source or connection, enter them. If you didn’t provide a user name or password when you set up the data source, leave these boxes blank.
  6. In the Table pop-up menu, leave COMMENTS selected.
  7. In Columns, make sure All is selected to select all columns of the table.
  8. Leave the Filter pop-up menu set to None to select all rows of the table.
  9. In the first Sort pop-up menu, select LAST_NAME, and in the second pop-up menu, select Ascending.

    This step specifies that the retrieved records are listed in alphabetical order by customer last name.

    This is a picture of the feature being described.

  10. Click Test to test the recordset or DataSet.

    This is a picture of the feature being described.

    The records from the database that match your recordset or DataSet selection criteria are displayed in the Test SQL Statement window. In this case, you selected all the data in the table.

  11. Click OK to close the Test SQL Statement window.
  12. Click OK to close the Recordset or DataSet dialog box and create a recordset or DataSet.

    The recordset appears in the Bindings panel. The Document window doesn’t change.

    This is a picture of the feature being described.



Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Adding Content to Pages
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly
 
ASPTreeView.com
 
Evaluation has ЅјАёЦіГЩЙМОexpired.
Info...