UNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net

Similar documents
Darshan Institute of Engineering & Technology for Diploma Studies

Fig 1.1.NET Framework Architecture Block Diagram

.Net Technologies. Components of.net Framework

B.V Patel Institute of BMC & IT, UTU

Appendix G: Writing Managed C++ Code for the.net Framework

Introduction to.net Framework and Visual Studio 2013 IDE MIT 31043, Visual Programming By: S. Sabraz Nawaz

Introduction to.net Framework and Visual Studio 2013 IDE MIT 31043, Rapid Application Development By: S. Sabraz Nawaz

Department of Computer Applications

Dot Net Online Training

Developing Microsoft.NET Applications for Windows (Visual Basic.NET)

PES INSTITUTE OF TECHNOLOGY

C#.Net. Course Contents. Course contents VT BizTalk. No exam, but laborations

CIS 3260 Intro. to Programming with C#

Microsoft Visual Basic 2005: Reloaded

Question And Answer.

New programming language introduced by Microsoft contained in its.net technology Uses many of the best features of C++, Java, Visual Basic, and other

A NET Refresher

GO - OPERATORS. This tutorial will explain the arithmetic, relational, logical, bitwise, assignment and other operators one by one.

Visual Basic.NET. 1. Which language is not a true object-oriented programming language?

2. A GUI A. uses buttons, menus, and icons B. should be easy for a user to manipulate C. both (a) and (b) D. stands for Graphic Use Interaction

Introduce C# as Object Oriented programming language. Explain, tokens,

PESIT- Bangalore South Campus Hosur Road (1km Before Electronic city) Bangalore

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

EEE-425 Programming Languages (2013) 1

Chapter 1:- Introduction to.net. Compiled By:- Ankit Shah Assistant Professor, SVBIT.

Language Reference Manual simplicity

C# Syllabus. MS.NET Framework Introduction

Unit 1: Visual Basic.NET and the.net Framework

Developing Microsoft.NET Applications for Windows (Visual Basic.NET)

Introduction to Programming Using Java (98-388)

Module 2: Introduction to a Managed Execution Environment

1. Introduction to the Common Language Infrastructure

Programming with Microsoft Visual Basic.NET. Array. What have we learnt in last lesson? What is Array?

Computer Programming C++ (wg) CCOs

CS313D: ADVANCED PROGRAMMING LANGUAGE

10/9/2012. Sample C# program:

M. K. Institute Of Computer Studies, Bharuch SYBCA SEM IV VB.NET (Question Bank)

The SPL Programming Language Reference Manual

Java Language Basics: Introduction To Java, Basic Features, Java Virtual Machine Concepts, Primitive Data Type And Variables, Java Operators,

Uka Tarsadia University MCA ( 3rd Semester)/M.Sc.(CA) (1st Semester) Course : / Visual Programming Question Bank

Lesson 06 Arrays. MIT 11053, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL

Unit 4. Lesson 4.1. Managing Data. Data types. Introduction. Data type. Visual Basic 2008 Data types

Top 40.NET Interview Questions & Answers

CP FAQS Q-1) Define flowchart and explain Various symbols of flowchart Q-2) Explain basic structure of c language Documentation section :

Introduction to.net Framework

CPSC 3740 Programming Languages University of Lethbridge. Data Types

Outsource. Laboratories. Introduction to Programming with Microsoft Visual Basic.NET. Outsource Laboratories Press

The PCAT Programming Language Reference Manual

Unit 3. Operators. School of Science and Technology INTRODUCTION

Petros: A Multi-purpose Text File Manipulation Language

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Getting started 7. Storing values 21. Creating variables 22 Reading input 24 Employing arrays 26 Casting data types 28 Fixing constants 30 Summary 32

Introduction to Visual Basic and Visual C++ Arithmetic Expression. Arithmetic Expression. Using Arithmetic Expression. Lesson 4.

Course Hours

Chapter 12 Microsoft Assemblies. Software Architecture Microsoft Assemblies 1

Introduction To C#.NET

M. K. Institute Of Computer Studies, Bharuch SYBCA SEM IV VB.NET (Question Bank)

Program Contents: DOTNET TRAINING IN CHENNAI

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements

.Net. Course Content ASP.NET

DC69 C# &.NET DEC 2015

Modern Programming Tools and Techniques-III DCAP301

C#: framework overview and in-the-small features

Microsoft Visual Basic 2005: Reloaded

Quick Reference Guide

S.Sakthi Vinayagam Sr. AP/CSE, C.Arun AP/IT

There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals:

BASIC ELEMENTS OF A COMPUTER PROGRAM

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

GridLang: Grid Based Game Development Language Language Reference Manual. Programming Language and Translators - Spring 2017 Prof.

UNIT V - ADO.NET Database Programming with ADO.NET- Data Presentation Using the DataGridView Control- DataGridView- Updating the Original Database.

CS201 - Introduction to Programming Glossary By

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017

DOT NET Syllabus (6 Months)

Introduction to Computer Science Midterm 3 Fall, Points

Outline. Data and Operations. Data Types. Integral Types

Introducing C# After this discussion, we'll move on to a simple description of C# itself, including its origins and similarities to C++.

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007

This web service can be available to any user on the internet regardless of who developed it.


Microsoft..NET Framework. Overview

Module 4: Data Types and Variables

Programming in Visual Basic with Microsoft Visual Studio 2010

Programming for the Web with PHP

AC I Sem 5_TYCS. ASP.NET application codes can be written in any of the following languages:

I want to buy the book NOW!

Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups:

Programming Fundamentals - A Modular Structured Approach using C++ By: Kenneth Leroy Busbee

Table Of Contents VISUAL BAISC 2005 FOR BEGINNERS

MATLIP: MATLAB-Like Language for Image Processing

VB.NET. Exercise 1: Creating Your First Application in Visual Basic.NET

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

C# Programming: From Problem Analysis to Program Design. Fourth Edition

C# Programming in the.net Framework

COPYRIGHTED MATERIAL. Contents. Part I: C# Fundamentals 1. Chapter 1: The.NET Framework 3. Chapter 2: Getting Started with Visual Studio

The Arithmetic Operators. Unary Operators. Relational Operators. Examples of use of ++ and

The Arithmetic Operators

Transcription:

UNIT 1 Introduction to Microsoft.NET framework and Basics of VB.Net 1

SYLLABUS 1.1 Overview of Microsoft.NET Framework 1.2 The.NET Framework components 1.3 The Common Language Runtime (CLR) Environment 1.4 The.NET Framework class Library 1.5 Getting Started with Visual Basic.net IDE : 1.6 Visual basic language concept :variables, Constants, Data Types, Operators, Control Structures and loops, Arrays : single and multidimensional array, declaring, dynamic array 2

1.1 OVERVIEW OF VISUAL STUDIO.NET Visual Studio.NET is a complete Package of development tools for developing web application, desktop application, mobile application etc. Programming Languages: Microsoft's Visual Studio (also called Visual Studio.NET) includes several different programming languages: Visual Basic Visual C# (C sharp), Visual C++ (cee-plus-plus), Visual F# (F sharp), JScript 3

Features of.net Rich set of classes: It contains hundreds of classes and namespaces. Object Oriented Programming System: It supports OOPS concepts. Automatic Memory Management: Garbage collector free up unused objects for regular interval. Multi language and Multidevice Support: It support multiple languages and multiple devices. Faster and easy development of Web Application: It is useful for developing dynamic and database related web application. XML Support: It supports for writing, manipulating and transforming XML document. 4

1.2 THE.NET FRAMEWORK COMPONENTS 5

Net Framework is a platform that provides tools and technologies to develop Windows, Web and Enterprise applications. It mainly contains two components: 1) Common Language Runtime (CLR) 2) Net Framework Class Library. (FCL) 6

(TOPIC 1.3) 1) Common Language Runtime (CLR) It provides an environment to run all the.net Programs. The code which runs under the CLR is called as Managed Code. Programmers need not to worry on managing the memory if the programs are running under the CLR as it provides memory management and thread management. when our program needs memory, CLR allocates the memory for scope and de-allocates the memory if the scope is completed. 7

8

(TOPIC 1.4) 2) Net Framework Class Library (FCL) This is also called as Base Class Library. It is common for all types of applications i.e. the way to access the Library Classes and Methods in VB.NET will be the same in C#, and it is common for all other languages in.net. The class library consists of data classes, XML classes, Windows form classes, web form classes, input output classes. Example: system.io, system.data 9

MSIL (Microsoft Intermediate Language) It is also known as Common Intermediate Language. It is the CPU independent instruction set in which.net framework programs are compiled. It contains instruction set for Loading, Storing and Initializing. JIT (Just In Time Compiler) It does not compile whole program each time. It contains only that portion of the program which functions are called that time. If native code is already present then data will not compile again. 10

Garbage Collection It is a mechanism that allows the computer to detect when an object cannot be accessed. Then automatically free up the memory used by that object. The CLR s garbage collector manages the allocation and release of memory for application. CLS (Common Language Specification) It includes basic language features needed by almost all the application. It provides guideline for library writer and compiler writer. It is a subset of CTS. 11

Common Type System It support two types: Value Types and Reference Types Value Type store directly data on stack and holds data within its own memory location. Example: Short, Integer, Long Reference Type store a reference to the value s memory address. It allocate on the heap. Assembly It is logical unit which contains Metadata, MSIL Code, Manifest and Resources. 12

Namespace.NET framework class library is collection of namespaces. It is used with import keyword. 13

1.5 IDE: INTEGRATED DEVELOPMENT ENVIRONMENT Visual Studio.NET provides an environment that is common to all languages, which is known as IDE. IDE contains Menubar, Context Menu, Toolbar, Toolbox, Solution Explorer, Property Window, Form Design View, Code Editor Window. 14

15

Solution Explorer Window: displays filenames for files that comprise a project. Properties Window: displays properties of the currently selected object in the figure the properties displayed are those of the Form object. Context Menu: When an item is right clicked, Context Menus are open. Tollbar: It provides quick access to commonly used commands like Save, Cut, Copy, Undo etc. 16

Toolbox: It provides a set of controls to place on a form like Label, Combobox, Textbox, Button etc. Form Design View: Drag and drop control in this view. Code Editor Window: Write the coding of the file. Database Explorer:Allow you to connect with database Files or establish connection with Data base Server. It creates and edits database tables, store procedures and functions. 17

1.6 VARIABLES A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in VB.Net has a specific type, which determines the size and layout of the variable's memory, the range of values that can be stored within that memory. The Dim statement is used for variable declaration and storage allocation for one or more variables. Example: Dim pi As Double Variable Initialization in VB.NET : pi=3.14 or Dim pi As Double = 3.14 18

DATA TYPES Data types refer to an extensive system used for declaring variables or functions of different types. The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted. 19

CONSTANT The constants refer to fixed values that the program may not alter during its execution. These fixed values are also called literals. Constants can be of any of the basic data types like an integer constant, a floating constant, a character constant, or a string literal. In VB.Net, constants are declared using the Const statement. The Const statement is used at module, class, structure, procedure, or block level for use in place of literal values. Example: Const PI = 3.14149 20

OBJECT DATA TYPE We can store any thing in object data type. It require more memory than other data types. Example: Dim temp as object temp=5 temp= RAM temp=#11/11/2015# 21

OPERATOR An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. Types of Operator 1) Arithmetic Operator 2) Concatenation Operator 3) Assignment Operator 4) Comparison Operator 5) Relational Operator 6) Logical/Bitwise Operator 22

1) Arithmetic Operators: Following table shows all the arithmetic operators supported by VB.Net. Assume variable A holds 2 and variable B holds 7, then 23

2) Concatenation Operator The following are the concatenation operators defined in Visual Basic. + Operator : The + Operator has the primary purpose of adding two numbers. It can also concatenate numeric operands with string operands. & Operator : The & Operator is defined only for String operands. The & operator is recommended for string concatenation 24

3) Assignment Operator: There are following assignment operators supported by VB.Net: 25

4) Comparison Operators: Following table shows all the comparison operators supported by VB.Net. Assume variable A holds 10 and variable B holds 20, then 26

5) Logical Operators: Following table shows all the logical operators supported by VB.Net. Assume variable A holds Boolean value True and variable B holds Boolean value False, then 27

6) Bitwise Operator: The bit shift operators perform the shift operations on binary values. Bitwise operators work on bits and perform bit by bit operations. The truth tables for &,, and ^ are as follows: 28

DECISION MAKING STATEMENT Following are the List of control structure: 1. If.Then.EndIf 2. If.Then.Else.EndIf 3. If.Then.ElseIf.EndIf 4. IIF statement 5. Nested If.Then.EndIf 6. Select Case.End select 29

If.Then.EndIf Entry test expression? False True Statement-block Statement-x Next statement 30

Syntax: If condition Then Statements End If Example: If no Mod 2 = 0 Then Console.WriteLine ( No is Even ) End If 31

If.Then.Else.EndIf Entry False false-block statement test expression? True true-block statement Statement-x 32

Syntax: If condition Then Statements Else Statements End If Example: If no Mod 2 = 0 Then Console.WriteLine ( No is Even ) Else Console.WriteLine ( No is Odd ) End If 33

If.Then.ElseIf.EndIf Used when we need multipath decisions. Syntax If Condition Then Statements Else If Condition Then Statements Else Statements End If 34

Example: If No > 0 Then Console.WriteLine ( No is Positive ) Else If No < 0 Then Console.WriteLine ( No is Negative ) Else Console.WriteLine ( No is Zero ) End If 35

IIF statement IIF statement is sort form of if then else statement. Syntax: IIF (expression, True Part, False Part) Example: Dim a, b, Max as integer a=5 b=6 Max=IIF (a>b, a, b) 36

Nested If.Then.EndIf Syntax: If < condition 1 > Then statements Else If < condition 2 > Then statements Else If < condition 3 > Then statements Else Statements End If End If EndIf 37

Select Case.End select Syntax: Select Case Expression Case value1 Statement Case value2 Statement Case Else Statement End Select 38

Example Dim x As Integer x = 500 Select Case x Case 100 MsgBox ( Century ) Case 200 MsgBox ( Double Century ) Case 300 MsgBox ( Triple Century ) Case Else MsgBox ( An Invalid Number Entered ) End Select 39

LOOPS A loop statement allows us to execute a statement or group of statements multiple times. 1) Do Loop It repeats the enclosed block of statements while a Boolean condition is true or until the condition becomes True. It could be terminated at any time with the Exit Do statement 40

41

The syntax for this loop is as below: 42

2) For...Next Loop It repeats a group of statements a specified number of times and a loop index counts the number of loop iterations as the loop executes. 43

The syntax for this loop is as below: 44

3) For Each... Next Loop It repeats a group of statements for each element in a collection. This loop is used for accessing and manipulating all elements in an array or a VB.Net collection. 45

4) While...End While Loop It executes a series of statements as long as a given condition is true. When the condition is tested and the result is false, the loop body will be skipped and the first statement after the while loop will be executed 46

The syntax for this loop is as below: 47

5) Nested...Loop The syntax for a nested For loop statement in VB.Net is as follows 48

ARRAY An array stores a fixed size sequential collection of elements of the same type. All arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element. 49

Creating Arrays in VB.NET: To declare an array in VB.Net, you use the Dim statement. For example, You can also initialize the array elements while declaring the array. For example 50

Multidimensional Array: Multidimensional arrays are also called rectangular arrays. You can declare a 2 dimensional array of strings as: Dim twodisplay(10,20) As String or, a 3 dimensional array of Integer variables: Dim threedispalay(10,20,30) As Integer 51

Dynamic Array: Dynamic arrays are arrays that can be dimensioned and re-dimensioned as par the need of the program. You can declare a dynamic array using the ReDim statement. Syntax for ReDim statement: ReDim [Preserve] arrayname (subscripts) Where, The Preserve keyword helps to preserve the data in an existing array, when you resize it. Arrayname is the name of the array to re - dimension. Subscripts specifies the new dimension 52

QUESTION BANK Explain component of.net framework. What is Managed code and Unmanaged code? Explain the managed code execution process. Write a short note on CLR. What is IDE? Discuss the following components: Solution Explorer, Property Window, Toolbox, Database Explorer. Explain variable and constant variable with example. Explain any five data types with an example. Explain different types of operators with example. 53

CONT... Explain following control statements with suitable example. If Then.Else If Else If Else Select Case Explain following loops with suitable example. For, For Each, While and Do- While What is an array? Explain one dimensional array with an example. Explain Multidimensional array with suitable example. Explain Dynamic array with example. 54

55