Skip to main content
Visual Basic .Net
G e t t i n g S t a r t e d
Course Overview
Introduction
.Net Overview
What’s VB
Variables,Operators
Flow Controls / Exceptions
Classes & Objects
Types & Assemblies
Collections & File System
Module Overview
 What is .Net?
 VB in .net Framework
 Getting started with VB
 Visual Studio IDE tour
 First Program – Hello world!
 Compilation & Execution
 Variables and Operators
 Data Types
 Arrays & Enums
 Summary
.Net Framework
Base Class Library
Common Language Specification
Common Language Runtime
ADO.NET: Data and XML
VB C++ C#
Visual
Studio.NET
ASP.NET: Web Services
And Web Forms
JScript …
Windows
forms
Common Language Runtime
Base Class Library
Common Language Specification
Common Language Runtime
ADO.NET: Data and XML
VB C++ C#
Visual
Studio.NET
ASP.NET: Web Services
and Web Forms
JScript …
Windows
Forms
 Language Interoperability
 Common Classes for all Languages
 Common Types for all Languages
 Runtime Controls Compilation to Machine Code
Assemblies
 Application Domains
Common Language Runtime
The .NET Framework
 Simplified development
 XCOPY deployment
 Scalability
 Rich Web clients and safe Web hosting
 Potentially multi-platform
 Multiple languages (cross inheritance)
 Increases productivity
 Robust and secure execution environmentwq
CLR Execution Model
VB
Source
code
Compiler
C++
C#
Compiler
Compiler
Assembly
IL Code
Assembly
IL Code
Assembly
IL Code
Operating System Services
Common Language Runtime
JIT Compiler
Native Code
Managed
code
Unmanaged
Component
The .NET Framework
.NET Framework Services
Base Class Library
Common Language Specification
Common Language Runtime
ADO.NET: Data and XML
VB C++ C#
Visual
Studio.NET
ASP.NET: Web Services
and Web Forms
JScript …
Windows
Forms
 ASP.NET
 Separation of code and presentation
 Compiled
 Web Forms
 Web Services
 Windows® Forms
 Framework for building rich clients
 ADO.NET, Evolution of ADO
 New objects (e.g., DataSets)
 XML support throughout
The .NET Framework
.NET Framework Services
VB.net – What it is?
 A language to create .Net components
 An evolution of classic Visual Basic
 Create application, services, and reusable libraries
 Visual basic command line compiler
 Transforms VB code to MSIL
 Produces an assembly (.dll, .exe)
Visual Studio - IDE
 An Integrated Development Environment
 Edit VB, C#, JS, Css, Html files
 Compile and Execute programs
 Debugging tools
 Testing evironment
Visual Studio – Solution Explorer
 Will contain at least one project
 Contains one or more source code files
 Each project produces an assembly
 Projects organized under a solution
 Manage multiple applications or libraries
Data Types
Name Description
Int32 (or int) 32 bit integer
Int64 (or long) 64 bit integer
Boolean (or bool) true or false
Float (or float) Single precision floating point
Double (or double) Double precision floating point
Decimal (or decimal) Fixed precision (financial)
DateTime An instant in time (to 100 ns)
String (or string) Text (as Unicode characters)
Variables
 Variables hold a value
 Use the Dim keyword to create a variable
 Variables always have a type
 Can optionally assign a value at declaration
Type Inference
 Visual Basic can infer type of variable
 from their value
 Must assign at value at declaration
 for inference to work
Statements
 A statement is a line of code
 Statements end at the end of a line
 Long statements can be divided using
 the underscore character
Operators
 Specify an operation to perform on one or more variables
 Mathematical operators ( + , - , * , /, , Mod )
 Relational operators ( < , > , <= , >= )
 Equality operators (=, <>)
 Conditional operators (And, Or)
 Assignment operators (=, +=, -=, *=, /=)
 String concatenation (&)
Arrays
 A variable that can hold multiple values of the same type
 Index of first item is 0
 Can have multi-dimensional arrays
Enumerations
 An Enum creates a type
 A set of named constants
 A numeric value is associated with each constant
First Program – Hello World
 Create a console app – vb module
 Inside Sub Main()
 Console.WriteLine(“Hello World”)
Lets see in action - Demo
Summary
 What is .Net?
 VB in .net Framework
 Getting started with VB
 Visual Studio IDE tour
 First Program – Hello world!
 Compilation & Execution
 Variables and Operators
 Data Types
 Arrays & Enums
 Summary