Professional Documents
Culture Documents
Damini
Damini
Damini
NET
INTRODUCTION
1
2 DATATYPES
3 VARIABLE
4 OPERATORS
5 CONTROL STRUCTURE
INTRODUCTION
• The VB.NET stands for Visual Basic. Network Enabled Technologies. It is a simple, high-level,
object-oriented programming language developed by Microsoft in 2002.
• It is a successor of Visual Basic 6.0, that is implemented on the Microsoft .NET framework.
• Furthermore, it supports the OOPs concept, such as abstraction, encapsulation, inheritance, and
polymorphism.
• Therefore, everything in the VB.NET language is an object, including all primitive data types (Integer,
String, char, long, short, Boolean, etc.), user-defined data types, events, and all objects that inherit
from its base class.
• It is not a case sensitive language, whereas, C++, Java, and C# are case sensitive language.
• This language is used to design user interfaces for window, mobile, and web-based applications
DATATYPES
Data type is used to define the type of a variable or function in a program.
A Data Type refers to which type of data or value is assigning to a variable or function so that a variable can hold
a defined data type value.
Data Type It defines a data type that allows variables to store data types such as Char, String, Integer, Decimal,
Long, etc.
Value Assign a value to the variable.
OPERATORS
operator is a special symbol that tells the compiler to perform the specific logical or mathematical
operation on the data values. The data value itself (which can be either a variable or a constant) is
called an operand, and the Operator performs various operations on the operand.
For example: 3+2-2 , The symbol + and - are the Operators, and the 3, 2, and 1 are operands.
ARITHEMETIC OPERATOR
The Arithmetic Operators in VB.NET, used to perform mathematical operations such as subtraction,
addition, multiplication, division, etc. on the operands in VB.NET.
For example: A=2 and B=7
\ Divides one operand by another and returns an integer result B \ A will give 3
MOD Modulus Operator and remainder of after an integer division B MOD A will give 1
RELATIONAL OPERATOR
The Relational Operator is used to compare the value of two variables or operands for the various condition
such as greater, less than or equal, etc. and returns a Boolean value either true or false based on the
condition.
For example: A=10 and B=20
Operator Description Example
Checks if the values of two operands are equal or not; if yes, then
= (A = B) is not true.
condition becomes true.
Checks if the values of two operands are equal or not; if values are not
<> (A <> B) is true.
equal, then condition becomes true.
Checks if the value of left operand is greater than the value of right
> (A > B) is not true.
operand; if yes, then condition becomes true.
Checks if the value of left operand is less than the value of right
< (A < B) is true.
operand; if yes, then condition becomes true.
Checks if the value of left operand is greater than or equal to the value
>= (A >= B) is not true.
of right operand; if yes, then condition becomes true.
Checks if the value of left operand is less than or equal to the value of
<= (A <= B) is true.
right operand; if yes, then condition becomes true.
ASSIGNMENT OPERATOR
The Assignment Operators are used to assign the value to variables in VB.NET.
Operator Description Example
Simple assignment operator, Assigns values from right side operands to left C = A + B will assign value of A + B into
=
side operand C
Add AND assignment operator, It adds right operand to the left operand and
+= C += A is equivalent to C = C + A
assigns the result to left operand
Subtract AND assignment operator, It subtracts right operand from the left
-= C -= A is equivalent to C = C - A
operand and assigns the result to left operand
Multiply AND assignment operator, It multiplies right operand with the left
*= C *= A is equivalent to C = C * A
operand and assigns the result to left operand
Divide AND assignment operator, It divides left operand with the right operand
/= C /= A is equivalent to C = C / A
and assigns the result to left operand (floating point division)
Divide AND assignment operator, It divides left operand with the right operand
\= C \= A is equivalent to C = C \A
and assigns the result to left operand (Integer division)
Exponentiation and assignment operator. It raises the left operand to the power
^= C^=A is equivalent to C = C ^ A
of the right operand and assigns the result to left operand.
<<= Left shift AND assignment operator C <<= 2 is same as C = C << 2
>>= Right shift AND assignment operator C >>= 2 is same as C = C >> 2
Concatenates a String expression to a String variable or property and assigns Str1 &= Str2 is same as
&=
the result to the variable or property. Str1 = Str1 & Str2
LOGICAL OPERATOR
The Logical operators are used to perform test on two relational expressions.
For example: A=True and B=False
Or If any of the two operands is true, then condition becomes true. (A Or B) is True.
Not If a condition is true, then Logical NOT operator will make false. Not(A And B) is True.
In VB.NET, the control statements are the statements that controls the execution of the program on the
basis of the specified condition. It is useful for determining whether a condition is true or not. If the
condition is true, a single or block of statement is executed.
CONDITIONAL STATEMENTS
Conditional statements in Visual Basic can be used to take decisions based on certain conditions in your
program.
SELECT CASE
IF-THEN
IF-THEN-ELSE
IF-THEN IF-THEN- SELECT
DEFINITION:
ELSE
DEFINITION:
CASE
DEFINITION:
The If-Then Statement is a control The If-Then Statement can execute The Select Case statement is a
statement that defines one or more single or multiple statements when collection of multiple case
conditions, and if the particular the condition is true, but when the statements, which allows executing
condition is satisfied, it executes a expression evaluates to false, it a single case statement from the list
piece of information or statements. does nothing of statements.
DO-LOOP
FOR-NEXT
WHILE-END
WHILE
FOR-NEXT WHILE-END DO-LOOP
WHILE
DEFINITION: DEFINITION: DEFINITION:
For loop most commonly used loop It is a pre test loop, it is used when It is a post test loop, it is used when
because it is simple . we don’t know the number of we want to execute loop body at
It is used when we want to perform iterations in advance. It is also least once even condition is false.it
initialization , condition, and know as entry control loop. is also know as a exit control loop
increment/decrement operation in a
single line.