THE .NET FRAMEWORK
The .NET Framework has two main parts:
1. The Common Language Runtime (CLR).
2. A hierarchical set of class libraries.
The CLR is described as the “execution engine” of .NET. It provides the environment within which programs run. The most important features are:
- Conversion from a low-level assembler-style language, called Intermediate Language (IL), into code native to the platform being executed on.
- Memory management, notably including garbage collection.
- Checking and enforcing security restrictions on the running code.
- Loading and executing programs, with version control and other such features.
The following features of the .NET framework are also worth description:
Managed Code – is code that targets .NET, and which contains certain extra information – “metadata” – to describe itself. Whilst both managed and unmanaged code can run in the runtime, only managed code contains the information that allows the CLR to guarantee, for instance, safe execution and interoperability.
Managed Data – With Managed Code comes Managed Data. CLR provides memory allocation and Deal location facilities, and garbage collection. Some .NET languages use Managed Data by default, such as C#, Visual Basic.NET and JScript.NET, whereas others, namely C++, do not. Targeting CLR can, depending on the language you’re using, impose certain constraints on the features available. As with managed and unmanaged code, one can have both managed and unmanaged data in .NET applications – data that doesn’t get garbage collected but instead is looked after by unmanaged code.
Common Type System – The CLR uses something called the Common Type System (CTS) to strictly enforce type-safety. This ensures that all classes are compatible with each other, by describing types in a common way. CTS define how types work within the runtime, which enables types in one language to interoperate with types in another language, including cross-language exception handling. As well as ensuring that types are only used in appropriate ways, the runtime also ensures that code doesn’t attempt to access memory that hasn’t been allocated to it.
Common Language Specification – The CLR provides built-in support for language interoperability. To ensure that you can develop managed code that can be fully used by developers using any programming language, a set of language features and rules for using them called the Common Language Specification (CLS) has been defined. Components that follow these rules and expose only CLS features are considered CLS-compliant.
THE CLASS LIBRARY
.NET provides a single-rooted hierarchy of classes, containing over 7000 types. The root of the namespace is called System; this contains basic types like Byte, Double, Boolean, and String, as well as Object. All objects derive from System. Object. As well as objects, there are value types. Value types can be allocated on the stack, which can provide useful flexibility. There are also efficient means of converting value types to object types if and when necessary.
The set of classes is pretty comprehensive, providing collections, file, screen, and network I/O, threading, and so on, as well as XML and database connectivity.
The class library is subdivided into a number of sets (or namespaces), each providing distinct areas of functionality, with dependencies between the namespaces kept to a minimum.
LANGUAGES SUPPORTED BY .NET
The multi-language capability of the .NET Framework and Visual Studio .NET enables developers to use their existing programming skills to build all types of applications and XML Web services. The .NET framework supports new versions of Microsoft’s old favorites Visual Basic and C++ (as VB.NET and Managed C++), but there are also a number of new additions to the family:
Visual Basic .NET has been updated to include many new and improved language features that make it a powerful object-oriented programming language. These features include inheritance, interfaces, and overloading, among others. Visual Basic also now supports structured exception handling, custom attributes and also supports multi-threading.
Visual Basic .NET is also CLS compliant, which means that any CLS-compliant language can use the classes, objects, and components you create in Visual Basic .NET.
Managed Extensions for C++ and attributed programming are just some of the enhancements made to the C++ language. Managed Extensions simplify the task of migrating existing C++ applications to the new .NET Framework.
C# is Microsoft’s new language. It’s a C-style language that is essentially “C++ for Rapid Application Development”. Unlike other languages, its specification is just the grammar of the language. It has no standard library of its own, and instead has been designed with the intention of using the .NET libraries as its own.
Microsoft Visual J# .NET provides the easiest transition for Java-language developers into the world of XML Web Services and dramatically improves the interoperability of Java-language programs with existing software written in a variety of other programming languages.
Active State has created Visual Perl and Visual Python, which enable .NET-aware applications to be built in either Perl or Python. Both products can be integrated into the Visual Studio .NET environment. Visual Perl includes support for Active State’s Perl Dev Kit.
Other languages for which .NET compilers are available include:
- FORTRAN
- COBOL
- Eiffel
Fig1 .Net Framework
| ASP.NET XML WEB SERVICES | Windows Forms |
| Base Class Libraries | |
| Common Language Runtime | |
| Operating System | |
INTRODUCTION TO ASP.NET
ASP.NET is the .NET framework layer that handles Web requests for specific types of files, namely those with (.aspx or .ascx) extensions. The ASP.NET engine provides a robust object model for creating dynamic content and is loosely integrated into the .NET framework.
WHAT IS ASP.NET?
ASP.NET is part of the .NET framework. ASP.NET programs are centralized applications hosted on one or more Web servers that respond dynamically to client requests. The responses are dynamic because ASP.NET intercepts requests for pages with a specific extension (.aspx or .ascx) and hands off the responsibility for answering those requests to just-in-time (JIT) compiled code files that can build a response “on-the-fly.”
ASP.NET deals specifically with configuration (web.config and machine.config) files, Web Services (ASMX) files, and Web Forms (ASPX) files. The server doesn’t “serve” any of these file types—it returns the appropriate content type to the client. The configuration file types contain initialization and settings for a specific application or portion of an application. Another configuration file, called machine.web, contains machine-level initialization and settings. The server ignores requests for web files, because serving them might constitute a security breach.
Client requests for these file types cause the server to load, parse, and execute code to return a dynamic response. For Web Forms, the response usually consists of HTML or WML. Web Forms maintain state by round-tripping user interface and other persistent values between the client and the server automatically for each request.
A request for a Web Form can use View State, Session State, or Application State to maintain values between requests. Both Web Forms and Web Services requests can take advantage of ASP. Net’s integrated security and data access through ADO.NET, and can run code that uses system services to construct the response. So the major difference between a static request and a dynamic request is that a typical Web request references a static file. The server reads the file and responds with the contents of the requested file.
ASP.NET uses .NET languages. ASP.NET code exists in multithreaded JIT compiled DLL assemblies, which can be loaded on demand. Once loaded, the ASP.NET DLLs can service multiple requests from a single in-memory copy.
ASP.NET supports all the .NET languages (currently C#, C++, VB.NET, and JScript, but there are well over 20 different languages in development for .NET), so you will eventually be able to write Web applications in your choice of almost any modern programming language.
In addition to huge increases in speed and power, ASP.NET provides substantial development improvements, like seamless server-to-client debugging, automatic validation of form data.
Fig2. Interoperability
ASP.NET EVENTS
.NET events and why they are cool
Every time an ASP.NET page is viewed, many tasks are being performed behind the scenes. Tasks are performed at key points (“events”) of the page’s execution lifecycle.
The most common events are:
OnInit
The first event in our list to be raised is OnInit. When this event is raised, all of the page’s server controls are initialized with their property values. Post Back values are not applied to the controls at this time.
On Load
The next event to be raised is On Load, which is the most important event of them all as all the pages server controls will have their Post Back values now.
Post Back Events
Next all the Post Back events are raised. These events are only raised when the page view is the result of a Post Back. The order that these events are raised can’t be defined or relied upon; the only consistency with the order that Post Back events are raised is that they are all raised between the Unload and OnPreRender events.
OnPreRender
This event is raised just prior to the page or server control’s html output being written into the response stream that’s sent to the client web browser. This is last chance you have to make any modifications. By this point, all the server controls on the page have the final data applied.
On Unload
This is the last event in our list to be raised and you should destroy any un-managed objects and close any currently open database connection at this point. It is not possible to modify any controls on the page at this point as the response stream has already been sent to the client web browser.
As each event of the page is raised it also automatically tells all its child controls to raise their own implementation of the same event. In turn each of those controls will tell its own child controls to do the same and so on down the control tree till all controls have done so. Then execution flow is passed back to the main page class to continue onto the next event and the process is repeated for that event.
MAIN FEATURES OF ASP.NET
Successor of Active Server Pages (ASP), but completely different architecture
• Object-oriented
• Event-based
• Rich library of Web Controls
• Separation of layout (HTML) and logic (e.g. C#)
• Compiled languages instead of interpreted languages
• GUI can be composed interactively with Visual Studio .NET
• Better state management
NAMESPACES
ASP.NET uses a concept called namespaces. Namespaces are hierarchical object models that support various properties and methods. For example, HTML server controls reside in “System.web.UI.HtmlControls” namespace, web server controls reside in “System.web.UI.WebControls” namespace and ADO+ resides in “System. Data” namespace.
LANGUAGE INDEPENDENT
An ASP.NET page can be created in any language supported by .NET framework. Currently .NET framework supports VB, C#, JScript and Managed C++.
ASP.NET SERVER CONTROLS
Using ASP.NET Server Controls, browser variation is handled because these controls output the HTML themselves based on the browser requesting the page.
TYPES OF CONTROLS
ASP.NET has two basic types of controls: HTML server controls and Web server controls.HTML Server Controls are generated around specific HTML elements and the ASP.NET engine changes the attributes of the elements based on server-side code that you provide. Web server controls revolve more around the functional you need on the page. The ASP.NET engine takes the extra steps to decide based upon the container of the requester, what HTML to output.
Fig 3. Web Controls
Worldwide Field Training
ADO.NET
ADO.NET provides a set of classes which a script can use to interact with databases. Scripts can create instances of ADO.NET data classes and access their properties and methods. A set of classes which work with a specific type of database is known as a .NET Data Provider. ADO.NET comes with two Data Providers, the SQL Server.NET Data Provider (which provides optimised access for Microsoft SQL Server databases) and the OLEDB.NET Data Provider, which works with a range of databases. The main ADO.NET OLEDB data access classes are OLEDBConnection, OLEDBCommand, OLEDBDataReader and OLEDBDataAdapter.
Features of SQL-SERVER
The OLAP Services feature available in SQL Server version 7.0 is now called SQL Server 2000 Analysis Services. The term OLAP Services has been replaced with the term Analysis Services. Analysis Services also includes a new data mining component. The Repository component available in SQL Server version 7.0 is now called Microsoft SQL Server 2000 Meta Data Services. References to the component now use the term Meta Data Services. The term repository is used only in reference to the repository engine within Meta Data Services
SQL-SERVER database consist of six type of objects,
They are,
1. TABLE
2. QUERY
3. FORM
4. REPORT
5. MACRO
TABLE:
A database is a collection of data about a specific topic.
VIEWS OF TABLE:
We can work with a table in two types,
1. Design View
2. Datasheet View
Design View
To build or modify the structure of a table we work in the table design view. We can specify what kind of data will be hold.
Datasheet View
To add, edit or analyses the data itself we work in tables datasheet view mode.
QUERY:
A query is a question that has to be asked the data. Access gathers data that answers the question from one or more table. The data that make up the answer is either dynaset (if you edit it) or a snapshot(it cannot be edited).Each time we run query, we get latest information in the dynaset.Access either displays the dynaset or snapshot for us to view or perform an action on it ,such as deleting or updating.
FORMS:
A form is used to view and edit information in the database record by record .A form displays only the information we want to see in the way we want to see it. Forms use the familiar controls such as textboxes and checkboxes. This makes viewing and entering data easy.
Views of Form:
We can work with forms in several primarily there are two views,
They are,
1. Design View
2. Form View
Design View
To build or modify the structure of a form, we work in forms design view. We can add control to the form that are bound to fields in a table or query, includes textboxes, option buttons, graphs and pictures.
Form View The form view which display the whole design of the form.
REPORT:
A report is used to vies and print information from the database. The report can ground records into many levels and compute totals and average by checking values from many records at once. Also the report is attractive and distinctive because we have control over the size and appearance of it.
MACRO:
A macro is a set of actions. Each action in macros does something. Such as opening a form or printing a report .We write macros to automate the common tasks the work easy and save the time.
MODULE:
Modules are units of code written in access basic language. We can write and use module to automate and customize the database in very sophisticated ways.
