SlideShare a Scribd company logo
1 of 108
Download to read offline
FEDT VB.NET
F R O N T E N D D E S I G N T O O L
U S I N G
V B . N E T
P R E S E N T A T I O N B Y :
A N K I T V E R M A
( I T D E P A R T M E N T )
A N K I T V E R M A A S S T . P R O F E S S O R
U N I T - 2
28-11-2014 ANKIT VERMA 2
.NET IDE
Elements Of IDE
 Windows Form Designer
 Add control to form, arrange them & add code.
 Properties Window
 Lists properties associated with control.
 Solution Explorer
 Display solution name, project name, form name, fields etc.
 Tool Box
 Provide controls like form, data, components, toolbar, menu etc.
 Object Browser
 Shows the members of object
28-11-2014 ANKIT VERMA 3
Elements Of IDE
 Task List Window
 List of errors in source code.
 Server Explorer
 Database connectivity, display tables, views, connections etc.
 Dynamic Help
 Context sensitive help.
 Class View
 Display Classes , methods, properties etc.
 Code & Text Editor Window
 Allow to enter and edit code
28-11-2014 ANKIT VERMA 4
28-11-2014 ANKIT VERMA 5
STEPS OF WRITING
APPLICATION IN .NET
Steps Of Writing Application In .NET
 Start  Visual Studio 2010
28-11-2014 ANKIT VERMA 6
Steps Of Writing Application In .NET
 File  New Project  Select Language VB.NET
 Choose Console or Window Application
28-11-2014 ANKIT VERMA 7
Provide
Project Name
Steps Of Writing Application In .NET
28-11-2014 ANKIT VERMA 8
Steps Of Writing Application In .NET
28-11-2014 ANKIT VERMA 9
Steps Of Writing Application In .NET
 Write Code of program to be made.
 Save Code by click File  Save All
 Press F5 & Run
28-11-2014 ANKIT VERMA 10
28-11-2014 ANKIT VERMA 11
PROJECT TEMPLATE
Project Templates
 Window Application
 Create application with window interface.
 Class Library
 Create classes to use in other application.
 Console Application
 Create command line application.
 Window Control Library
 Create control for applications.
 Empty Project
 Creating local application.
28-11-2014 ANKIT VERMA 12
Project Templates
 Window Service
 Create window service.
28-11-2014 ANKIT VERMA 13
VB Terms
 Design Time
 Environment where application being developed.
 Run Time
 Execution of application.
 Forms
 Basic element for creating user interface for application.
 Controls
 Manipulate information.
 Properties
 Control characteristics like color, caption, size etc.
28-11-2014 ANKIT VERMA 14
VB Terms
 Methods
 Actions that can be performed by object
 Events
 Action recognized by form or control.
 Generated by user, OS or application.
28-11-2014 ANKIT VERMA 15
28-11-2014 ANKIT VERMA 16
FEATURES OF VB.NET
Features Of VB.NET
 Simple
 Consistency
 Garbage Collection
 Object Orientation
 Type Safety
 Thread Support
 Structured Exceptional Handling
 Powerful, Flexible, Simplified Data Access
 COM Interoperability
28-11-2014 ANKIT VERMA 17
28-11-2014 ANKIT VERMA 18
VB vs VB.NET
Similarities Between VB & VB.NET
 Both Are Not Case Sensitive.
 Both Support Windows & Web Based Application.
 Both Are Provided With IntelliSense Feature.
28-11-2014 ANKIT VERMA 19
Difference Between VB & VB.NET
28-11-2014 ANKIT VERMA 20
VB .NET VB
Object Oriented Object Based
Data Type Declaration Required Not Strongly Typed
Structured Exception Handling Not Structured
Namespace To Organize Classes Not Supported
Automatic Garbage Collection Not Supported
ADO .NET For DB Connectivity DAO, RDO & ADO
Multithreading Not Supported
Console Applications Are Allowed Not Allowed
New Data Type Like Char, Short & Decimal Not Supported
Variable Can Declare In Same Line
Dim a As Integer = 10
Not Allowed
Object Data Type Variant Data Type
Difference Between VB & VB.NET
28-11-2014 ANKIT VERMA 21
VB .NET VB
Fixed Length String Not Allowed Allowed
Array Index Start With O Only Array Index Can Be Changed
Set Keyword Not Supported Set Keyword Used To Assign Object
Variables
Passing By Value Is Default For Calling
Procedure
Pass By Reference
Default Properties Of Controls Not
Allowed
Allowed
Return Keyword Used To Return Values name = return value Is Used
Optional Argument Must Be Specified
With Default Value
Not Necessary
28-11-2014 ANKIT VERMA 22
DATA TYPE
Data Types Supported In VB.NET
 Number Data Types
 Byte
 Short
 Integer
 Long
 Single
 Double
 Decimal
28-11-2014 ANKIT VERMA 23
 Character Data Type
 Char
 String
 Other Data Type
 Boolean
 Date
 User Defined Data Type
e.g. Structure
28-11-2014 ANKIT VERMA 24
VARIABLES
Variables
 These Are Area In Memory Referred By Name Or
Identifier During Program Execution.
 Dim a As Integer = 10
 Dim b As Double = 14.01
 Multiple Declaration Is Allowed.
 Dim x , y As Integer
 Constant
 Value not change during execution of code.
 Const a = 45
 Identifier
 Building block of programming language.
28-11-2014 ANKIT VERMA 25
Scope Of Variables
 Block Scope
 If block
 Procedure Scope
 Function
 Module
 Class variable accessed by all functions
 Namespace Scope
 Inside namespace
 Shadowing
 Same variable name in two procedures.
 Scope only in module & accessed as FunctionName.Variable
28-11-2014 ANKIT VERMA 26
Access Control
 Public
 Private
 Protected
 Friend
 Protected Friend
28-11-2014 ANKIT VERMA 27
28-11-2014 ANKIT VERMA 28
OPERATORS
Arithmetic Operator
28-11-2014 ANKIT VERMA 29
OPRATOR OPERATION
+ Addition
- Subtraction
* Multiplication
/ Float Division
 Integer Division
^ Exponentiation
Mod Remainder
Comparison Operator
28-11-2014 ANKIT VERMA 30
OPRATOR OPERATION
< Less Than
> Greater Than
= Equality Checking
<> Not Equal To
Assignment Operator
28-11-2014 ANKIT VERMA 31
OPRATOR OPERATION
= Assignment
+= Addition With Assignment
-= Subtraction With Assignment
*= Multiplication With Assignment
/= Floating Division With Assignment
= Integer Division With Assignment
^= Exponentiation With Assignment
<= Less Than Equal To
>= Greater Than Equal To
Logical Operator
28-11-2014 ANKIT VERMA 32
OPRATOR OPERATION
AND Return True, If Both Operands True
OR Return True, If One or Both Operands True
NOT Return True, If Reverse Logical Value Of Operand
XOR Return False, If Both Operands Either True Or False
28-11-2014 ANKIT VERMA 33
CONTROL STRUCTURE
Control Structure
 Program Executes The Statement One After Other.
 Control Structure Change The Flow OF Execution Of
These Statements.
 Control Structure Are Classified Into Three Groups:
 1) Decision Making / Conditional Statements
 2) Looping
 3) Other Statements
28-11-2014 ANKIT VERMA 34
28-11-2014 ANKIT VERMA 35
1) Decision Making /
Conditional Statements
1) Decision Making / Conditional Statements
 According To Value Of Variable, Control Flow Can Be
Changed For The Execution.
 Two Statements Of This Category:
 If – Else
 Select Case
28-11-2014 ANKIT VERMA 36
1) Decision Making : If - Else
 Syntax:
If <condition> Then
[statement]
ElseIf <condition> Then
[statement]
Else
[statement]
EndIf
28-11-2014 ANKIT VERMA 37
1) Decision Making : If - Else
 Example 1:
28-11-2014 ANKIT VERMA 38
1) Decision Making : If - Else
 Example 2:
28-11-2014 ANKIT VERMA 39
1) Decision Making : Select Case
 Syntax:
Select Case <expression>
Case Value
[statement]
Case Value
[statement]
Case Else
[statement]
End Select
28-11-2014 ANKIT VERMA 40
1) Decision Making : Select Case
 Example:
28-11-2014 ANKIT VERMA 41
28-11-2014 ANKIT VERMA 42
2) Looping
2) Looping
 Execute Statements Repeatedly & Quickly.
 Three Statements Of This Category:
 Do Loop
 While Loop
 For Loop
28-11-2014 ANKIT VERMA 43
2) Looping : Do Loop
 Syntax:
Do While <condition>
[statement]
Loop
(OR)
Do Until <condition>
[statement]
Loop
28-11-2014 ANKIT VERMA 44
 NOTE: Do Until loop executes only if statement is False.
2) Looping : Do Loop
 Example (Do While):
28-11-2014 ANKIT VERMA 45
2) Looping : Do Loop
 Example (Do Until):
28-11-2014 ANKIT VERMA 46
2) Looping : While
 Syntax:
While <condition>
[statement]
End While
28-11-2014 ANKIT VERMA 47
2) Looping : While
 Example:
28-11-2014 ANKIT VERMA 48
2) Looping : For
 Syntax:
For index = start To end Step 1
[statement]
Next
28-11-2014 ANKIT VERMA 49
2) Looping : For
 Example:
28-11-2014 ANKIT VERMA 50
28-11-2014 ANKIT VERMA 51
3) Other Statements
3) Other Statements
 Exit
 Used to exit from loop
 GOTO
 Transfer the control to specified label
 Stop
 Return the program into break mode
 End
 Terminate the program
 Return
 Used in function to return the value to the calling method
28-11-2014 ANKIT VERMA 52
3) Other Statement : GoTo , Exit
 Example:
28-11-2014 ANKIT VERMA 53
3) Other Statement : Stop, End
 Example:
28-11-2014 ANKIT VERMA 54
28-11-2014 ANKIT VERMA 55
DATA STRUCTURE
Data Structure In VB .NET
 DS is a way of storing & organizing data in computer,
so that it can be used efficiently.
 Different kind of DS are suited for different kind of
applications.
 Some DS are highly specialized for specific tasks.
 Various DS Are:
 Array
 Array Lists
 Enumeration
28-11-2014 ANKIT VERMA 56
28-11-2014 ANKIT VERMA 57
1) Array
1) Array
 Array can hold collection of values of same type.
 Element
 Variable in an array is called Element.
 Array has name & its elements can be accessed by
Index or Subscript.
 Array can be single, double or multi dimension.
 Lower Bound (LB) of all dimension array start with O.
 Array is reference type.
 Types of Array:
 Static Array
 Dynamic Array
28-11-2014 ANKIT VERMA 58
1) Array : Static Array
 Size of Static Array remain same even at runtime.
 If Array is declared as Object type, we can store
different types of Data Type.
 Syntax:
Dim a(5) As Integer
Dim b(3,5) As String
Dim c( ) As Single = {10.1 , 24.7}
Dim d(3) As Object
28-11-2014 ANKIT VERMA 59
1) Array : Static Array
 Example:
28-11-2014 ANKIT VERMA 60
1) Array : Dynamic Array
 Size of Dynamic Array changes during execution.
 Used when you don’t know the size of Array.
 Size of Array not provided during declaration.
 Redim
 After declaration no one change the data type .
 Preserve
 Preserve data without losing when dimension of array change.
28-11-2014 ANKIT VERMA 61
1) Array : Dynamic Array
 Syntax:
Dim a( ) As String
Redim a(5)
Dim b( , ) As Integer
Redim b(3,2)
ReDim Preserve b(3,4)
28-11-2014 ANKIT VERMA 62
1) Array : Dynamic Array
 Example:
28-11-2014 ANKIT VERMA 63
Value Not Lost After
Dimension Change
Because Of Preserve
1) Array : Functions Of Array
 Ubound (arrayname)
 Determine upper bound of array.
 Lbound (arrayname)
 Determine lower bound of array.
28-11-2014 ANKIT VERMA 64
28-11-2014 ANKIT VERMA 65
2) Array Lists
2) Array Lists
 Flexible Data Structure.
 List can Grow & Shrink dynamically.
 Contain list of values, on which we can perform
operations like Add, Delete etc.
28-11-2014 ANKIT VERMA 66
2) Array Lists : Properties & Functions
 Add
 Add an item.
 Insert
 Insert an item at specified position.
 Remove
 Remove an item.
 RemoveAt
 Remove an item from specified position.
 Sort
 Sort items.
 Count
 Count the number of elements.
28-11-2014 ANKIT VERMA 67
2) Array Lists
 Example 1:
28-11-2014 ANKIT VERMA 68
2) Array Lists
 Example 2:
28-11-2014 ANKIT VERMA 69
2) Array Lists
 Example 2 (Output):
28-11-2014 ANKIT VERMA 70
28-11-2014 ANKIT VERMA 71
3) Enumerations
3) Enumerations
 Enumeration is set of related constants that define a
value type, where each constant is known as member
of Enumeration.
 Work for many constant of same type.
 It set object properties & specify values that are passed
to methods.
 Syntax:
[access modifier] Enum name
<Member List>
End Enum
28-11-2014 ANKIT VERMA 72
3) Enumerations
 Example:
28-11-2014 ANKIT VERMA 73
28-11-2014 ANKIT VERMA 74
PREDEFINED FUNCTIONS
28-11-2014 ANKIT VERMA 75
1) MsgBox Function
1) MsgBox Function
 Produce pop-up message box.
 Prompt user to click on command button before he
can continues.
 This function return the result values.
28-11-2014 ANKIT VERMA 76
1) MsgBox Function
 Msg=MsgBox(Prompt, Style Value, Title)
 Prompt
 It is message of 1024 (approx.) characters , be displayed to user.
 Style
 Denote the style & type of buttons to display in message box.
 Values
 MsgBoxStyle.YesNoCancel
 MsgBoxStyle.YesNo
 MsgBoxStyle.OkOnly (Default)
 MsgBoxStyle.OkCancel
 MsgBoxStyle.Exclamation
 Title denotes the string displayed in title bar.
28-11-2014 ANKIT VERMA 77
1) MsgBox Function
 Result Values Can Be
 MsgboxResult.ok
 MsgboxResult.cancel
 MsgboxResult.abort
 MsgboxResult.retry
 MsgboxResult.ignore
 MsgboxResult.yes
 MsgboxResult.no
28-11-2014 ANKIT VERMA 78
1) MsgBox Function
 Example:
28-11-2014 ANKIT VERMA 79
28-11-2014 ANKIT VERMA 80
2) InputBox Function
2) InputBox Function
 InputBox () function will display a message box where user
enter value or text.
 Return value of function is string type.
 Msg=InputBox(Prompt, Title, default_text, x-position,y-position)
 Prompt
 String expression displayed in dialog box.
 Title
 String expression displayed in title bar.
 Default Text
 Default response when user not provide input.
 X, Y Position
 Indicate the appearance if input box in screen.
28-11-2014 ANKIT VERMA 81
2) InputBox Function
 Syntax:
28-11-2014 ANKIT VERMA 82
28-11-2014 ANKIT VERMA 83
3) Other Function
3) Other Function
28-11-2014 ANKIT VERMA 84
FUNCTION USE
Strcomp Comparison for two strings
Lcase Convert String into Lower case
Ucase Convert String into Upper case
Rtrim Remove trailing spaces
Ltrim Remove leading spaces
Trim Remove both leading & trailing spaces
Mid Return specific number of character
Asc Return ASCII code of first letter in a string
Chr Return character of given ASCII code
Now Return current system date time
28-11-2014 ANKIT VERMA 85
COMMENTS
Comments
 Comments are explanatory notes included in program
code following a single quotation mark (‘).
 Single Line Comment
 Provide single quotation mark (‘) before line.
 Multiple Line Comment
 Select multiple lines, whom you want to make comment.
 Click Menu Edit  Advance  Comment Selection
 or
 Press Ctrl +K, Ctrl +C
28-11-2014 ANKIT VERMA 86
28-11-2014 ANKIT VERMA 87
PROCEDURES & FUNCTIONS
Procedures & Functions
 They are group of related commands that perform
certain tasks and also called subprogram.
 Used for repeated task.
 Modular & easy to maintain.
 Easy to debug
 Any changes to code, you have to make changes only in
procedures, not every place of code.
 Subprograms can be invoked from calling block.
 Control transfer to procedure & after execution, return
back to calling procedure.
28-11-2014 ANKIT VERMA 88
Procedures & Functions
 Argument which is passed can be variable, constant or
expression.
 You can write the procedure in module, class module
and form module.
 Procedure of class module support OOP concept.
 There are four types of procedure:
 Sub Procedure
 Function Procedure
 Event Procedure
 Invoked according to action associated with controls.
 Property Procedure
28-11-2014 ANKIT VERMA 89
28-11-2014 ANKIT VERMA 90
1) Sub Procedure
1) Sub Procedure
 Sub Procedure can not return value.
 Parentheses are not optional in VB .NET
 Even no parameters still procedure enclosed using
empty parentheses.
 For calling, procedure name followed by parameters.
 Syntax:
[Access Specifier] sub Name (Arg As DataType, …)
<Statement>
End Sub
28-11-2014 ANKIT VERMA 91
1) Sub Procedure
 Example:
28-11-2014 ANKIT VERMA 92
1) Sub Procedure
 Example:
28-11-2014 ANKIT VERMA 93
28-11-2014 ANKIT VERMA 94
2) Function Procedure
2) Function Procedure
 Return a value back to calling program.
 Function can return values in two ways:
 Using Return statement
 Assign value to function name, like VB
 If return data type is not mentioned, Object type will
be default one.
 Function can also called same as procedure.
 Syntax:
[Access Specifier] Function Name (Arg As DataType, …) [As DataType]
<Statement>
End Sub
28-11-2014 ANKIT VERMA 95
2) Function Procedure
 Example:
28-11-2014 ANKIT VERMA 96
28-11-2014 ANKIT VERMA 97
3) Event Procedure
3) Event Procedure
 Events are actions associate with object.
 Foam Load
 Button Click
 Mouse Click
 Events can be raised by user action, by system or by
code itself.
 User can write code to handle events, called event
handling procedures.
 By these procedures, we can call the sub or function
procedures, called implicitly.
28-11-2014 ANKIT VERMA 98
28-11-2014 ANKIT VERMA 99
PARAMETER PASSING
Passing Parameter
 Code in a procedure needs some information about the
state of the program to do the job.
 These are passed to procedures as arguments.
 There are two ways:
 Pass By Value
 Pass By Reference
28-11-2014 ANKIT VERMA 100
1) Pass By Value
 Default mode of passing arguments.
 Copy of argument is passed to the procedure.
 Any change in value never affect the original variable,
but only affect the copy.
 ByVal keyword is used explicitly, otherwise compiler
automatically inserts this keyword.
 Syntax:
Public Sub disp (ByVal a As Integer)
<statements>
End Sub
28-11-2014 ANKIT VERMA 101
2) Pass By Reference
 Address of argument is passed to procedure.
 Procedure can change its value permanently.
 Procedure have full access to argument.
 ByRef keyword is used.
 Syntax:
Public Sub disp (ByRef a As Integer)
<statements>
End Sub
28-11-2014 ANKIT VERMA 102
3) Optional Argument
 Optional argument is passed to provide some optional
argument with default value.
 If we not pass value of argument, default value will be
substituted.
28-11-2014 ANKIT VERMA 103
4) Named Argument
 Argument data type can’t be changed when we pass the
arguments to procedure.
 Using Named Argument, we can pass the value by
providing Argument Name followed by colon, an equal
sign and argument value.
 Arguments can be passed in any order.
28-11-2014 ANKIT VERMA 104
28-11-2014 ANKIT VERMA 105
CREATING & USING
NAMESPACE
Creating & Using Namespace
 Namespace allows you to create your own namespaces
for holding classes.
 By default classes are created in root namespace that is
based on your project name.
 Syntax:
Namespace <namespace name>
Class <class name>
Members
End Class
End Namespace
28-11-2014 ANKIT VERMA 106
Creating & Using Namespace
 Creating:
 Using
28-11-2014 ANKIT VERMA 107
THANKYOU
P R E S E N T A T I O N B Y :
A N K I T V E R M A
( I T D E P A R T M E N T )
DOUBTS
A N K I T V E R M A A S S T . P R O F E S S O R

More Related Content

What's hot

Book management system
Book management systemBook management system
Book management systemSHARDA SHARAN
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0Aarti P
 
Skillwise - Cobol Programming Basics
Skillwise - Cobol Programming BasicsSkillwise - Cobol Programming Basics
Skillwise - Cobol Programming BasicsSkillwise Group
 
Cobol training class-1
Cobol training class-1Cobol training class-1
Cobol training class-1Anil Polsani
 
Function pointer - Wikipedia, the free encyclopedia
Function pointer - Wikipedia, the free encyclopediaFunction pointer - Wikipedia, the free encyclopedia
Function pointer - Wikipedia, the free encyclopediaRishikesh Agrawani
 
.NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know....NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know...Dan Douglas
 
Cobol programming language
Cobol programming languageCobol programming language
Cobol programming languageBurhan Ahmed
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingPhases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingMukesh Tekwani
 
Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Peter R. Egli
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answersUttam Agrawal
 
A Checklist for Migrating Big Iron Cobol Applications
A Checklist for Migrating Big Iron Cobol ApplicationsA Checklist for Migrating Big Iron Cobol Applications
A Checklist for Migrating Big Iron Cobol ApplicationsCognizant
 

What's hot (20)

Book management system
Book management systemBook management system
Book management system
 
Intake 37 ef1
Intake 37 ef1Intake 37 ef1
Intake 37 ef1
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 
Ejb
EjbEjb
Ejb
 
Skillwise - Cobol Programming Basics
Skillwise - Cobol Programming BasicsSkillwise - Cobol Programming Basics
Skillwise - Cobol Programming Basics
 
Cobol training class-1
Cobol training class-1Cobol training class-1
Cobol training class-1
 
oracle-reports6i
oracle-reports6ioracle-reports6i
oracle-reports6i
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
 
Cobol basics 19-6-2010
Cobol basics 19-6-2010Cobol basics 19-6-2010
Cobol basics 19-6-2010
 
Function pointer - Wikipedia, the free encyclopedia
Function pointer - Wikipedia, the free encyclopediaFunction pointer - Wikipedia, the free encyclopedia
Function pointer - Wikipedia, the free encyclopedia
 
Unmanged code InterOperability
Unmanged code InterOperabilityUnmanged code InterOperability
Unmanged code InterOperability
 
Bca cobol
Bca cobolBca cobol
Bca cobol
 
.NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know....NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know...
 
Cobol programming language
Cobol programming languageCobol programming language
Cobol programming language
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingPhases of the Compiler - Systems Programming
Phases of the Compiler - Systems Programming
 
Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)
 
Sp2 4
Sp2 4Sp2 4
Sp2 4
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
 
A Checklist for Migrating Big Iron Cobol Applications
A Checklist for Migrating Big Iron Cobol ApplicationsA Checklist for Migrating Big Iron Cobol Applications
A Checklist for Migrating Big Iron Cobol Applications
 
Mis4200notes8 2
Mis4200notes8 2Mis4200notes8 2
Mis4200notes8 2
 

Similar to BCA IPU VB.NET UNIT-II

Ide and datatypes vb-net-u-ii-p2
Ide and datatypes  vb-net-u-ii-p2Ide and datatypes  vb-net-u-ii-p2
Ide and datatypes vb-net-u-ii-p2Prachi Sasankar
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan
 
ASP.Net Technologies Part-2
ASP.Net Technologies Part-2ASP.Net Technologies Part-2
ASP.Net Technologies Part-2Vasudev Sharma
 
C#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New FeaturesC#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New Featurestechfreak
 
Tablas y almacenamiento en windows azure
Tablas y almacenamiento en windows azureTablas y almacenamiento en windows azure
Tablas y almacenamiento en windows azureEduardo Castro
 
Stop hardcoding follow parameterization
Stop hardcoding  follow parameterizationStop hardcoding  follow parameterization
Stop hardcoding follow parameterizationPreeti Sagar
 
Visual studio 2008
Visual studio 2008Visual studio 2008
Visual studio 2008Luis Enrique
 
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdfptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdfjorgeulises3
 
SystemVerilog-20041201165354.ppt
SystemVerilog-20041201165354.pptSystemVerilog-20041201165354.ppt
SystemVerilog-20041201165354.pptravi446393
 
Introduction To Work Item Customisation
Introduction To Work Item CustomisationIntroduction To Work Item Customisation
Introduction To Work Item Customisationwbarthol
 
Not all objects are equal - strategies for designing testable code
Not all objects are equal - strategies for designing testable codeNot all objects are equal - strategies for designing testable code
Not all objects are equal - strategies for designing testable codeSagy Rozman
 
Introduction to apex
Introduction to apexIntroduction to apex
Introduction to apexRinku Saini
 
LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners Tilak Devaraj
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfoliomwillmer
 
Lansa Development V12
Lansa Development V12Lansa Development V12
Lansa Development V12thedonn57
 
Linq in C# 3.0: An Overview
Linq in C# 3.0: An OverviewLinq in C# 3.0: An Overview
Linq in C# 3.0: An Overviewpradeepkothiyal
 

Similar to BCA IPU VB.NET UNIT-II (20)

Ide and datatypes vb-net-u-ii-p2
Ide and datatypes  vb-net-u-ii-p2Ide and datatypes  vb-net-u-ii-p2
Ide and datatypes vb-net-u-ii-p2
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
 
ASP.Net Technologies Part-2
ASP.Net Technologies Part-2ASP.Net Technologies Part-2
ASP.Net Technologies Part-2
 
C#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New FeaturesC#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New Features
 
Tablas y almacenamiento en windows azure
Tablas y almacenamiento en windows azureTablas y almacenamiento en windows azure
Tablas y almacenamiento en windows azure
 
Stop hardcoding follow parameterization
Stop hardcoding  follow parameterizationStop hardcoding  follow parameterization
Stop hardcoding follow parameterization
 
Visual studio 2008
Visual studio 2008Visual studio 2008
Visual studio 2008
 
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdfptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
 
SystemVerilog-20041201165354.ppt
SystemVerilog-20041201165354.pptSystemVerilog-20041201165354.ppt
SystemVerilog-20041201165354.ppt
 
What's New in Visual Studio 2008
What's New in Visual Studio 2008What's New in Visual Studio 2008
What's New in Visual Studio 2008
 
Linq
LinqLinq
Linq
 
Introduction To Work Item Customisation
Introduction To Work Item CustomisationIntroduction To Work Item Customisation
Introduction To Work Item Customisation
 
Not all objects are equal - strategies for designing testable code
Not all objects are equal - strategies for designing testable codeNot all objects are equal - strategies for designing testable code
Not all objects are equal - strategies for designing testable code
 
Introduction to apex
Introduction to apexIntroduction to apex
Introduction to apex
 
LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners
 
B_110500002
B_110500002B_110500002
B_110500002
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
Lansa Development V12
Lansa Development V12Lansa Development V12
Lansa Development V12
 
unit 2.pptx
unit 2.pptxunit 2.pptx
unit 2.pptx
 
Linq in C# 3.0: An Overview
Linq in C# 3.0: An OverviewLinq in C# 3.0: An Overview
Linq in C# 3.0: An Overview
 

Recently uploaded

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

BCA IPU VB.NET UNIT-II

  • 1. FEDT VB.NET F R O N T E N D D E S I G N T O O L U S I N G V B . N E T P R E S E N T A T I O N B Y : A N K I T V E R M A ( I T D E P A R T M E N T ) A N K I T V E R M A A S S T . P R O F E S S O R U N I T - 2
  • 3. Elements Of IDE  Windows Form Designer  Add control to form, arrange them & add code.  Properties Window  Lists properties associated with control.  Solution Explorer  Display solution name, project name, form name, fields etc.  Tool Box  Provide controls like form, data, components, toolbar, menu etc.  Object Browser  Shows the members of object 28-11-2014 ANKIT VERMA 3
  • 4. Elements Of IDE  Task List Window  List of errors in source code.  Server Explorer  Database connectivity, display tables, views, connections etc.  Dynamic Help  Context sensitive help.  Class View  Display Classes , methods, properties etc.  Code & Text Editor Window  Allow to enter and edit code 28-11-2014 ANKIT VERMA 4
  • 5. 28-11-2014 ANKIT VERMA 5 STEPS OF WRITING APPLICATION IN .NET
  • 6. Steps Of Writing Application In .NET  Start  Visual Studio 2010 28-11-2014 ANKIT VERMA 6
  • 7. Steps Of Writing Application In .NET  File  New Project  Select Language VB.NET  Choose Console or Window Application 28-11-2014 ANKIT VERMA 7 Provide Project Name
  • 8. Steps Of Writing Application In .NET 28-11-2014 ANKIT VERMA 8
  • 9. Steps Of Writing Application In .NET 28-11-2014 ANKIT VERMA 9
  • 10. Steps Of Writing Application In .NET  Write Code of program to be made.  Save Code by click File  Save All  Press F5 & Run 28-11-2014 ANKIT VERMA 10
  • 11. 28-11-2014 ANKIT VERMA 11 PROJECT TEMPLATE
  • 12. Project Templates  Window Application  Create application with window interface.  Class Library  Create classes to use in other application.  Console Application  Create command line application.  Window Control Library  Create control for applications.  Empty Project  Creating local application. 28-11-2014 ANKIT VERMA 12
  • 13. Project Templates  Window Service  Create window service. 28-11-2014 ANKIT VERMA 13
  • 14. VB Terms  Design Time  Environment where application being developed.  Run Time  Execution of application.  Forms  Basic element for creating user interface for application.  Controls  Manipulate information.  Properties  Control characteristics like color, caption, size etc. 28-11-2014 ANKIT VERMA 14
  • 15. VB Terms  Methods  Actions that can be performed by object  Events  Action recognized by form or control.  Generated by user, OS or application. 28-11-2014 ANKIT VERMA 15
  • 16. 28-11-2014 ANKIT VERMA 16 FEATURES OF VB.NET
  • 17. Features Of VB.NET  Simple  Consistency  Garbage Collection  Object Orientation  Type Safety  Thread Support  Structured Exceptional Handling  Powerful, Flexible, Simplified Data Access  COM Interoperability 28-11-2014 ANKIT VERMA 17
  • 18. 28-11-2014 ANKIT VERMA 18 VB vs VB.NET
  • 19. Similarities Between VB & VB.NET  Both Are Not Case Sensitive.  Both Support Windows & Web Based Application.  Both Are Provided With IntelliSense Feature. 28-11-2014 ANKIT VERMA 19
  • 20. Difference Between VB & VB.NET 28-11-2014 ANKIT VERMA 20 VB .NET VB Object Oriented Object Based Data Type Declaration Required Not Strongly Typed Structured Exception Handling Not Structured Namespace To Organize Classes Not Supported Automatic Garbage Collection Not Supported ADO .NET For DB Connectivity DAO, RDO & ADO Multithreading Not Supported Console Applications Are Allowed Not Allowed New Data Type Like Char, Short & Decimal Not Supported Variable Can Declare In Same Line Dim a As Integer = 10 Not Allowed Object Data Type Variant Data Type
  • 21. Difference Between VB & VB.NET 28-11-2014 ANKIT VERMA 21 VB .NET VB Fixed Length String Not Allowed Allowed Array Index Start With O Only Array Index Can Be Changed Set Keyword Not Supported Set Keyword Used To Assign Object Variables Passing By Value Is Default For Calling Procedure Pass By Reference Default Properties Of Controls Not Allowed Allowed Return Keyword Used To Return Values name = return value Is Used Optional Argument Must Be Specified With Default Value Not Necessary
  • 22. 28-11-2014 ANKIT VERMA 22 DATA TYPE
  • 23. Data Types Supported In VB.NET  Number Data Types  Byte  Short  Integer  Long  Single  Double  Decimal 28-11-2014 ANKIT VERMA 23  Character Data Type  Char  String  Other Data Type  Boolean  Date  User Defined Data Type e.g. Structure
  • 24. 28-11-2014 ANKIT VERMA 24 VARIABLES
  • 25. Variables  These Are Area In Memory Referred By Name Or Identifier During Program Execution.  Dim a As Integer = 10  Dim b As Double = 14.01  Multiple Declaration Is Allowed.  Dim x , y As Integer  Constant  Value not change during execution of code.  Const a = 45  Identifier  Building block of programming language. 28-11-2014 ANKIT VERMA 25
  • 26. Scope Of Variables  Block Scope  If block  Procedure Scope  Function  Module  Class variable accessed by all functions  Namespace Scope  Inside namespace  Shadowing  Same variable name in two procedures.  Scope only in module & accessed as FunctionName.Variable 28-11-2014 ANKIT VERMA 26
  • 27. Access Control  Public  Private  Protected  Friend  Protected Friend 28-11-2014 ANKIT VERMA 27
  • 28. 28-11-2014 ANKIT VERMA 28 OPERATORS
  • 29. Arithmetic Operator 28-11-2014 ANKIT VERMA 29 OPRATOR OPERATION + Addition - Subtraction * Multiplication / Float Division Integer Division ^ Exponentiation Mod Remainder
  • 30. Comparison Operator 28-11-2014 ANKIT VERMA 30 OPRATOR OPERATION < Less Than > Greater Than = Equality Checking <> Not Equal To
  • 31. Assignment Operator 28-11-2014 ANKIT VERMA 31 OPRATOR OPERATION = Assignment += Addition With Assignment -= Subtraction With Assignment *= Multiplication With Assignment /= Floating Division With Assignment = Integer Division With Assignment ^= Exponentiation With Assignment <= Less Than Equal To >= Greater Than Equal To
  • 32. Logical Operator 28-11-2014 ANKIT VERMA 32 OPRATOR OPERATION AND Return True, If Both Operands True OR Return True, If One or Both Operands True NOT Return True, If Reverse Logical Value Of Operand XOR Return False, If Both Operands Either True Or False
  • 33. 28-11-2014 ANKIT VERMA 33 CONTROL STRUCTURE
  • 34. Control Structure  Program Executes The Statement One After Other.  Control Structure Change The Flow OF Execution Of These Statements.  Control Structure Are Classified Into Three Groups:  1) Decision Making / Conditional Statements  2) Looping  3) Other Statements 28-11-2014 ANKIT VERMA 34
  • 35. 28-11-2014 ANKIT VERMA 35 1) Decision Making / Conditional Statements
  • 36. 1) Decision Making / Conditional Statements  According To Value Of Variable, Control Flow Can Be Changed For The Execution.  Two Statements Of This Category:  If – Else  Select Case 28-11-2014 ANKIT VERMA 36
  • 37. 1) Decision Making : If - Else  Syntax: If <condition> Then [statement] ElseIf <condition> Then [statement] Else [statement] EndIf 28-11-2014 ANKIT VERMA 37
  • 38. 1) Decision Making : If - Else  Example 1: 28-11-2014 ANKIT VERMA 38
  • 39. 1) Decision Making : If - Else  Example 2: 28-11-2014 ANKIT VERMA 39
  • 40. 1) Decision Making : Select Case  Syntax: Select Case <expression> Case Value [statement] Case Value [statement] Case Else [statement] End Select 28-11-2014 ANKIT VERMA 40
  • 41. 1) Decision Making : Select Case  Example: 28-11-2014 ANKIT VERMA 41
  • 42. 28-11-2014 ANKIT VERMA 42 2) Looping
  • 43. 2) Looping  Execute Statements Repeatedly & Quickly.  Three Statements Of This Category:  Do Loop  While Loop  For Loop 28-11-2014 ANKIT VERMA 43
  • 44. 2) Looping : Do Loop  Syntax: Do While <condition> [statement] Loop (OR) Do Until <condition> [statement] Loop 28-11-2014 ANKIT VERMA 44  NOTE: Do Until loop executes only if statement is False.
  • 45. 2) Looping : Do Loop  Example (Do While): 28-11-2014 ANKIT VERMA 45
  • 46. 2) Looping : Do Loop  Example (Do Until): 28-11-2014 ANKIT VERMA 46
  • 47. 2) Looping : While  Syntax: While <condition> [statement] End While 28-11-2014 ANKIT VERMA 47
  • 48. 2) Looping : While  Example: 28-11-2014 ANKIT VERMA 48
  • 49. 2) Looping : For  Syntax: For index = start To end Step 1 [statement] Next 28-11-2014 ANKIT VERMA 49
  • 50. 2) Looping : For  Example: 28-11-2014 ANKIT VERMA 50
  • 51. 28-11-2014 ANKIT VERMA 51 3) Other Statements
  • 52. 3) Other Statements  Exit  Used to exit from loop  GOTO  Transfer the control to specified label  Stop  Return the program into break mode  End  Terminate the program  Return  Used in function to return the value to the calling method 28-11-2014 ANKIT VERMA 52
  • 53. 3) Other Statement : GoTo , Exit  Example: 28-11-2014 ANKIT VERMA 53
  • 54. 3) Other Statement : Stop, End  Example: 28-11-2014 ANKIT VERMA 54
  • 55. 28-11-2014 ANKIT VERMA 55 DATA STRUCTURE
  • 56. Data Structure In VB .NET  DS is a way of storing & organizing data in computer, so that it can be used efficiently.  Different kind of DS are suited for different kind of applications.  Some DS are highly specialized for specific tasks.  Various DS Are:  Array  Array Lists  Enumeration 28-11-2014 ANKIT VERMA 56
  • 57. 28-11-2014 ANKIT VERMA 57 1) Array
  • 58. 1) Array  Array can hold collection of values of same type.  Element  Variable in an array is called Element.  Array has name & its elements can be accessed by Index or Subscript.  Array can be single, double or multi dimension.  Lower Bound (LB) of all dimension array start with O.  Array is reference type.  Types of Array:  Static Array  Dynamic Array 28-11-2014 ANKIT VERMA 58
  • 59. 1) Array : Static Array  Size of Static Array remain same even at runtime.  If Array is declared as Object type, we can store different types of Data Type.  Syntax: Dim a(5) As Integer Dim b(3,5) As String Dim c( ) As Single = {10.1 , 24.7} Dim d(3) As Object 28-11-2014 ANKIT VERMA 59
  • 60. 1) Array : Static Array  Example: 28-11-2014 ANKIT VERMA 60
  • 61. 1) Array : Dynamic Array  Size of Dynamic Array changes during execution.  Used when you don’t know the size of Array.  Size of Array not provided during declaration.  Redim  After declaration no one change the data type .  Preserve  Preserve data without losing when dimension of array change. 28-11-2014 ANKIT VERMA 61
  • 62. 1) Array : Dynamic Array  Syntax: Dim a( ) As String Redim a(5) Dim b( , ) As Integer Redim b(3,2) ReDim Preserve b(3,4) 28-11-2014 ANKIT VERMA 62
  • 63. 1) Array : Dynamic Array  Example: 28-11-2014 ANKIT VERMA 63 Value Not Lost After Dimension Change Because Of Preserve
  • 64. 1) Array : Functions Of Array  Ubound (arrayname)  Determine upper bound of array.  Lbound (arrayname)  Determine lower bound of array. 28-11-2014 ANKIT VERMA 64
  • 65. 28-11-2014 ANKIT VERMA 65 2) Array Lists
  • 66. 2) Array Lists  Flexible Data Structure.  List can Grow & Shrink dynamically.  Contain list of values, on which we can perform operations like Add, Delete etc. 28-11-2014 ANKIT VERMA 66
  • 67. 2) Array Lists : Properties & Functions  Add  Add an item.  Insert  Insert an item at specified position.  Remove  Remove an item.  RemoveAt  Remove an item from specified position.  Sort  Sort items.  Count  Count the number of elements. 28-11-2014 ANKIT VERMA 67
  • 68. 2) Array Lists  Example 1: 28-11-2014 ANKIT VERMA 68
  • 69. 2) Array Lists  Example 2: 28-11-2014 ANKIT VERMA 69
  • 70. 2) Array Lists  Example 2 (Output): 28-11-2014 ANKIT VERMA 70
  • 71. 28-11-2014 ANKIT VERMA 71 3) Enumerations
  • 72. 3) Enumerations  Enumeration is set of related constants that define a value type, where each constant is known as member of Enumeration.  Work for many constant of same type.  It set object properties & specify values that are passed to methods.  Syntax: [access modifier] Enum name <Member List> End Enum 28-11-2014 ANKIT VERMA 72
  • 74. 28-11-2014 ANKIT VERMA 74 PREDEFINED FUNCTIONS
  • 75. 28-11-2014 ANKIT VERMA 75 1) MsgBox Function
  • 76. 1) MsgBox Function  Produce pop-up message box.  Prompt user to click on command button before he can continues.  This function return the result values. 28-11-2014 ANKIT VERMA 76
  • 77. 1) MsgBox Function  Msg=MsgBox(Prompt, Style Value, Title)  Prompt  It is message of 1024 (approx.) characters , be displayed to user.  Style  Denote the style & type of buttons to display in message box.  Values  MsgBoxStyle.YesNoCancel  MsgBoxStyle.YesNo  MsgBoxStyle.OkOnly (Default)  MsgBoxStyle.OkCancel  MsgBoxStyle.Exclamation  Title denotes the string displayed in title bar. 28-11-2014 ANKIT VERMA 77
  • 78. 1) MsgBox Function  Result Values Can Be  MsgboxResult.ok  MsgboxResult.cancel  MsgboxResult.abort  MsgboxResult.retry  MsgboxResult.ignore  MsgboxResult.yes  MsgboxResult.no 28-11-2014 ANKIT VERMA 78
  • 79. 1) MsgBox Function  Example: 28-11-2014 ANKIT VERMA 79
  • 80. 28-11-2014 ANKIT VERMA 80 2) InputBox Function
  • 81. 2) InputBox Function  InputBox () function will display a message box where user enter value or text.  Return value of function is string type.  Msg=InputBox(Prompt, Title, default_text, x-position,y-position)  Prompt  String expression displayed in dialog box.  Title  String expression displayed in title bar.  Default Text  Default response when user not provide input.  X, Y Position  Indicate the appearance if input box in screen. 28-11-2014 ANKIT VERMA 81
  • 82. 2) InputBox Function  Syntax: 28-11-2014 ANKIT VERMA 82
  • 83. 28-11-2014 ANKIT VERMA 83 3) Other Function
  • 84. 3) Other Function 28-11-2014 ANKIT VERMA 84 FUNCTION USE Strcomp Comparison for two strings Lcase Convert String into Lower case Ucase Convert String into Upper case Rtrim Remove trailing spaces Ltrim Remove leading spaces Trim Remove both leading & trailing spaces Mid Return specific number of character Asc Return ASCII code of first letter in a string Chr Return character of given ASCII code Now Return current system date time
  • 85. 28-11-2014 ANKIT VERMA 85 COMMENTS
  • 86. Comments  Comments are explanatory notes included in program code following a single quotation mark (‘).  Single Line Comment  Provide single quotation mark (‘) before line.  Multiple Line Comment  Select multiple lines, whom you want to make comment.  Click Menu Edit  Advance  Comment Selection  or  Press Ctrl +K, Ctrl +C 28-11-2014 ANKIT VERMA 86
  • 87. 28-11-2014 ANKIT VERMA 87 PROCEDURES & FUNCTIONS
  • 88. Procedures & Functions  They are group of related commands that perform certain tasks and also called subprogram.  Used for repeated task.  Modular & easy to maintain.  Easy to debug  Any changes to code, you have to make changes only in procedures, not every place of code.  Subprograms can be invoked from calling block.  Control transfer to procedure & after execution, return back to calling procedure. 28-11-2014 ANKIT VERMA 88
  • 89. Procedures & Functions  Argument which is passed can be variable, constant or expression.  You can write the procedure in module, class module and form module.  Procedure of class module support OOP concept.  There are four types of procedure:  Sub Procedure  Function Procedure  Event Procedure  Invoked according to action associated with controls.  Property Procedure 28-11-2014 ANKIT VERMA 89
  • 90. 28-11-2014 ANKIT VERMA 90 1) Sub Procedure
  • 91. 1) Sub Procedure  Sub Procedure can not return value.  Parentheses are not optional in VB .NET  Even no parameters still procedure enclosed using empty parentheses.  For calling, procedure name followed by parameters.  Syntax: [Access Specifier] sub Name (Arg As DataType, …) <Statement> End Sub 28-11-2014 ANKIT VERMA 91
  • 92. 1) Sub Procedure  Example: 28-11-2014 ANKIT VERMA 92
  • 93. 1) Sub Procedure  Example: 28-11-2014 ANKIT VERMA 93
  • 94. 28-11-2014 ANKIT VERMA 94 2) Function Procedure
  • 95. 2) Function Procedure  Return a value back to calling program.  Function can return values in two ways:  Using Return statement  Assign value to function name, like VB  If return data type is not mentioned, Object type will be default one.  Function can also called same as procedure.  Syntax: [Access Specifier] Function Name (Arg As DataType, …) [As DataType] <Statement> End Sub 28-11-2014 ANKIT VERMA 95
  • 96. 2) Function Procedure  Example: 28-11-2014 ANKIT VERMA 96
  • 97. 28-11-2014 ANKIT VERMA 97 3) Event Procedure
  • 98. 3) Event Procedure  Events are actions associate with object.  Foam Load  Button Click  Mouse Click  Events can be raised by user action, by system or by code itself.  User can write code to handle events, called event handling procedures.  By these procedures, we can call the sub or function procedures, called implicitly. 28-11-2014 ANKIT VERMA 98
  • 99. 28-11-2014 ANKIT VERMA 99 PARAMETER PASSING
  • 100. Passing Parameter  Code in a procedure needs some information about the state of the program to do the job.  These are passed to procedures as arguments.  There are two ways:  Pass By Value  Pass By Reference 28-11-2014 ANKIT VERMA 100
  • 101. 1) Pass By Value  Default mode of passing arguments.  Copy of argument is passed to the procedure.  Any change in value never affect the original variable, but only affect the copy.  ByVal keyword is used explicitly, otherwise compiler automatically inserts this keyword.  Syntax: Public Sub disp (ByVal a As Integer) <statements> End Sub 28-11-2014 ANKIT VERMA 101
  • 102. 2) Pass By Reference  Address of argument is passed to procedure.  Procedure can change its value permanently.  Procedure have full access to argument.  ByRef keyword is used.  Syntax: Public Sub disp (ByRef a As Integer) <statements> End Sub 28-11-2014 ANKIT VERMA 102
  • 103. 3) Optional Argument  Optional argument is passed to provide some optional argument with default value.  If we not pass value of argument, default value will be substituted. 28-11-2014 ANKIT VERMA 103
  • 104. 4) Named Argument  Argument data type can’t be changed when we pass the arguments to procedure.  Using Named Argument, we can pass the value by providing Argument Name followed by colon, an equal sign and argument value.  Arguments can be passed in any order. 28-11-2014 ANKIT VERMA 104
  • 105. 28-11-2014 ANKIT VERMA 105 CREATING & USING NAMESPACE
  • 106. Creating & Using Namespace  Namespace allows you to create your own namespaces for holding classes.  By default classes are created in root namespace that is based on your project name.  Syntax: Namespace <namespace name> Class <class name> Members End Class End Namespace 28-11-2014 ANKIT VERMA 106
  • 107. Creating & Using Namespace  Creating:  Using 28-11-2014 ANKIT VERMA 107
  • 108. THANKYOU P R E S E N T A T I O N B Y : A N K I T V E R M A ( I T D E P A R T M E N T ) DOUBTS A N K I T V E R M A A S S T . P R O F E S S O R