ASP' NET - PowerPoint PPT Presentation

1 / 33
About This Presentation
Title:

ASP' NET

Description:

User-defined Windows control projects, which are similar to ActiveX Control ... The & (ampersand) and (plus) characters signify string concatenation. ... – PowerPoint PPT presentation

Number of Views:78
Avg rating:3.0/5.0
Slides: 34
Provided by: Rah487
Category:
Tags: asp | net | ampersand

less

Transcript and Presenter's Notes

Title: ASP' NET


1
ASP. NET
Lecture-2
2
Agenda
  • Introduction to VS.NET
  • VB.NET Lang. Basics
  • Variables
  • Data types
  • Identifiers, keywords, literals
  • Dimensioning Variables
  • Operator
  • Expression
  • Statements

3
Quick Recap
  • Web basics
  • Internet
  • Intranet Extranet
  • World Wide Web
  • Hypertext
  • Resource Identifier
  • Client Server
  • Markup Language
  • HTML
  • Client Server Arch.
  • Web Browser Web Server

4
Start Page
  • The Start Page is a tabbed HTML page with three
    main navigation options
  • Projects
  • Online Resources
  • Online Community
  • MSDN Headlines
  • Search Online
  • Downloads
  • XML Web services
  • My Profile
  • This page enables you to set up the general
    settings for your IDE

5
Types of Projects
6
Creating Visual Basic. NET Projects
  • Windows Application
  • Standard Windows -based applications.
  • Class Library
  • Class libraries that provide similar
    functionality to Microsoft ActiveX dynamic-link
    libraries (DLLs) by creating classes accessible
    to other applications.
  • Windows Control Library
  • User-defined Windows control projects, which are
    similar to ActiveX Control projects in previous
    versions of Visual Basic.
  • ASP .NET Web Application
  • Web applications that will run from an Internet
    Information Services (IIS) server and can include
    Web pages and XML Web services.

7
Creating Visual Basic. NET Projects
  • Web Service
  • Web applications that provide XML Web Services to
    client applications.
  • Web Control Library
  • User-defined Web controls that can be reused on
    Web pages in the same way that Windows controls
    can be reused in Windows applications.
  • Console Application
  • Console applications that will run from a command
    line.
  • Windows Service
  • Windows services that will run continuously
    regardless of whether a user is logged on or not.
    Previous versions of Visual Basic require you to
    use third-party products or low-level application
    programming interface (API) calls to create these
    types of applications.

8
Analyzing Project Structures
  • Solution files (.sln, .suo)
  • The .sln extension is used for solution files
    that link one or more projects together, and are
    also used for storing certain global information.
  • Project files (.vbproj)
  • The project file is an Extensible Markup Language
    (XML) document that contains references to all
    project items, such as forms and classes, as w
    ell as project references and compilation
    options.
  • Local project items (.vb)
  • It may contains classes, forms, modules, and user
    controls

9
Solution Explorer
  • Displays Project Hierarchy
  • Project references
  • Forms, classes, modules
  • Folders with subitems
  • Show All Files Mode
  • Manipulating Projects
  • Drag-and-drop editing
  • Context menus

10
Server Explorer
  • Managing Data Connections
  • Viewing and Managing Servers
  • Using Drag-n-Drop Techniques

11
Toolbox
12
Property Window
13
Managing Code Windows and Designers
  • Vertical Tab Group

14
Managing Code Windows and Designers
  • Horizontal Tab Group

15
Variable
  • A variable can be defined as an entity that has
    the following six properties
  • Name
  • Address
  • Type
  • Value
  • Scope
  • Lifetime

16
Data Types
17
VB.NET Lang Fundamentals
  • Identifiers
  • Identifiers are names given to types
    (enumerations, structures, classes, standard
    modules, interfaces, and delegates), type members
    (methods, constructors, events, constants,
    fields, and properties), and variables.
  • Identifiers must begin with either an alphabetic
    or underscore character ( _ ), may be of any
    length, and after the first character must
    consist of only alphanumeric and underscore
    characters.
  • Keywords
  • Keywords are words with special meaning in a
    programming language. In Visual Basic .NET,
    keywords are reserved that is, they cannot be
    used as tokens for such purposes as naming
    variables and subroutines. E.g. (Binary, Boolean,
    ByRef, Byte, ByVal, Auto, integer, Float, else,
    exit )

18
VB.NET Lang Fundamentals
  • Literals
  • A literal is a textual "decorator" that
    represents a particular value type and it forces
    the compiler to treat the object as that
    particular type.
  • Literals are representations of values within the
    text of a program.
  • For example, in the following line of code, 10
    is a literal, but x and y are not
  • x y 10
  • Numeric Literals ( Integer I, Single F,
    Double R, and Decimal D, Long L )
  • String Literals
  • Character Literals followed by char c
  • Dim MyChar As Char
  • MyChar "A"c
  • Date Literals
  • Boolean Literals

19
Dimensioning Variables
  • Two ways
  • Dim x as Integer
  • Dim x as Integer 7 initialized also here
  • Points to note
  • You can do it only once per procedure
  • Variables have a scope
  • Access to variables can be defined Public,
    Private, etc

20
Operators
  • Operators are symbols (characters or keywords)
    that specify operations to be performed on one or
    two operands (or arguments). Operators that take
    one operand are called unary operators. Operators
    that take two operands are called binary
    operators.
  • Type of Operators
  • Unary Operators
  • Arithmetic Operators
  • Relational Operators
  • String-Concatenation Operators
  • Logical Operators

21
Unary Operator
  • - (unary minus)
  • The unary minus operator takes any numeric
    operand. The value of the operation is the
    negative of the value of the operand. In other
    words, the result is calculated by subtracting
    the operand from zero.
  • Not (logical negation)
  • The logical negation operator takes a Boolean
    operand. The result is the logical negation of
    the operand.

22
Arithmetic Operators
  • The arithmetic operators perform the standard
    arithmetic operations on numeric values.
  • (multiplication)
  • / (regular division)
  • The regular division operator is defined for all
    numeric operands. The result is the value of the
    first operand divided by the second operand.
  • \ (integer division)
  • The integer division operator is defined for
    integer operands (Byte, Short, Integer, and
    Long). The result is the value of the first
    operand divided by the second operand, then
    rounded to the integer nearest to zero.
  • Mod (modulo)
  • The modulo operator is defined for integer
    operands (Byte, Short, Integer, and Long). The
    result is the remainder after the integer
    division of the operands.

23
Arithmetic Operators
  • (exponentiation)
  • The result is the value of the first operand
    raised to the power of the second operand.
  • (addition)
  • The addition operator is defined for all
    numeric operands and operands of an enumerated
    type. The result is the sum of the operands.
  • - (subtraction)
  • The result is the value of the first operand
    minus the second operand.

24
Relational Operators
  • The relational operators all perform some
    comparison between two operands and return a
    Boolean value indicating whether the operands
    satisfy the comparison.
  • (equality)
  • ltgt (inequality)
  • lt (less than)
  • gt (greater than)
  • lt (less than or equal to)
  • gt (greater than or equal to)
  • Like
  • TypeOf...Is
  • Is

25
String Concatenation Operator
  • The (ampersand) and (plus) characters signify
    string concatenation. String concatenation is
    defined for operands of type String only. The
    result is a string that consists of the
    characters from the first operand followed by the
    characters from the second operand.
  • e.g.
  • Dim a as string This is first string
  • Dim b as string This is second string
  • Dim c as string a b
  • Dim d as string a b

26
Logical Operators
  • Logical operators are operators that require
    Boolean operands. They are
  • And
  • The result is True if and only if both of the
    operands are True otherwise, the result is
    False.
  • Or
  • The result is True if either or both of the
    operands is True otherwise, the result is False.
  • Xor
  • The result is True if one and only one of the
    operands is True otherwise, the result is False.
  • Not
  • This is a unary operator. The result is True if
    the operand is False False if the operand is
    True.

27
Expression
  • e.g.
  • 5 6
  • x y
  • BITS Pilani
  • x gt y equates to boolean T or F
  • day OR night
  • objA is Nothing

28
Statements
  • Are made up of
  • Keywords (like Dim)
  • Operators
  • Variables
  • Constants
  • Expressions
  • Each statement is a command
  • Each statement can be on a new line or combined
    together with
  • Statements can span multiple lines using _At
    the end
  • Your program a lot of statements that do
    interesting things

29
Statements
  • Types of statements
  • Declaration
  • Dim x 10
  • Assignment
  • variable, field, or property expression
  • x y 3 6
  • Lblcolor.forcolorsystem.drawing.color.red
  • Executable
  • If Then Else
  • Function calls

30
Data Type Conversion
31
Data Type Conversion
  • CBool Convert to Bool data type.
  • CByte Convert to Byte data type.
  • CChar Convert to Char data type.
  • CDate Convert to Date data type.
  • CDbl Convert to Double data type.
  • CDec Convert to Decimal data type.
  • CInt Convert to Int data type.
  • CLng Convert to Long data type.
  • CObj Convert to Object type.
  • CShort Convert to Short data type.
  • CSng Convert to Single data type.
  • CStr Convert to String type.

32
Data Type Conversion
  • Ctype(expression, typename )
  • e.g.
  • 1. Dim a as integer
  • Dim var_sng As Single 2.234
  • a CInt(var_sng)
  • a CType(var_sng, Integer)
  • 2. Dim b As Short
  • b CShort(a)
  • 3. Dim str As String
  • str CStr(b)

33
Questions???
Write a Comment
User Comments (0)
About PowerShow.com