Working with your database - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Working with your database

Description:

Click on Custom Controls in the Toolbox. SELECT Data Method ... Custom Design your DataGrid. Click on DataGrid. Now click Property Builder located ... – PowerPoint PPT presentation

Number of Views:42
Avg rating:3.0/5.0
Slides: 18
Provided by: briangs
Category:
Tags: database | working

less

Transcript and Presenter's Notes

Title: Working with your database


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
Heres 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
Write a Comment
User Comments (0)
About PowerShow.com