1 / 17

Lesson 9

Lesson 9. Working with your database. What are Code Builders?. Working with databases are a breeze with four code builders to work with your data. How Code Builders Work. Manipulating your database is basically the job of these four Code Builders Create a new ASP.NET file and call it Custom

carlow
Download Presentation

Lesson 9

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. Lesson 9 Working with your database

  2. What are Code Builders? Working with databases are a breeze with four code builders to work with your data

  3. How Code Builders Work • Manipulating your database is basically the job of these four Code Builders • Create a new ASP.NET file and call it Custom • Click on code • Click on Custom Controls in the Toolbox

  4. SELECT Data Method • SELECT-creates a function that uses a SQL SELECT statement to access a database table and returns the data • Drag the SELECT Data Method on your work area Click the down arrow aside of Database: • Select the Movie Database and click OK

  5. Construct a SELECT query Click the box where the * is Click Next This is what you have on your screen

  6. Test Query Click on Test Query to view your database

  7. Creating a method Type AllBond Click Finish

  8. Back to Design • Click on Design Tab • Drag a DataGrid to the workspace

  9. DataGrid Properties • Scroll down to the DataSource Properties for DataGrid1 • Type AllBond() which was the method that we just created

  10. Page Properties Click the down arrow to the right of the DataGrid1 title and select Page

  11. Page Properties • This is the last step to bind your database to DataGrid1 • Click on the lightning bolt which is Event

  12. Load Double Click over the Load Property

  13. Code to bind • Type DataGrid1.DataBind() • Press F5 to view • Congratulations! • Remember you could have only selected the fields that you wanted to show

  14. Here’s your database

  15. Changing your view • Click on the Design Tab on your workspace • Click on your DataGrid1 • Scroll down and Select Classic1 and click OK • Press F5 to view

  16. Custom Design your DataGrid • Click on DataGrid • Now click Property Builder located to the right of AutoFormat • Click on Format,DataGrid

  17. More Changes • Change Forecolor to Navy • Change Back Color to Silver • Change Font Name to Aerial Black • Change Font size to Medium and click Bold • Click ok • Press F5 to view

More Related