1 / 48

Visual Basic.NET Programming (CT-228)

Visual Basic.NET Programming (CT-228). Visual Basic.NET (CT-228). Chip Schopp Phone: (978) 779-6544 Email: chipschopp@comcast.net Web Site: www.pondviewsoftware.com Continuing Education Office Phone (603) 577-6500 Fax: (603) 577-6503 . Course Dates and Time. This class meets every

rolando
Download Presentation

Visual Basic.NET Programming (CT-228)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Visual Basic.NET Programming (CT-228)

  2. Visual Basic.NET (CT-228) Chip Schopp Phone: (978) 779-6544 Email: chipschopp@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 5:30 pm until 10:30 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 • Be able to write, test, and debug windows desktop and web-based programs using Visual Basic.NET and the Visual Studio.NET IDE. • Be able to use many Visual Basic.NET language components to write programs. • Understand how a VB.NET application fits into the .NET Framework. • Be able to use many Windows and Web controls to implement forms based applications. • Be able to read and write sequential ASCII text files, as well as, manipulating data files and Windows directory trees.

  9. Class Goals (continued) • Be able to use ADO.NET to interact with a Microsoft Access database. • Know how to deploy try, catch, finally exception processing. • Be able to create and work with simple and complex types, objects and classes. • Have a basic understanding of object technology and object oriented application development. • 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) • Will work with a number of method attributes such as WebMethod, Serializable, Synchronization, Locking, etc. • 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

  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 • Creating a Visual Basic.NET program without using Visual Studio.NET (use Notepad instead) • Writing a console Hello World using the IDE (Integrated Development Environment)  Visual Studio.NET • 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 • Open a Command (MSDOS) Window in the target directory • Select or create a directory to work in • Use Notepad (or someother text editor) to write the code and save it in the target directory • Run an Frameworks SDK provided batch file to setup the environment • Compile your program • Correct any errors • 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 • Open a Command Window • C:\Documents and Settings\Chip>cd k:\ • K:\>mkdir VBClassConsoleApp or whatever... • K:\>cd 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:\VBClassConsoleApp> vbc HelloWorld.vb

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

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

  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. Writing a console Hello World using the IDE (Integrated Development Environment)  Visual Studio.NET

  37. Click on Microsoft Visual Studio.NET

  38. Click on FileNewProject

  39. 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

  40. You Should See This

  41. Expand the References on the Right • Note the System reference is provided automatically

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

  43. Notice the Intellisense for Console

  44. Click on Build  Build Solution • Look for the Build Results in the Output window

  45. Build the application again • Check for Errors • Test it Debug  Start Without Debugging (try just Start)

More Related