Whats new in VB .NET - PowerPoint PPT Presentation

1 / 35
About This Presentation
Title:

Whats new in VB .NET

Description:

Visual Basic .NET. Comprehensive Concepts. and Techniques. What's new in VB .NET ... Type a period after any variable in the IDE to see methods/properties ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 36
Provided by: jeff377
Category:
Tags: net | new | whats

less

Transcript and Presenter's Notes

Title: Whats new in VB .NET


1
Whats new in VB .NET
  • adapted from a presentation on
  • Introduction to
  • Visual Basic .NET
  • by
  • Jeff Quasney
  • Course Technology

2
(No Transcript)
3
An Overview
4
Whats New in Visual Studio .NET?
  • IDE (Start page, common for ALL .NET languages)
  • Application templates
  • New editing tools (HTML, XML, XSL, CSS)
  • Cross-language debugging, Multiple languages per
    Solution
  • New sample apps and documentation
  • Strong focus on XML

5
Whats New in Microsoft Visual Basic .NET?
  • VB .NET was a rewrite, not an update
  • New/changed data types
  • No Variant, CTS
  • New/changed syntax
  • Dim, assignment, arrays, keywords
  • Application distribution

6
Whats New in Microsoft Visual Basic .NET?
(continued)
  • Inheritance
  • Exception handling (Structured exception
    handling)
  • Overloading
  • Multithreading
  • Web development
  • Web services
  • Web applications (ASP.NET)
  • ADO.NET

7
Application Types
  • Console Applications

8
Application Types
  • Windows Applications

9
Application Types
  • Windows Services

10
Application Types
  • Web Applications

11
Application Types
  • Web Services

12
Application Types
  • Components

13
What is .NET?
14
.NET Framework
15
Why .NET?
  • Common classes
  • Common security model
  • DLL H E double-toothpicks gone?
  • Side-by-side execution
  • Garbage collection
  • Multi-platform?
  • New application types
  • Language interoperability

16
The Common Language Runtime
  • Takes control of the application and runs the
    application under the operating system
  • Microsoft Intermediate Language (MSIL)

17
The Common Language Runtime
  • MSIL is CPU/OS independent
  • Compile once for multiple CPUs/platforms
  • Take an EXE and run it on Linux
  • Ximian (?) is working on this
  • Assembly and manifest concept
  • Xcopy installs
  • Side-by-side execution
  • Logically, all EXEs and DLLs act as DLLs

18
The Common Language Runtime
  • Registration info no longer in registry
  • Meta data stored in assemblies
  • Only distribute assembly
  • .NET Framework required on users system
  • Memory management
  • Exception handling
  • No IDL, no registration, no HRESULTS, no GUIDs,
  • Replaces all COM plumbing

19
Whats New in VB .NET?
20
About Procedures
  • Subs and functions need parentheses
  • Use
  • MyProc(A parameter)
  • Not
  • MyProc A parameter
  • ByVal is now the default!
  • Optional arguments need a default value
  • Sub DoWork(Optional ByVal i As Integer 1)
  • Return is used in Functions to return a value

21
About IF Statements
  • AndAlso and OrElse do short-circuiting
  • If intX 1 AndAlso intY 2 Then
  • In above example, second expression is not
    evaluated if intX is not 1

22
About Object Declarations
  • OLD
  • Dim objCustomer As Store.Customer
  • Set objCustomer New Store.Customer
  • NEW
  • Imports Store
  • Dim objCustomer New Customer
  • OR
  • Dim objCustomer as Customer New Customer

23
About Scope
  • New Block-level Scope
  • Dim intX As Integer
  • For intX 1 To 5
  • Dim intZ As Integer
  • MessageBox.Show(Scope is important.)
  • Next intX
  • MessageBox.Show(intZ is out of scope!)

24
About Arrays
  • Lower bound is always zero
  • Dim intA(5 To 8) no longer is possible
  • Option Base is gone as well
  • Arrays have VERY useful methods
  • Declare arrays by upperbound, not size Same as
    VB6
  • Dim strX(10) As String contains 11 elements
  • Setting an array to another array is now done by
    reference
  • In VB6, this was done by value
  • Use Copy method of arrays to make an actual copy

25
About Loops
  • WhileWend changed to WhileEnd While

26
About Data Types
  • All variables are objects. Variants are gone.
  • Type a period after any variable in the IDE to
    see methods/properties
  • Strings are never fixed length. They are
    destroyed and recreated by the CLR when value
    changes
  • Only one type of string variable for ALL
    languages
  • No Currency data type. Now decimal.
  • UDTs are gone
  • Use structures instead
  • Structure statement replaces Type
  • Structures support methods!

27
Useful Options
  • Option Strict On
  • Forces declarations
  • Forces data types to be same on both sides of
  • Use it always. Get in the habit. Force your
    students to use it in assignments.

28
About Operators
  • New concatenation operators
  • , -, , /,
  • intI 100
  • intl - 100

29
About Controls
  • Default properties of controls are GONE
  • New way to set tab order
  • Shape controls are gone
  • Use System.Drawing namespace

30
About Menus and Help
  • Menu editor
  • Create a menu and a context menu
  • Help
  • Dynamic help is addictive

31
Misc
  • New control alignment tools
  • New properties
  • Anchoring and AutoSize
  • Opacity of forms
  • Printing
  • Several new, powerful printing controls
  • Print controls/objects get more complicated, but
    more powerful
  • Crystal Reports is included with
    Professional/Academic versions
  • New way to set tab order

32
Whats new in OO?
  • Too much to mention
  • Inheritance
  • Polymorphism
  • New syntax for creating properties
  • Read-only, Write-only properties
  • Aggregation is weird, though (just in VB)
  • Constructor Sub New() Destructor Sub
    Finalize()
  • Dont assume you know when destructor is called

33
Whats new in Databases?
  • Too much to mention
  • ADO.NET
  • SqlClient namespace vs. OleDB namespace
  • DataSet and DataTable
  • DataReader
  • Plea/Editorial Please dont use Data controls

34
What will make you scratch your head?
  • Line numbers are messed up
  • Cant print a form in design mode for a Windows
    form, but you CAN for a Web form
  • Value of True (non-zero, not 1)

35
  • The End
Write a Comment
User Comments (0)
About PowerShow.com