Displaying data is easy using Microsoft® Visual InterDev™. You can connect to a database, specify the set of records to display, and display the records by using data-bound design-time controls, or you can display data directly using script. You can also display data in a grid, showing multiple records from a recordset.
To display data using a data-bound control
The fields are displayed under the Command object in the DataEnvironment folder.
Each dragged field creates a data-bound control that will display the data from that field in the recordset. Text and numeric fields create Textbox controls. Yes/No or True/False (Boolean) fields create Checkbox controls. For more information, see The Data Environment.
You can easily provide navigation (moving from record to record) among the records you display on your Web page with the RecordsetNavbar control.
To provide navigation among records
Tip If the RecordsetNavbar control is not shown in the Toolbox, right-click on the Toolbox, choose Customize Toolbox, and add the RecordsetNavbar control.
The control is inserted onto your ASP or HTML page.
By default, the RecordsetNavbar control provides Move to First, Next, Previous, and Move to Last buttons. You can use these buttons to move among the records displayed on the page. You can also customize the functionality of these buttons by modifying the script that they create. For more information, see RecordsetNavbar Control.
You can move between records in the recordset by calling navigation methods in the recordset script object. When you move, the record you move to becomes the current record.
Important When you navigate to another record, the current record is not automatically saved. Be sure that you have copied data to the current record and saved the record before you call a navigation method. For details, see Updating Records.
To navigate using script
For example, the following shows the handler you might write for a "Next" button.
Sub btnNext_onclick
rsEmployeeList.moveNext
End Sub
If you want to perform a procedure based on navigation, you can write handlers for the onrowenter and onrowexit events. For example, perhaps your application does not simply display only the contents of fields. Instead, you want to use a single text box to display a combination of first and last names.
To do this, you can write a handler for the onrowenter handler that gets values from the recordset, concatenates them, and puts them in a text box. The handler might look like this:
Function rsEmployeeList_onrowenter()
firstName = rsEmployeeList.fields.getValue("lastName")
lastName = rsEmployeeList.fields.getValue("firstName")
txtFullName.value = lastName & ", " & firstName
End function
You can also create a data grid on your Web page using the Grid design-time control. For information on creating a Grid control, see Data-bound Grid Sample and Grid Properties Dialog Box.