INTRODUCTION
The .NET Framework, encompassing a great new product called Visual
Studio.NET, is tipped to spur a revolution in the software industry .This is
because, the .NET Framework and Visual Studio.NET have been designed with the Internet
as their epicenter.
Visual Basic has been the most widely accepted
programming language in the world. Thus, Microsoft was left with no choice but
to integrate this product into the .NET Framework in the form of VB.NET.
Microsoft has introduced a number of
contemporary features to VB.NET, and greatly ameliorated its web design
facilities.VB.NET is also regarded as the easiest entry-point into the .NET
world, that provides succor to those who are terrified of biting the bullet of
the Brave New World of technology.
Microsoft has retained the latest the
heart and soul of the original VB product with latest developments available in
the software in the software technology. This forms the genesis of VB.NET.
Visual Basic.NET is primarily an
extension of the Visual Basic Programming Language, which is shipped a Visual
Basic Product. A is significant upgrade or improvement over VB and is far more
flexible and powerful.
Minimum
Requirements
The software
requirements to successfully run the programs are
v Operating System-Windows 2000,Windows XP,
Windows 7
v Microsoft IIS server 5.0
v Visual Studio.Net
v You can choose any database.
Visual
Studio.Net
We can ask for our copy of this software from Microsoft by placing an
order for the same on their website.
SQLServer2000
While installing the evaluation
edition of SQLServer2000, we have chosen the default selected settings. The
only modification made is in the Authentication Dialog Box.
We see two options
* Windows Authentication
Mode
* Mixed Mode (Windows Authentication and
SQL Server Mode)
The default option selected is Windows
Authentication mode. We have instead selected Mixed mode. Once this option is
selected, the password text boxes for the ‘sa’ user get activated. As we could
prefer using a blank password in our programs, we select Blank Password .on
selecting this option, the text boxes get disabled again.
n .NET FRAMEWORK AND VB.NET
Ø
It is
not a programming language, but it supports programming languages.
Ø
The
.net framework is a new easy and extensive programming platform.
Ø
By
default the .Net framework comes with few programming languages including
VB.NET, C#(C SHARP), J# and managed C++.
Ø
The
.Net framework serves as common platform for all these languages.
Ø
It
gives a common class library which can be utilized by any of these languages.
Ø
So
programmers need not learn any new library when they switch from one .Net
language to another language .Only the syntax is different for each .NET
language.
Ø
The
.NET is a major technology change. Just like the computer world moved from DOS
to Windows, Microsoft is now moving to .NET.
Ø
The
.Net framework serves as common platform for all these languages.
Ø
It
gives a common class library which can be utilized by any of these languages.
Ø
So
programmers need not learn any new library when they switch from one .Net
language to another language .Only the syntax is different for each .NET
language.
Ø
The
.NET is a major technology change. Just like the computer world moved from DOS
to Windows, Microsoft is now moving to .NET.
Ø
The
.Net framework serves as common platform for all these languages.
Ø
It
gives a common class library which can be utilized by any of these languages.
Ø
So
programmers need not learn any new library when they switch from one .Net
language to another language .Only the syntax is different for each .NET
language.
Ø
The
.NET is a major technology change. Just like the computer world moved from DOS
to Windows, Microsoft is now moving to .NET.
Ø
The
.Net framework serves as common platform for all these languages.
Ø
It
gives a common class library which can be utilized by any of these languages.
Ø
So
programmers need not learn any new library when they switch from one .Net
language to another language .Only the syntax is different for each .NET
language.
Ø
The
.NET is a major technology change. Just like the computer world moved from DOS
to Windows, Microsoft is now moving to .NET.
Ø
The
.Net framework serves as common platform for all these languages.
Ø
It
gives a common class library which can be utilized by any of these languages.
Ø
So
programmers need not learn any new library when they switch from one .Net
language to another language .Only the syntax is different for each .NET
language.
Ø
The
.NET is a major technology change. Just like the computer world moved from DOS
to Windows, Microsoft is now moving to .NET.
Ø
The
.Net framework serves as common platform for all these languages.
Ø
It
gives a common class library which can be utilized by any of these languages.
Ø
So
programmers need not learn any new library when they switch from one .Net
language to another language .Only the syntax is different for each .NET
language.
Ø
The
.NET is a major technology change. Just like the computer world moved from DOS
to Windows, Microsoft is now moving to .NET.
Ø
The
.Net framework serves as common platform for all these languages.
Ø
It
gives a common class library which can be utilized by any of these languages.
Ø
So
programmers need not learn any new library when they switch from one .Net
language to another language .Only the syntax is different for each .NET
language.
Ø
The
.NET is a major technology change. Just like the computer world moved from DOS
to Windows, Microsoft is now moving to .NET.
Ø
The
.Net framework serves as common platform for all these languages.
Ø
It
gives a common class library which can be utilized by any of these languages.
Ø
So
programmers need not learn any new library when they switch from one .Net
language to another language .Only the syntax is different for each .NET
language.
Ø
The
.NET is a major technology change. Just like the computer world moved from DOS
to Windows, Microsoft is now moving to .NET.
Ø
The
.Net framework serves as common platform for all these languages.
Ø
It
gives a common class library which can be utilized by any of these languages.
Ø
So
programmers need not learn any new library when they switch from one .Net
language to another language .Only the syntax is different for each .NET
language.
Ø
The
.NET is a major technology change. Just like the computer world moved from DOS
to Windows, Microsoft is now moving to .NET.
Ø
The
.Net framework serves as common platform for all these languages.
Ø
It
gives a common class library which can be utilized by any of these languages.
Ø
So
programmers need not learn any new library when they switch from one .Net
language to another language .Only the syntax is different for each .NET
language.
Ø
The
.NET is a major technology change. Just like the computer world moved from DOS
to Windows, Microsoft is now moving to .NET.
Evolution of
the .NET Framework
v
Visual
basic, which has the Microsoft’s most popular language earlier, was too easy,
and many serious programmers hated it just for that reason.
v
Even
though visual Basic was very easy to use, it was not flexible enough to develop
complex application.
v
Microsoft’s
VC++ was a powerful tool.
v
It had
too many data types, and programmers had to learn many libraries including
Windows SDK,MFC,ATL,COM etc.
v
There
were many data type compatibility issues while exchanging data between
different layers.
v
The
java language became a very good choice for this reason.
v
It had
the flexibility and power of C++ and at the same time easy enough to catch the
tension of VB programmers.
v
Microsoft
recognized these factors and they introduced the .NET.
v
All
unwanted complexities were eliminated and a pure object oriented programming
model was introduced.
v
.NET
framework comes with a single class library.
v
Whether
we write code in VB.NET or C# or J#, we just use the .net class library.
v
There
is no class’s specific to any .NET language.
v
There
is nothing more we can do in a .NET language.
v
We can
write code in VB.NET or C# with the same number of lines of code, same
performance and same efficiency, because everyone use same .NET class Library.
v
When
we write code in any .NET language and compile, it will be converted to an
Intermediate language (Microsoft Intermediate Language-MSIL).
v
So,
our compiled code contains the MSIL code and not the executable machine
language code.
v
When
the .net applications runs, the .NET framework is the target computer takes
care of the execution.
v
To run
a .NET application, the target computer should have .NET framework installed in
it.
v
The
.NET framework converts the calls to .NET class libraries to the corresponding
ApIs of the Operating System.
v
Whether
we write code in VB.NET or C#, we are invoking the methods in the same .NET
class libraries.
v
The
same .NET framework executes the VB.NET and C# application .
v
So
there won’t be any performance difference based on the language we write code.
v
The
VB.NET code we write is platform independent, because whatever we write getting
compiled into MSIL.
v
There
is no native code, which depends on our operating system or CPU.
v
But
when we execute the MSIL, the .NET framework in the target system will convert
the MSIL into native platform code.
v
So, if
we run out .NET exe in a Window machine, the .net framework for Windows will
convert it into Windows native code and execute.
v
If we
run our .NET application in Linux machine, the .NET framework for Linux will
convert our code into Linux native code and execute.
v
So our
code is purely platform independent and runs anywhere.
VB.NET
q
The
next version of SQL Server even supports writing stored procedure in .NET
languages.
q
.NET
runtime will be part of all Operating Systems by default.
q
In
short if we like to work on Microsoft technologies for programming .net will be
only choice we will have.
n
GETTING
STARTED TO VB.NET
TO SELECT A NEW PROJECT OR TO OPEN AN
EXISTING PROJECT
n
TO
SELECT A NEW PROJECT
n
SAVING
THE NEW PROJECT BY GIVING A NAME
n
THE
NEW PROJECT FORM
n TO RUN THE FORM(PROJECT) OR TO VIEW OUTPUT
n
AFTER
THE PROJECT IS BEEN RUN
n
SELECTING
THE TOOLBOX
n
SELECTING
AND PLACING A TOOL FROM THE TOOL BOX
by just drag and drop.
n
EXECUTION
OF THE FORM ALONG WITH THE TOOLS FROM THE TOOL BOX
METHODS:
A method is a self-contained
entity that carries out a well-defined task of some kind.
Types of Methods:
Two types of methods in vb.net.Subroutines, which do not
return values.
Functions, which
do return values.
1.”Value”type parameters:
- Declared with an explicit ByVal
modifier. ByRef modifier can’t be specified.
- To exist upon the completion of the execution of the
method.
- To assign a new value to a value
parameter.
2.”Reference” type parameters
- Declared with a ByRef modifier.
- ByVal modifier can’t be used.
- Does not create a new storage
location.
- Modification of a reference parameter
directly and immediately impacts the
corresponding argument.
3.”ParamArray”type
parameters
o
Declared
with the ParamArray modifier.
o
Its
type must be a one-dimensional array.
o
And it
must be the last parameter in the formal parameter list.
o
Not
possible to combine the ParamArray modifier with the ByRef modifier.
4.Method
Overloading
o
Refers
to the use of the same entity for different purposes.
o
Use
the same method name to create two or more methods that perform similar tasks.
ARRAYS:
Arrays can be
thought of as containers that have a list of storage locations for a specified
data type.
Type of Arrays:
- One-dimensional Arrays:
When declaring a
one-dimensional array we specify the type, array name, dimensions and size.
Dim MyArray(10) as
Integer
Dim
MySingleArray() as Integer
Dim
MySingleArray() as Integer={1,2,6,8}
- Two-dimensional Arrays:
Vb.net , an array
can be have as many as 32 dimensions
- Jagged Arrays:
We specify the
type, array name, dimensions and size.
The memory for
each row in a jagged array is to be allocated separately.
Additional Windows
Controls-1
Used for Developing Windows Applications.
1.Docking
Controls.
2.Timer Control.
3.ProgressBar
Control
4.Mouse Events
5.Key press Events
6.Linklabel
Control.
7.TrackBar Control
8.Panel Control
9.Tree view
Control.
1.Docking Controls
- To specify the way in which the
control will be docked to the parent control.
- Various values of Dock property are:
- Top, Left, fill, right, bottom and none. Default value of this property
is none.
2.Timer Control
- While most of the controls that we place on the form are visible
during run-time,some of them are not visible during run-time.
For example:
- Mainmenu, timer, tooltip and
notifyicon controls are not visible during run-time. such controls
are placed in the component tray.
- Timer control is used to do some work
repeatedly at predefined time intervals.
- The default time interval is 100
milliseconds.
3. ProgressBar Control
- We use the progress-bar control in a
project to indicate the progress of some work, like copying a voluminous
data file.
The Properties :
- Minimum, Maximum and Value.
- Default value of Minimum and Maximum
properties are 0 and 100.
- The value of the predefined value
property should lie in this rang.
4. Mouse Events
- Important mouse events: MouseMove,
MouseUp and MouseDown.
5. Key Press Events
- Just like the mouse events,the key
event shall be used to get an action performed.
6. Linklabel Control
- It is a general-purpose control.
- In windows applications to establish a
link from one form to another.
- It shall also be used to start
familiar system programs,such as notepad,PaintBrush and InternetExplorer.
7. TrackBar Control
- The trackbar is more or less like the
traditional scrollbar.it allows the user to select a value from a range of
values.
- When we create a trackbar object ,we
have to specify the minimum and maximum bounds of the range.
- We can set all these values through
the appropriate properties of the trackbar control.
8. Panel Control
- It contains other controls.
- We shall group a set of related
controls and place them inside a Panel control.
- Two properties : AutoScroll ,
BorderStyle.
9.TreeView Control
- It displays data in a hierarchical
format.
- It displays the text that describes
the objects in the list.
- The treeView control maintains a
collection of treeNode objects.
- We can map each treenode object with a file or folder that it
represents.
Additional Windows Control-2
- Menu Control
MenuItem class
2.Context Menu
3. SDI(Single Document Interface)
4. MDI(Multiple Document Interface)
5.Dialog Boxes
6.ToolBar Control
7.Tab Control
8.Dealing with Controls at runtime.
Context Menu
Context menus pop up on the screen when we right-click a control.
SDI(Single Document Interface)
- Only a single document can be opened at a time in such
as interface.Notepad is a good example of SDI.
- If we wish to open a new document ,we
have to open a new instance of SDI.
Dialog Boxes
- It is used to receive some simple
input from the user.
ToolBar Control
- The tool bar buttons are as used as
alternative means of activating the menu items.
- A tool bar may contain two or more tool
bar buttons. Each such button may contain
text, image or both.
StatusBar
Control
- The Status bar appears at the bottom
of the form.
- It can be divided into two or more
panes.
- Each pane shall contain either textual
or graphical or both of these types of information.
CLASS AND
OBJECTS
•
A Class is defined as a collection of variables
and methods that act upon those variables.
•
The
variables are also known as fields. The fields and methods in a class are known
as class members.
•
A
class can be thought of as a container, which holds several class members.
•
Classes
serve as building blocks in OOprograms. A class shall represent a room, a
person, an inventory item, a Savings-Bank account or any entity that an
OOprograms handles.
INHERITANCE
Introduction
Inheritance
is one of the primary concepts of object-oriented programming. It allows us to
reuse existing code.
Through effective employment of
inheritance,
we can save considerable amount of time
in our programming.
All pre-defined classes in VB.NET are
derived from a simple pre-defined class known as object.
The polymorphism feature enables us to
define a method in a base class and a method in a derived class in such a way
that both of them have the same signature but they have different
functionalities
Virtual
Methods
•
We
shall refer to a derived class object through a base class reference.
•
A
reference to a base class has two types. what it was declared as is called
static type. what it is currently referring to is called dynamic type.
•
Sometimes
we may wish the compiler to use a reference’s dynamic type resolve the call as
run-time.
•
We
shall use the concepts of virtual methods in such situations.
•
A
virtual method is one method where the decision on exactly which method invoke
is delayed until run-time, allowing dynamic type of reference to be used.
Defining and
usages of interfaces
•
The
main purpose of an interface is to declare a set of methods, and not to
implement them.
•
Therefore,
an interface only includes method declaration and not their implementations.
Namespaces
•
A
namespace shall be viewed as a container for classes and interfaces.
•
There
are over 60 predefined namespaces in the .NET framework.
•
A namespace
is like a directory. by placing the classes and interfaces into namespaces, we
can easily group related classes and interfaces together.
•
We can
also avoid the risk of name collisions.
•
If one
company happens to define a class that has the same name as the class written
by another company, and there are no namespaces
•
There
will be no way for a compiler to figure out which class a program is actually
referring to.
•
With
the introduction of namespace, there is in this regard no problem because the
two classes will be placed in two different namespaces.as we know,it is like
the windows file system,where files with same can be contained in different
folders.
•
Just
as folders on this file system can contain other folders as well as files,
namespaces shall contain other namespaces and classes.
Exception Handling
•
An
exception handling is an abnormal condition
That is caused by
an run-time error in the program.
VB.NET enables us
to smoothly handle the various types of exceptions that occur during the
execution of a program with the well defined exception handling mechanism.
ArgumentException
ArithmeticException
ArrayTypeMismatchException
CoreException
dividebyzeroexception
FormatException
IndexOutOfRangeException
SqlException
IOException
InvalidCastException
NullReferenceException
OutOfMemoryException
outOfMemoryException
Thank you,
Rudhra Devan
Shanmugam Kalyani Systems.
Thanjavur.TN.India.
please give your feedback to rudhradevan@gmail.com