Visual Basic.NET Programming (CT-228) - PowerPoint PPT Presentation

About This Presentation
Title:

Visual Basic.NET Programming (CT-228)

Description:

Each student will write at least sixteen programs, some in class and some as ... Web Forms. February 18, 2004. Files and Databases (ADO.NET) February 11, 2004 ... – PowerPoint PPT presentation

Number of Views:67
Avg rating:3.0/5.0
Slides: 49
Provided by: pondview
Category:

less

Transcript and Presenter's Notes

Title: Visual Basic.NET Programming (CT-228)


1
Visual Basic.NET Programming (CT-228)
2
Visual Basic.NET (CT-228)
  • Chip Schopp
  • Phone (978) 779-6544
  • Email chipschopp_at_comcast.net
  • Web Site www.pondviewsoftware.com
  • Continuing Education Office
  • Phone (603) 577-6500
  • Fax (603) 577-6503
  •  

3
Course Dates and Time
  • This class meets every
  • Wednesday evening
  • from 530 pm until 1030 pm
  • January 14th through March 3rd 

4
Text
  • Programming Visual Basic .NET, 2nd Edition
  • by Jesse Liberty,
  • Published by O'Reilly Associates, Inc,
  • ISBN 0-596-00438-9.  

5
Course Materials
  • Presentations
  • Class Exercises
  • Homework Assignments
  • www.pondviewsoftware.com
  • or
  • www.pondviewsoftware.com/visualbasicclass.htm
  •  

6
Prerequisite
  • Fundamental of Programming
  • (CT100)
  • or
  • by permission of the instructor.

7
Course Description
  • This course will introduce students to the
    Microsoft Visual Basic.NET programming language
    with significant emphasize on developing
    programming skills.
  • Each student will write at least sixteen
    programs, some in class and some as homework.
  •  

8
Class Goals
  1. Be able to write, test, and debug windows desktop
    and web-based programs using Visual Basic.NET and
    the Visual Studio.NET IDE.
  2. Be able to use many Visual Basic.NET language
    components to write programs.
  3. Understand how a VB.NET application fits into the
    .NET Framework.
  4. Be able to use many Windows and Web controls to
    implement forms based applications.
  5. Be able to read and write sequential ASCII text
    files, as well as, manipulating data files and
    Windows directory trees.

9
Class Goals (continued)
  1. Be able to use ADO.NET to interact with a
    Microsoft Access database.
  2. Know how to deploy try, catch, finally exception
    processing.
  3. Be able to create and work with simple and
    complex types, objects and classes.
  4. Have a basic understanding of object technology
    and object oriented application development.
  5. Have written a basic web service and will
    understand the basic components and additional
    complexities of developing a distributed
    web-based applications.

10
Class Goals (continued)
  1. Will work with a number of method attributes such
    as WebMethod, Serializable, Synchronization,
    Locking, etc.
  2. Some exposure to advanced subject like
    multi-threaded applications, tree controls,
    remoting, etc.

11
Course Notes
  • While students will write a simple windows
    console application using a text editor the
    course will primarily focus on programming
    windows desktop and web based applications using
    the Visual Studio.NET IDE (Interactive
    Development Environment).
  •  

12
Course Notes (cont)
  • The course will use Visual Basic.NET, version
    1.0, although the student will still be able to
    complete the class using the new released version
    of Visual Basic.NET 2003, version 1.1.
  •  

13
Course Notes (cont)
  • Each class will open with a time for questions
    and answers. Questions from a previous class or
    questions emailed to the instructor will be
    addressed. Other questions will either be
    answered or captured for a future response.
    Questions should be as specific as possible.
  •  
  • The only dumb questions are the ones not asked!

14
Class Schedule
January 14, 2004 Introduction Basic Console App Basic Console App with IDE Windows Form App
January 21, 2004 Windows Form Programming
January 28, 2004 Windows Form Programming
February 4, 2004 Types, Classes, Objects
February 11, 2004 Files and Databases (ADO.NET)
February 18, 2004 Web Forms
February 25, 2004 Web Services/Class Project
March 3, 2004 Web Services/Class Project
15
The instructor reserves the right to modify the
schedule as needed.
16
Effective Learning
  • First is Doing
  • Class exercises
  • Coaching
  • Helping each other
  • Homework
  • Second is Discussing
  • Class discussions
  • Asking questions
  • Sharing ideas and information
  • Last is Listening

17
You have my permission, if what I'm doing is
boring or just not working, let me know and we'll
try something different.
18
Class Attendance
  • Class attendance is important.
  • While missing a class is sometimes unavoidable,
    it can put you behind for the rest of the course.
  • Class Material tends to build on prior lessons.
  • All class material is available on the web.
  •  

19
Grades
  • Average of Homework Assignments (probably seven)
    and a Web Services Class Project.
  • I tend to grade by developing a grade matrix for
    an assignment and then assigning grades based on
    completeness, so please follow the directions.

20
Late Homework
  • While late homework is sometimes unavoidable, but
    my experience is that it comes with a price.
  •  
  • While incompletes are allowed with prior approval
    of the instructor they are clearly not a good
    idea.
  •  

21
Every attempt will be made to provide each
student with a level of instruction and material
able to insure a successful learning
experience.If you are having any difficulty
with the material or the instructor please
contact the instructor or the Office of
Continuing Education for assistance.
22
Your Introductions
  • A bit about yourself, why you are here
  • Your programming background (operating systems,
    languages, ?)
  • Any exposure to .NET ? Other .NET courses ?
  • Your expectations for this course

23
Tonight ? HelloWorld in three flavors
  1. Creating a Visual Basic.NET program without using
    Visual Studio.NET (use Notepad instead)
  2. Writing a console Hello World using the IDE
    (Integrated Development Environment) ? Visual
    Studio.NET
  3. Writing a Windows Form Hello World using Visual
    Studio.NET

24
Creating a Visual Basic.NET program without using
Visual Studio.NET
25
Steps to Creating a Non-Visual Studio.NET Program
  1. Open a Command (MSDOS) Window in the target
    directory
  2. Select or create a directory to work in
  3. Use Notepad (or someother text editor) to write
    the code and save it in the target directory
  4. Run an Frameworks SDK provided batch file to
    setup the environment
  5. Compile your program
  6. Correct any errors
  7. Execute your program

26
Step 1 - Open a Command (MSDOS) Window in the
target directory
  • Under the start menu
  • Programs ? Accessories ? Command Prompt

27
Step 2 - Select or create a directory to work in
  1. Open a Command Window
  2. C\Documents and Settings\Chipgtcd k\
  3. K\gtmkdir VBClassConsoleApp or whatever...
  4. K\gtcd VBClassConsoleApp

28
Step 3 - Use Notepad (or some other text editor)
to write the code and save it in the target
directory
  • Enter the following code
  • Module HelloWorld
  • Sub Main() System.Console.WriteLine("Hello
    World")
  • End Sub
  • End Module
  • Save the file it in the target directory with the
    name followed HelloWorld.vb

29
Step 4 - Run an Frameworks SDK provided batch
file to setup the environment
  • Microsoft Provides Several Batch Files to Set Up
    a Command Window Environment for the .NET
    Frameworks SDK
  • vsvars32.bat (..SDK\Common7\Tools\..)
  • corvars.bat (..FrameworkSDK\Bin\..) for Version
    1.0
  • sdkvars.bat (..SDK\V1.1\Bin\..) for Version 1.1
  • Probably the easiest way to do this is to copy
    the file to your target directory and then
    execute it (i.e. type filename and hit return) in
    the Command window.

30
Step 5 - Compile your program
  • Within the command window
  • Type vbc program name
  • K\VBClassConsoleAppgt vbc HelloWorld.vb

31
Step 6 - Correct any errors
  1. Identify the error
  2. Return to the Notepad window and correct the code
  3. Save the program
  4. Try Step 5 again

32
Step 7 - Execute your program
  • Within the command window
  • Type the program name
  • K\VBClassConsoleAppgt HelloWorld (.exe is
    optional)
  • You should see something like this
  • K\VBClassConsoleAppgt HelloWorld
  • Hello World
  • K\VBClassConsoleAppgt

33
A Few Comments About the Code
  • Module HelloWorld
  • Sub Main() System.Console.WriteLine("Hello
    World")
  • End Sub
  • End Module
  • Module and matching End Module
  • Sub or Function (functions return a value) and
    End Sub
  • Method called main (every console application
    includes a main method)

34
System.Console.WriteLine("Hello World")
  • System is the Namespace
  • Can be nested
  • System.Windows.Forms
  • Namespace can be referenced using an Imports
    statement
  • Console is the Class in the Namespace
  • WriteLine is a method in the class

35
Try Using the Imports Statement
  • Two Differences in this Code
  • Addition of the Imports Statement
  • Remove of the System before Console
  • Imports System
  • Module HelloWorld
  • Sub Main()
  • Console.WriteLine("Hello World")
  • End Sub
  • End Module

36
(No Transcript)
37
Writing a console Hello World using the IDE
(Integrated Development Environment) ? Visual
Studio.NET
38
Click on Microsoft Visual Studio.NET
39
Click on File?New?Project
40
  • Select Visual Basic Projects as your development
    language
  • Select Console Application as your project type
  • Use the Browse button to select a target
    directory for this project
  • Name the project (whatever you like)
  • Click OK

41
(No Transcript)
42
You Should See This
43
  • Expand the References on the Right
  • Note the System reference is provided
    automatically

44
Add the following code
  • Module Module1
  • Sub Main()
  • Console.WriteLine("HelloWorld")
  • End Sub
  • End Module
  • Note the absense of the System.Console.

45
Notice the Intellisense for Console
46
  • Click on Build ? Build Solution
  • Look for the Build Results in the Output window

47
  • Build the application again
  • Check for Errors
  • Test it Debug ? Start Without Debugging (try just
    Start)

48
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com