1 / 34

DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH

DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH. Raymond Frost – John Day – Craig Van Slyke. Chapter 12 Accessing Databases from Web Applications with Microsoft ASP.NET Part A. Active Server Page Model. Exhibit 12-1: The Basic Active Server Page Model. Files for a Web Application.

alaina
Download Presentation

DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 12 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Raymond Frost – John Day – Craig Van Slyke Chapter 12 Accessing Databases from Web Applications with Microsoft ASP.NET Part A

  2. Chapter 12 Active Server Page Model Exhibit 12-1: The Basic Active Server Page Model

  3. Chapter 12 Files for a Web Application Exhibit 12-2: The Active Server Page File Structure

  4. Chapter 12 An Example Web Application Exhibit 12-3: A Simple Web Page

  5. Chapter 12 Web Developer Environment Exhibit 12-4: The Web Developer Development Environment

  6. Chapter 12 Creating a New Web Site Exhibit 12-5: The New Web Site Dialog Box

  7. Chapter 12 Source View Exhibit 12-6: The Initial Display After Creating the Application

  8. Chapter 12 Design View Exhibit 12-7: The Simple Web Application in Design View

  9. Chapter 12 The Toolbar Drag a Button and a Label Control onto the design Exhibit 12-8: Displaying the Toolbox

  10. Chapter 12 The Completed Design Exhibit 12-9: The Design for the Simple Web Application

  11. Chapter 12 Button Control Properties The Text property will be changed to “Time” so that text will be displayed on the button. Exhibit 12-10: The Properties for the Button

  12. Chapter 12 Programming the Button Double-click the button to display the event code associated with the button. Exhibit 12-11: The Code for the Button Click Event

  13. Chapter 12 Intellisense Label1.Text = DateTime.Now Once you type part of the code and reach a period, the drop-down list with available options will be displayed. Exhibit 12-12: Using Intellisense to Enter Code

  14. Chapter 12 Testing the Application When the Time button is clicked, the label will display the current time. Exhibit 12-13: The Results of the Simple Web Application

  15. Chapter 12 The Application to Display a Table Exhibit 12-14: The Application to Display the MEMBER Table

  16. Chapter 12 SqlDataSource Control Drag a copy of the SqlDataSource control to connect the application to a database. Exhibit 12-15: Adding the SqlDataSource Control to the Project

  17. Chapter 12 Common Tasks When you click on the arrow in the upper right corner of the control, the common tasks for that control will be shown. In this case, the next task is to configure the data source. Exhibit 12-16: Common Tasks for the SqlDataSource Control

  18. Chapter 12 Configure Data Source Wizard First, create a new connection. Exhibit 12-17: Adding the SqlDataSource Control to the Project

  19. Chapter 12 Configure Data Source Wizard Select the type of data source: in this case, Microsoft SQL Server. Exhibit 12-18: Other Data Sources Available for the SqlDataSource Control

  20. Chapter 12 Configure Data Source Wizard For an SQL Server Data Source, select the server: Localhost is for a testing the application against a local copy of SQL Server. Enter the user name and password to gain access to the database. Select the database. Exhibit 12-19: The Add Connection Dialog Box

  21. Chapter 12 Configure Data Source Wizard The newly created connection will be used so just click Next>. Exhibit 12-20: Finishing the Selection of a Connection

  22. Chapter 12 Configure Data Source Wizard Saving the connection will depend on whether your environment allows the use of a web.config file. If not, you can skip this step. Exhibit 12-21: Saving the Connection

  23. Chapter 12 Configure Data Source Wizard A select statement is constructed to retrieve the needed data. Exhibit 12-22: Finishing the Selection of a Connection

  24. Chapter 12 Configure Data Source Wizard The select statement can be tested to make sure it is correct. Exhibit 12-23: Testing the Query

  25. Chapter 12 The GridView Control Once the Data Source control is configured, drag a GridView control onto the design so it can be used to display the data. Exhibit 12-24: The GridView Control

  26. Chapter 12 GridView Common Tasks Use the GridView Common Tasks to choose a data source to display through the GridView. Exhibit 12-25: Common GridView Tasks

  27. Chapter 12 Additional Common Tasks Once a data source is selected for the GridView, the common tasks will include additional options for paging, sorting and other features such as Auto Format. Exhibit 12-26: The GridView After Selecting the Data Source

  28. Chapter 12 Auto Formatting When you select a scheme from the list on the left, an example will be displayed at the right. Exhibit 12-27: Auto Format Options for the GridView

  29. Chapter 12 The Finished Design Exhibit 12-28: The Final Design for the Application

  30. Chapter 12 Oracle Data Sources The SqlDataSource can also be used for accessing data in an Oracle database. In the wizard, simply select “Oracle Database”. Exhibit 12-29: Selecting the Oracle Data Source

  31. Chapter 12 Oracle Data Sources To connect to an Oracle database, specify a server name, user name and password. Exhibit 12-30: Setting Connection Properties in the Oracle Data Source

  32. Chapter 12 Oracle Data Sources An Oracle Data Source will be named with the server name and user name. Exhibit 12-31: Selecting an Oracle Data Connection

  33. Chapter 12 Oracle Data Sources Like SQL Server data sources, an Oracle data source can also be saved in the web.config file. Exhibit 12-32: Saving the Oracle Connection

  34. Chapter 12 Oracle Data Sources The select statement for an Oracle database is constructed the same way as SQL Server. Exhibit 12-33: Configuring the Select Statement

More Related