Presentation is loading. Please wait.

Presentation is loading. Please wait.

Windows Database Applications CIS 341 Chapter 11.

Similar presentations


Presentation on theme: "Windows Database Applications CIS 341 Chapter 11."— Presentation transcript:

1 Windows Database Applications CIS 341 Chapter 11

2 Objectives Declare and reference collections Collection types Data Structures Object collection Items collection of a list box

3 Referencing Collection Items DsStoreSales1.Tables(“Stores”) DsStoreSales1.Tables(0)

4 Collection Class ArrayListContains, Insert, RemoveAt, and Sort BitArrayBoolean values CollectionBaseUsed for inheritance DictionaryBaseUsed for inheritance HashtableAdd, Remove QueueEnqueue, Dequeue, Peek SortedListAdd, Remove, and RemoveAt StackPush, Pop, Peek

5 Stacks mstkList.Push(strItem) strItem = mstkList.Peek() mstkList.Pop()

6 Queue mqueList.Enqueue(strItem) strItem = mqueList.Peek() mqueList.Dequeue()

7 Hash Tables Strkey = strItem.GetHashCode.ToString() mhshTable.Add(strKey, strItem) strItem = lstLanguages.SelectedItem.ToString() strKey = strItem.GetHashCode mhshTable.Remove(strKey) For Each strItem In mhshTable.Values lstLanguages.Items.Add(strItem) Next

8 Sorted List strKey = strItem.Substring(0,3) msrtList.Add(strKey, strItem) lstLanguages.Items.Clear() For each strItem in msrtList.Values lstLanguages.Items.Add(strItem) Next

9 Collection of Objects Dim objStudent As New Student(txtName.Text, CDec(txtGPA.Text)) mcolStudents.Add(strKey, objStudent) objStudent = CType(mcolStudents.Item(strKey), Student)


Download ppt "Windows Database Applications CIS 341 Chapter 11."

Similar presentations


Ads by Google