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

PDF
BCA IPU VB.NET UNIT-IV
PDF
BCA IPU VB.NET UNIT-III
DOCX
C# Unit5 Notes
DOC
Complete list of all sap abap keywords
PPT
Attributes & .NET components
PPT
COM Introduction
DOCX
C# Unit 1 notes
BCA IPU VB.NET UNIT-IV
BCA IPU VB.NET UNIT-III
C# Unit5 Notes
Complete list of all sap abap keywords
Attributes & .NET components
COM Introduction
C# Unit 1 notes

What's hot (20)

PDF
Book management system
PDF
Intake 37 ef1
PPT
Visual basic 6.0
PPTX
Skillwise - Cobol Programming Basics
PPSX
Cobol training class-1
PPT
oracle-reports6i
PPTX
Vb6.0 intro
PPT
Cobol basics 19-6-2010
PDF
Function pointer - Wikipedia, the free encyclopedia
PPTX
Unmanged code InterOperability
PDF
Bca cobol
PPTX
.NET Attributes and Reflection - What a Developer Needs to Know...
PPTX
Cobol programming language
PDF
Phases of the Compiler - Systems Programming
PDF
Component Object Model (COM, DCOM, COM+)
PDF
PDF
Smartforms interview questions with answers
PDF
A Checklist for Migrating Big Iron Cobol Applications
PPT
Mis4200notes8 2
Book management system
Intake 37 ef1
Visual basic 6.0
Skillwise - Cobol Programming Basics
Cobol training class-1
oracle-reports6i
Vb6.0 intro
Cobol basics 19-6-2010
Function pointer - Wikipedia, the free encyclopedia
Unmanged code InterOperability
Bca cobol
.NET Attributes and Reflection - What a Developer Needs to Know...
Cobol programming language
Phases of the Compiler - Systems Programming
Component Object Model (COM, DCOM, COM+)
Smartforms interview questions with answers
A Checklist for Migrating Big Iron Cobol Applications
Mis4200notes8 2
Ad

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

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

Recently uploaded (20)

PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
CRP102_SAGALASSOS_Final_Projects_2025.pdf
PDF
Literature_Review_methods_ BRACU_MKT426 course material
PDF
Journal of Dental Science - UDMY (2020).pdf
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PDF
International_Financial_Reporting_Standa.pdf
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
Journal of Dental Science - UDMY (2021).pdf
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PPTX
Computer Architecture Input Output Memory.pptx
PPTX
Education and Perspectives of Education.pptx
PDF
English Textual Question & Ans (12th Class).pdf
PPTX
Climate Change and Its Global Impact.pptx
PDF
HVAC Specification 2024 according to central public works department
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
Climate and Adaptation MCQs class 7 from chatgpt
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
AI-driven educational solutions for real-life interventions in the Philippine...
CRP102_SAGALASSOS_Final_Projects_2025.pdf
Literature_Review_methods_ BRACU_MKT426 course material
Journal of Dental Science - UDMY (2020).pdf
Unit 4 Computer Architecture Multicore Processor.pptx
International_Financial_Reporting_Standa.pdf
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
Share_Module_2_Power_conflict_and_negotiation.pptx
Journal of Dental Science - UDMY (2021).pdf
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
B.Sc. DS Unit 2 Software Engineering.pptx
Computer Architecture Input Output Memory.pptx
Education and Perspectives of Education.pptx
English Textual Question & Ans (12th Class).pdf
Climate Change and Its Global Impact.pptx
HVAC Specification 2024 according to central public works department
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Climate and Adaptation MCQs class 7 from chatgpt
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx

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