1 / 12

Using Objects to Model Tabular Data

Using Objects to Model Tabular Data. The Story so far. System split into layers – maintainability & re-use Database – queries, tables, rows, columns & parameters Range of objects allowing us to control different parts of the computer using their methods & properties Variables – RAM

barbie
Download Presentation

Using Objects to Model Tabular Data

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. Using Objects to Model Tabular Data

  2. The Story so far • System split into layers – maintainability & re-use • Database – queries, tables, rows, columns & parameters • Range of objects allowing us to control different parts of the computer using their methods & properties • Variables – RAM • Controls – Interface • DataConnection class – database • Introduced a lot of coding concepts, assignment, sequence, selection, validation, functions, parameters to name a few

  3. Overview of Driving Test 2

  4. How do we Manipulate a List of Data?

  5. Array Lists • Our list of data… • Fred • Wilma • Barney • Betty • The code… • Dim Attendees As New ArrayList • Attendees.Add("Fred") • Attendees.Add("Wilma") • Attendees.Add("Barney") • Attendees.Add("Betty")

  6. The Count Property Dim Attendees As New ArrayList Dim ItemCount As Integer ItemCount = Attendees.Count

  7. Index Numbers • Rather like house numbers • Zero bound (This will drive you mad!) Value Index Fred 0 Wilma 1 Barney 2 Betty 3

  8. RemoveAt Method Value Index Fred 0 Wilma 1 Barney 2 Betty 3 • Attendees.RemoveAt(2) • Which record will be removed?

  9. Changing a List Entry • What will the following do? Attendees.Add("Fred") Attendees.Add("Wilma") Attendees.Add("Barney") Attendees.Add("Betty") Attendees.Item(2) = "Bamm Bamm"

  10. Data Tables • We said all of that to introduce this… • qry_tblAddress_SelectAll • SELECT * • FROM tblAddress

  11. Presentation Layer Code • How do we get at the results of the query?

  12. QueryResults HouseNumber = MyAddresses.QueryResults.Rows(1).Item("HouseNo") Street = MyAddresses.QueryResults.Rows(3).Item("Street") AddressNo = MyAddresses.QueryResults.Rows(0).Item("AddressNo") DateAdded = MyAddresses.QueryResults.Rows(3).Item("Active") CountyCode = MyAddresses.QueryResults.Rows(1).Item(“HouseNo") CountyCode = MyAddresses.QueryResults.Rows(4).Item(“CountyCode")

More Related