CS 390 VB'NET Programming I - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

CS 390 VB'NET Programming I

Description:

Radio Box. can select only one w/in same container .Checked ... Dim cb As New OleDbCommandBuilder(da) count = da.Update(dt) 9/20/09. HE #1 Review. 18 / 18 ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 19
Provided by: socratist
Category:
Tags: net | cb | programming | radio

less

Transcript and Presenter's Notes

Title: CS 390 VB'NET Programming I


1
CS 390 VB.NET Programming I
  • Final Exam Review

2
CS 390 HE 1 - Review
  • worth 300 pts
  • covers ch 1 7 200 pts (Review HE's) ch 8
    Sequential Files 50 pts ch 9 Controls 25
    pts ch 10 Databases 25 pts
  • formatm/c, fill-in, trace code, T/F.

3
Sequential Files
  • Creating Dim sr As IO.StreamReader Dim sw As
    IO.StreamWriter
  • Connecting sr IO.File.OpenText(filespec) sw
    IO.File.CreateText(filespec) sw
    IO.File.AppendText(filespec)

4
Sequential Files
  • I/O strLine sr.ReadLine() sw.Write(expression)
    sw.WriteLine(expression)
  • Disconnecting sr.Close() sw.Close()

5
Sequential Files
  • Update File IO.File.Delete(filespec) IO.File.Mov
    e(tmpfilespec, filespec)
  • Use Namespace Imports System.IO
  • CSV Format
  • use the Split(delim) function to generate an
    array of token

6
Sequential Files
  • Structured Exception Handling (SEH) Try
    statement(s) Catch ex As ExceptionName stateme
    nt(s) Catch statement(s) Finally statement(s
    ) End Try

7
Sequential Files
  • Things to note
  • Finally clause always executes (as the last
    thing)
  • Catch as many specific exceptions as needed
  • Have a catch all clause to catch all else
  • Use Throw to propage exception to calling
    procedure

8
Controls
  • List Box
  • .Items.Add(str)
  • .Items.Count
  • .SelectedIndex
  • .Items(n)
  • .Text
  • .Items.RemoveAt(n)
  • .Items.Remove(str)
  • .Items.Clear()

9
Controls
  • Combo Box (Text box List box)
  • Simple
  • DropDown
  • DropDownList
  • .Text

10
Controls
  • OpenFileDialog
  • .Filter (Text Files (.txt).txt...)
  • .FilterIndex
  • .ShowDialog()
  • .Filename
  • Check Box
  • can select multiple ones w/in same container
  • .Checked
  • _CheckedChange()

11
Controls
  • Radio Box
  • can select only one w/in same container
  • .Checked
  • _CheckedChange()
  • Timer
  • .Iterval
  • .Enabled
  • _Tick()

12
Controls
  • Picture Box
  • .BMP, .ICO, .GIF, .JPG
  • .CreateGraphics.DrawRectangle(pen,x,y,w,h)
  • .Image Image.FromFile(filespec)
  • HSB, VSB
  • .Minimum
  • .Maximum
  • .SmallChange
  • .LargeChange
  • .Value

13
Controls
  • MainMenu
  • top-level (menu bar)
  • lower-levels (items and sub menus)
  • mnu prefix
  • mnuFile (top-level)
  • mnuFileOpen(item)

14
Databases
  • Server Explorer
  • view database information on entire network
  • add connections to databases
  • Data Adapter
  • conduit between data source and application Dim
    da As OleDb.OleDbDataAdapter da New
    OleDb.OleDbDataAdapter(strSQL,
    strCon) da.Fill(dt) da.Dispose()

15
Databases
  • Data Table
  • in-memory copy of database table Dim dt As
    DataTable() dt New DataTable()
  • connection string (provider and data source)
  • sql string (SQL statement for selecting data)
  • .Rows.Count
  • .Columns.Count
  • .Columns(j)
  • .Rows(i)(j)
  • .Rows(i)("Column")

16
Databases
  • Bound List Box
  • .DataSource dt
  • .DisplayMember "Field"
  • Primary V. Foreign Key
  • SQL
  • SELECT ... FROM ...
  • ORDER BY
  • WHERE
  • INNER JOIN ...

17
Databases
  • DataGrid Control
  • .DataSource dt
  • Updating a database Dim cb As New
    OleDbCommandBuilder(da) count da.Update(dt)

18
Final
Monday, May 05 630 810p EB 2026 Have a Great
Summer!
Write a Comment
User Comments (0)
About PowerShow.com