Tuesday, October 19, 2010

Content Management Systems

Joomla = makes websites, manages sites, blogs and polls, flexibility, easy to use.

Drupal = same as above

Word Press = mainly blogging but also same as the two above

Moodle = education based, interactive, classes students

Zen Cart = shopping and e commerce

Monday, October 18, 2010

Select Operation

Public Class Form1

    'START OF DATABASE OPERATION!!!!!!

    Private Sub btnGetCustomerNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetCustomerNames.Click

        Dim strConnectionString As String = "Provider = Microsoft.Ace.OLEDB.12.0;" & _
        "Data Source = F:/MyFolder/Filters.accdb "

        Dim MyConnection As New OleDb.OleDbConnection(strConnectionString)

        MyConnection.Open()

        Dim MyCommand As New OleDb.OleDbCommand("SELECT * FROM customers", MyConnection)

        Dim MyDataSet As New Data.DataSet

        Dim MyDataAdapter As New OleDb.OleDbDataAdapter(MyCommand)

        MyDataAdapter.Fill(MyDataSet, "QueryResults")

        MyConnection.Close()

        'END OF DATABASE OPERATION!!

        LstCustomerNames.DataSource = MyDataSet.Tables("QueryResults")

        LstCustomerNames.DisplayMember = "FirstName"

        LstCustomerNames.ValueMember = "CustomerID"

    End Sub
End Class

Blog Task: Warning

Using the NullReferenceExceptionDemo project:

    1. What warning does the Visual Studio IDE provide with regards to using variables before they have been assigned a value? What does the warning look like? What does it say?
    2. Comment out the incorrect code and uncomment the correct code. Substitute the string parameter “Rach” with your own name.
    3. Post a screen shot of the resulting message box.

Connection String to a Database String

Applications and Databases

We keep them separate

1 Connection string -Address of the supermarket

DB Drivers
Path to DB

2 Connection Object - Car/Road
Using the connection string

3 Command Object-Shopping List
SQL statement to be executed
Using the connection object

4 Data Adapter- The Shopper
Uses the connection object
Retrieves Items

5 Data set- The Pantry
Select- No Mod
Insert- creates a new record
Update- Edit
Delete

4 and 5 only used during the SELECT process

Sunday, October 10, 2010



Database Questions Blog Task 1

1. What does a column in a table represent?FIELD

  1. Field
  2. Record

2. What does a row in a table represent?RECORD
  1. Field
  2. Record
3. What does DBMS stand for? Database Management Systems
4. What is a primary key in a table used for?

It is is a field that uniquely identifies each record. This field can be used to link records across multiple tables.
5. Why is the ID column such a useful field? ID IS KING, “If you know the ID of a record, you can do anything you want with that record”
6. What Access data type would you use to store the string “18 Segway Drive, Moonville” ?TEXT
7. What Access data type would you use to record True/False values?YES/NO
8. What Access data type would you use to store a number?NUMBER
9. What Access data type would you use to store a long string such as an essay or 
report?MEMO
10. A database is a collection of what? RELATED DATA THAT IS STORED IN A STRUCTURED FORMAT
11. A table is made up of what? ROWS AND COLUMNS
12. What is a record? THE ROWS IN A TABLE
A record is a group of related fields containing all of the information about a specific person, place or thing. 
13. Are spaces allowed in field names? NO THEY ARE NOT

Create A Database

My Databases





Monday, October 4, 2010

IO-Input and Output

Stream Reader
Stream Writer

File Object

OutFile = IO.File.AppendText ("x.txt")

Append Text = Open a file for Append so that we can add text to it and this is also a writer

Create Text = This is a writer

Read Line = Will read one line

Peak = Method that peeks inside the files that is associated with the Peek File, if there are no more lines to write the peek function will return a negative one, if there are no more items in the list

Sunday, October 3, 2010

BLOG TASK 2

Answer the following questions:


1. Which of the following procedures can be used to read information from a sequential access file? ALL OF THEM?
  1. AppendText
  2. CreateText
  3. OpenText


2. Which of the following reads a line of text from the file associated with the inFile variable and assigns the line of text (excluding the newline character) to the msg variable? MY ANSWER: msg = inFile.ReadLine
  1. msg = inFile.Read
  2. msg = inFile.ReadLine
  3. inFile.ReadLine(msg)


3. Write the statement required to close the file associated with the inFile variable.
inFile.Close()


4. If a sequential access file contains another character to read, what does the Peek method return?
The Peek method returns the character


5. If a sequential access file does not contain another character to read, what does the Peek method return?
it will return the number -1 (negative 1)

BLOG TASK 1

Answer the following questions:


1. Which of the following methods can be used to open a sequential access file? ALL OF THE ABOVE
  1. AppendText
  2. CreateText
  3. OpenText
  4. all of the above


2. Which of the following writes the contents of the favouriteTuneTextBox’s Text property, followed by the newline character, to the sequential access file associated with the outFile variable?

MY ANSWER IS : outFile.Write(favouriteTuneTextBox.Text)
  1. outFile.Write(favouriteTuneTextBox.Text)
  2. outFile.WriteLine(favouriteTuneTextBox.Text)
  3. outFile.WriteNext(favouriteTuneTextBox.Text)
  4. none of the above


3. What does IO in the syntax stand for?

INPUT OUTPUT!