Homework Assignment #15


Most students completed this in class #13 on 5/14/2007.

Part 1: create an Access db file with 30 records as follows:

Start 
 All programs
  office
   access
    file
     new
      blank database

   location
    on the e: drive
     in a subdir which is your 3 char login
      people.mdb

file
 get external data
  import
   U:\Moritsugu_Steven\
    select text files
     people.txt
      click Finish

dbl click People
 which should show 30 lines of data in access
  dbl click each column to change the col heading

    last    first   middle   phone   birth   state

close Access

Review p 470-479 on the DataList control

Start vis studio
 new web site
  tool box
   data (section)
    dbl click: DataList

     click DataList arrow in upper right of DataList
      choose data source
       
        Access Database
         location
          e:\z9z\people.mdb

"specify columns from table or view"
  click on *   (all fields)
 
click: where
 column: birth
 operator: >
 source: none
 value: 1875
 add
 ok
 next
 test query
 ok
 entries 1-30 should appear but 12 is missing
  since born in 1875

previous
 order by
  last
   ascending
    ok
next 
 test query
  ok
   
finish

start without debugging
 you should see your data on the web page
  clost your web page

move cursor to bottom of form
 add from the toolbox
  data
   gridview  (this is not in your text book, new w/ visual studio 2005)
    choose data source
     AccessDataSource1

Start without debugging
 after the data list
  you should see your gridview
   of the same data
    in a nice table format
   
stop web page
 click the arrow in upper right of grid view
  turn on Enable Paging
   (keep Page size of 10 in properties)
    start without debugging

stop web page
 turn on Enable sorting
  in the Gridview
   start without debugging
    now each column heading can be clicked to sort on that column

stop web page
 add a label to the form (under the standard section of the toolbox)
 turn on Enable selection
  dbl click on the grid view to enter code

    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged

        Label1.Text = GridView1.SelectedValue

    End Sub

show your web page to the instructor to get credit