Vb.Net BCOM
200 Notes
These notes have been adapted with
the aid of the Microsoft msdn library, Introduction to .NET Framework by
Rajeswari Indupuri, homeandlearn.co.uk, vb.net for dummies … <<list will
be extended with full references later>>
Please note the this page will be constantly revised throughout the semester. So please check back regularly.
.NET
an Introduction
• Software platform
• Language neutral
• In other words .NET is not a language it is a Runtime and a
library for writing and executing written programs in any compliant language
• .Net is a new framework for
developing web-based and windows-based applications within the Microsoft
environment.
• The framework offers a fundamental
shift in Microsoft strategy: it moves application development from
client-centric to server-centric.
• Framework, Languages, And Tools
The
.NET Framework: .NET Framework Services
• Common Language Runtime
• Windows® Forms
• ASP.NET
• Web Forms
• Web Services
• ADO.NET, evolution of ADO
• Visual Studio.NET
Common
Language Runtime (CLR)
• CLR works like a virtual machine in
executing all languages.
• All .NET languages must obey the
rules and standards imposed by CLR. Examples:
• Object declaration, creation and use
• Data types, language libraries
• Error and exception handling
• Interactive Development Environment
(IDE)
• Development
• Mixed language applications
• Common Language Specification (CLS)
• Common Type System (CTS)
• Standard class framework
• Automatic memory management
• Consistent error handling and safer
execution
• Potentially multi-platform
• Deployment
• Removal of registration dependency
• Safety – fewer versioning problems
• Multiple Language Support
• CTS is a rich type system built into
the CLR it implements various types (int, double, etc) And operations on those
types
• CLS is a set of specifications that
language and library designers need to follow. This will ensure
interoperability between languages
• Compilation in .NET
Intermediate
Language (IL)
• .NET languages are not compiled to
machine code. They are compiled to an
Intermediate Language (IL).
• CLR accepts the IL code and
recompiles it to machine code. The
recompilation is just-in-time (JIT) meaning it is done as soon as a function or
subroutine is called.
• The JIT code stays in memory for
subsequent calls. In cases where there
is not enough memory it is discarded thus making JIT process interpretive.
Languages
• Languages provided by MS
• VB, C++, C#, J#, JScript
• Third-parties are building
• APL, COBOL, Pascal, Eiffel, Haskell,
ML, Oberon, Perl, Python, Scheme, Smalltalk…
Windows
Forms
•
Framework
for Building Rich Clients
• RAD (Rapid Application Development)
• Rich set of controls
• Data aware
• ActiveX® Support
• Licensing
• Accessibility
• Printing support
• Unicode support
• UI inheritance
ASP.NET
• The platform services that allow to
program Web Applications and Web Services in any .NET language
• ASP.NET Uses .NET languages to
generate HTML pages. HTML page is targeted to the capabilities of the
requesting Browser
• ASP.NET “Program” is compiled into a
.NET class and cached the first time it is called. All subsequent calls use the cached version.
ASP.NET
Web Forms
• Allows clean cut code
• Code-behind Web Forms
• Easier for tools to generate
• Code within is compiled then
executed
• Improved handling of state
information
• Support for ASP.NET server controls
• Data validation
• Data bound grids
Visual
Studio.NET
• Development tool that contains a
rich set of productivity and debugging features
• For this semester we will be using
Visual Studio Express Edition 2008 for the VB.Net Language
.
Net in Summary
•
Dramatically
simplifies development and deployment
•
Provides
robust and secure execution environment
•
Supports
multiple programming languages
Data
types
Visual
Basic type
|
Common
language runtime type structure
|
Nominal
storage allocation
|
Value
range
|
Depends on implementing platform
|
True or False
|
||
1 byte
|
0 through 255 (unsigned)
|
||
2 bytes
|
0 through 65535 (unsigned)
|
||
8 bytes
|
0:00:00 (midnight) on January 1, 0001 through 11:59:59 PM on December
31, 9999
|
||
Decimal
|
Decimal
|
16 bytes
|
0 through +/-79,228,162,514,264,337,593,543,950,335
(+/-7.9...E+28) † with no decimal point; 0 through
+/-7.9228162514264337593543950335 with 28 places to the right of the decimal;
.smallest nonzero number is +/-0.0000000000000000000000000001
(+/-1E-28) †
|
8 bytes
|
values include
-1.79769313486231570E+308 through -4.94065645841246544E-324 † for
negative values; 4.94065645841246544E-324 through
1.79769313486231570E+308 † for positive values
|
||
4 bytes
|
-2,147,483,648 through 2,147,483,647 (signed)
|
||
8 bytes
|
-9,223,372,036,854,775,808 through 9,223,372,036,854,775,807
(9.2...E+18 †) (signed)
|
||
4 bytes on 32-bit platform, 8 bytes on 64-bit platform
|
Any type can be stored in a variable of type Object
|
||
1 byte
|
-128 through 127 (signed)
|
||
2 bytes
|
-32,768 through 32,767 (signed)
|
||
4 bytes
|
values include -3.4028235E+38 through -1.401298E-45 † for
negative values; 1.401298E-45 through 3.4028235E+38 † for positive
values
|
||
Depends on implementing platform
|
0 to approximately 2 billion Unicode characters
|
||
4 bytes
|
0 through 4,294,967,295 (unsigned)
|
||
8 bytes
|
0 through 18,446,744,073,709,551,615 (1.8...E+19 †)
(unsigned)
|
||
Depends on implementing platform
|
Each member of the structure has a range determined by its data type
and independent of the ranges of the other members
|
||
2 bytes
|
0 through 65,535 (unsigned)
|
Arrays
-
Variables that
contain a single value are known as a scaler variable, we want to look at
variables that contain more than one value or object.
-
An array is a set of values that are logically
related to each other, such as the grades of students in the BCOM level 200
class.
-
Basic array
syntax: arrayname(n). The array will hold (n+1) objects, we count from 0 to n
-
Multidimensional
arrays multidimarray(a,b). The array will hold (a+1) rows with (b+1) columns of
objects. We can have up to 32 dimensions of an array. (as at Vb.net 2005). In usual
cases we can use up to 3 dimensional arrays, anything more than that is
difficult to keep track of in normal use.
-
You declare an
array as follows: dim numbersarray(9) as integer.
-
You access an
array element by invoking its name and position number after you have declared
it, e.g. numbersarray(3)
please sir when are you posting the notes for revision
ReplyDelete