Tuesday, August 25, 2009

continued data base

Data base


SQL = structured Query Language

There are two types of data bases flat flie and relational


insert / input
Delete
update
select are used to enter or edit information.

fields are columns and records are rows in a data base table.
SQL = structured Query Language

Dim strSQLStrings() As String = {"SELECT * FROM ApprovedTravelRequests", _
"SELECT [Travel Cost] FROM ApprovedTravelRequests", _
"SELECT [Travel Cost],Location FROM ApprovedTravelRequests", _
"SELECT * FROM ApprovedTravelRequests WHERE Location = 'Richmond, VA'", _
"SELECT * FROM ApprovedTravelRequests WHERE Location LIKE 'R%'"}

"SELECT * FROM ApprovedTravelRequests WHERE Location LIKE '%R'"}
returns anything in which you chose ie letter
"SELECT * FROM ApprovedTravelRequests WHERE Location LIKE '%A%'"}
this returns anything in which the character you chose for the range or record


"SELECT * FROM ApprovedTravelRequests WHERE Location [Last Name]LIKE '%A%'"}
'[LAST NAME] square brackets used for spaces between names
these are the conditions to evaluate whether the condition is true or not

<
>
>=
<=
<>
=


"SELECT * FROM ApprovedTravelRequests WHERE [Travel Cost] = 1000 "}
To find all costs of the feilds in the table

return feilds greater than

"SELECT * FROM ApprovedTravelRequests WHERE [Travel Cost] <= 1000 "}

return feilds less than


AND

"SELECT * FROM ApprovedTravelRequests WHERE [First Name] = 'Janet' And [Last Name] = 'Dunford'"}

OR

"SELECT * FROM ApprovedTravelRequests WHERE [First Name] = 'Janet' or [Last Name] = 'Tirrel'"}
'And is the operator that looks for both names and the or looks for either name.
"SELECT * FROM ApprovedTravelRequests WHERE [Last Name] LIKE '%LAS'"}
'%LAS ANYTHING BEFORE IT OR AFTER IT wild card character


"SELECT * FROM ApprovedTravelRequests WHERE Location = 'chicago, illinois' And [Purpose for Travel] = 'Financial Seminar'", _
"SELECT * FROM ApprovedTravelRequests WHERE Location = 'chicago, illinois' OR [Purpose for Travel] = 'Financial Seminar'"}

Data Base

Data base
Data Base There are two types of data, first is relational and the second is flat file.
Flat file is an excel data base, ie spreedsheets.
Tables in access
In tables on Data base there are a few important keys to remember,Every coloumn is a field Every row is a record,Every table has a primary key you can have only one primary key for each table,this is a unique feature key for the table.
You need to define an id field.
To find some thing you need remember Id,
ID is the king. and key to everything you need for finding what you need.

Monday, August 10, 2009

Arrays

Arrays


Dim MyVariable As DataType = x
Dim StrName As String ="rach"
DimArray (5) As DataType
DimStrNames(2) As String
StrNames(0) = "rach"
StrNames(1) = "pam"
StrNames(2) = "david"


Declare and populate an array.
This means you can use as many or as little as you like.
Dim chMenu() As char ={"a","A","b"}

Loops



Dim intDinnerBooking(2) As Integer
->Dim strNames(2) As String
->Loop to populate


0 1 2
strNames "rach" "pam" "david"







0 1 2

intDinnerBookings 4 2 3






Dim ItemArray() As String = {"x","y","z"}
Dim intCount AsInteger

'declared a count integer
length is a property
length returns the number of elements not the upperbound.



For intCount= 0 To ItemArray.Length-1
lstbox.items.add(ItemArray(0)) 'this line of code is always going to return.
also requires a number even if zero 0
lstbox.items.add(ItemArray(intCount))


intCount can be used or declared as a varible


Next
listbox

intCount= 0 x
intCount=1 y
intCount=2 z

if no -1
the loop will count 4

The data in an array is often for an organized array
telephone directory is sorted by last name making this easier to search and locate family or friends.
When the sort procedure is applied to an array the lowest value is placed in the first element in th array with an index of zero the next lowst place is placed in the 2nd array and so on until the largest value is stored in the higher element of the array.

Dim intAges() as Integer ={16, 64, 41, 8, 19, 81, 23}
Array sort(intAges)


Binary search goes to the middle and starts search in the middle.
sort array
Sequential order
Dim loadsofNumbers (999) As integer

- populated
search for = 22

- sorted
0 - 1000

- binary search
500

if what you are searching for is less than then it dstroys.






















Chapter 8 revise and finalise.

Chapter 8 completed,


In class we worked on functions.



Public function MultiplyAge(intAge As Integer) As Integer


intAge = intAge *3

Return intAge Multiply age(*)
End Function

" This can also be used as a procedure by changing the public function to a Public sub."

Public Sub MultiplyAge(intAge As Integer) As Integer

lbl = intAge lbl.text = Multiply age(*)

End Sub

Try-catch

User not entering numbers,
Also fixes errors.

A bad thing can happen or a few bad things can happen and so a try-catch statement is used to make sure that what is entered is a number and not text.

Over flow exception = a value exceeds its assigned data type.
Format exception = a varaible is converted to another type that is not possible.

Monday, July 20, 2009

recapping last term

SDLC software development life cycle

regional analysis
gui design
object design
code
testing
document

Class Diagrams

object name
JAKE

properties
what object has ie. age name
Beard - patchy
Car - sedan
Head wear - Beany

methods

what the object does ie. turn on, turn off.

New ()
Shake ()
Go to school (beany beanytowear)

Monday, March 30, 2009

UML class diagram

A class diagram is a pictorial representation of the detailed system design. Design experts who understand the rules of modeling and designing systems design the system's class diagrams. A thing to remember is that a class diagram is a static view of a system. The structure of a system is represented using class diagrams. Class diagrams are referenced time and again by the developers while implementing the system.
A class diagram is composed primarily of the following elements that represent the system's business entities:
Class: A class represents an entity of a given system that provides an encapsulated implementation of certain functionality of a given entity. These are exposed by the class to other classes as methods. Apart from business functionality, a class also has properties that reflect unique features of a class. The properties of a class are called attributes. Simply put, individual members of a family of our family tree example are analogous to classes in a class diagram.
As an example, let us take a class named Student. A Student class represents student entities in a system. The Student class encapsulates student information such as student id #, student name, and so forth. Student id, student name, and so on are the attributes of the Student class. The Student class also exposes functionality to other classes by using methods such as getStudentName(), getStudentId(), and the like. Let us take a look at how a class is represented in a class diagram.

vb.net open dialog box

The Open File Dialogue Box
In most programmes, if you click the File menu, and select the Open item, a dialogue box is displayed. From the dialogue box, you can click on a file to select it, then click the Open button. The file you clicked on is then opened up. We'll see how to do that from our menu. (Except, the file won't open yet - only the dialogue box will display, and then name of the chosen file. You'll learn how to open files in a later section.)
First, place two textboxes on your form. In the properties box, locate the MultiLine property. It is set to False by default (which is why you can't change the height of textboxes). Change this value to True.
Type some default text for the Text Property of textbox1. Change the Font size to 14 points.
We'll work with these textboxes when we do the Edit menu. So let's leave them for now.
When we click on File > Open from our menu, we want the Open dialogue box to appear. This is fairly straightforward in VB.NET. In fact there is even a control for it!
Open up your toolbox, and locate the control called "OpenFileDialog". You might have to scroll down to see it.