You are on page 1of 46

A

Major Report On Website of


(www.silverraintrade.com)

SUBMITTED BY:-

Under the Supervision of:-


Project Coordinator: - Mr. Vinod Kumar Verma (AP)
Project Guide: - Ms. Usvir kaur

1
ACKNOWLEDGEMENT
“In the beginning it was an idea

Later it became a reason for exuberance

Next it was the centre of hard work

Now it’s a success”

No matter how much enterprising and entrepreneurial one’s thinking is, yet nobody can do
everything all by himself without some help and guidance. It is inhumane if the concerned
person’s assistance goes without appreciation and thanks.

Many individuals have contributed for the completion of this project. For their invaluable
guidance, comments and suggestions, we wish to express our deep sense of indebtedness and
sincerest gratitude to our guide, Mr. Vinod Kumar Verma, AP and co-guide Ms. Usvir Kaur,
Department of Computer Engineering, Sant Longowal Institute of Engineering and Technology
for his invaluable guidance and constructive criticism throughout this dissertation. He has
displayed unique tolerance and understanding at every step of progress and encouraged us
incessantly. We deem it our privilege to have carried out our Dissertation work under his able
guidance.

We express our sincere thanks to Mr. Birmohan Singh, professor & Head, Department of
Computer Engineering for accepting our application and giving us an opportunity to work on
project.

As a final personal note, we are grateful to, our parents, who are inspirational to us in their
understanding, patience and constant encouragement.

Name and reg no

2
INDEX

Contents Page No.


1. Introduction 1

2. Feasibility Study
2.1 Introduction 4
2.2 Types of Feasibility 4
2.3 Software development life cycle 6

3. Environment and tools used for system


3.1 .NET framework 8
3.1.1 Design Features 10
3.1.2 Architectural layout 12
3.2 Overview of Asp.NET 16
3.2.1 Important Namespaces 18
3.2.2 Page and Control Framework 21
3.2.3 Compilation Overview 22
3.2.4 Security 24
3.3 C# language and .NET Framework
3.3.1 History 25
3.3.2 About C# 26
3.3.3 Statements 29
3.3.4 Datatypes 29
3.3.5 Variables 30
3.3.6 Constants 31
3.3.7 Strings 32
3.3.8 Enumerations 32
3.4 VB.Net
3.4.1 Introduction 33
3.4.2 Versions 33
3.4.3 Programming Language 35
3.4.4 Data types 38
3.4.5 Operators 39
3.4.6 Instantiating the Class 40
3.5 Comparison of C# and VB.Net 41

3
4. Introduction to SQL Server
4.1 Introduction 47
4.2 Database Design 48
4.3 Database Tables 55
5. E-R Diagrams
5.1 Introduction 58
5.2 ER Diagram of Login Page 59
5.3 ER Diagram of Account and Profile 59
5.4 ER Diagram of Balance Account 60

6. Snapshots
6.1 Admin Level
6.1.1 Admin Home 61
6.1.2 Activate Account 61
6.1.3 Place a Member 62
6.1.4 Select Type of Member 62
6.1.5 Tree View Structure 63
6.1.6 Distribute Profit 63
6.2 Registration 64
6.3 Login Page 65
6.4 User Level
6.4.1 User Profile 66
6.4.2 Update Profile 67
6.4.3 User Earnings 67
6.4.4 User Members 68
7. Summary 69
8. Bibliography 70
9. References 71

4
2. FEASIBILITY STUDY

(2.1) INTRODUCTION:-
Feasibility is the measure of how beneficial or practical the development of the system will be to
the organization. It is a preliminary survey for the systems investigation. It aims to
proinformation to facilitate a later in-depth investigation

The report produced at the end of the feasibility study contains suggestions and reasoned
arguments to help management decide whether to commit further resources to the proposed
project.

Within the scheduled duration we were assigned to study both the positive and negative aspects
of the current manual system, in which we have come up with a number of drawbacks that
prevent the progress of the clinic if it is continued to function manually.
Having gone through all measures of feasibility we report to the management to figure out if the
objectives of the new system are met.
For e.g.: –

 Is the system within the budget allowed for it?


 Will the organizations needs, be met by the new proposed system as originally
envisaged?

(2.2) TYPES OF FEASIBILITY:


There are various measures of feasibility that helps to decide whether a particular project is
feasible or not. These measures include:

 Technical Feasibility
 Operational Feasibility
 Economical Feasibility

Each of these types will be explained in detail throughout the project report.

(2.2.1) Technical Feasibility


Based on the outline design of system requirements in terms of inputs, outputs, files, procedures
and staff, the technical issues raised during technical feasibility include

 Does the necessary technology exist to do what is proposed?


 Does the proposed equipment have the technical capacity to hold the data required to use
in the new system?
 Adequate responses provided by the proposed system?
5
 Is the system flexible enough to facilitate expansion?
 Is there any technical guarantee of accuracy, reliability, ease of access and data security?

(2.2.2) OPERATIONAL FEASIBILITY:-


A system often fails if it does not fit within existing operations and if users resist the change.
Important issues a systems developer must look into are:
Will the new system be used if implemented in an organization?
Are there major barriers to implementation or is proposed system accepted without destructive
resistance?

If we are considering the performance and response time for each task, it is very much faster
since there is less paper work to be completed. When entering data into the system to relieve the
user from additional work and typing incorrect data, the system provides options such as combo
boxes, check boxes, option buttons and etc. if the users type in incorrect data they would be
informed immediately about the error by the error detection control.

Another important fact to be regarded is the security control, which is handled by the system.
Since data regarding each user is confidential, security is a key issue. Here, in this system, data
regarding users is stored in database which can only be accessed by the authorized administrator.

The new system is more user-friendly, which enables the end-user to complete his/her work
efficiently and accurately with interest. After taking the above fact into consideration we can
state the operating of the proposed system within the organization is feasible.

(2.2.3) ECONOMICAL FEASIBILITY:-


The proposed system must be justifiable in terms of cost and benefit, to ensure that the
investment in a new/changed system provide a reasonable return.

Even though finding out the costs of the proposed project is difficult we assume and estimate the
costs and benefits as follows.

According to the computerized system we propose, the costs can be broken down to two
categories:

 Costs associated with the development of the system.


 Costs associated with operating the system.

(2.3) S/W DEVELOPMENT LIFE CYCLE:


Every software development consists several phases, have certain predefined works and at the
end of each phase document is prepared. This phase is based on certain Software Development
Model.

6
Software Development Model:
Software engineering is a discipline that integrates process, methods, and tools for the
development of computer software. To solve actual problems in an industry setting, software
engineer or a team of software engineers must incorporate a development strategy that
encompasses, methods, and tools. This strategy is often referred to as a process model or a
software-engineering paradigm.

A number of different process models for the software engineering have been proposed, each
exhibiting strengths and weaknesses, but all having a series of generic phases in common. Some
of the commonly used software process models are:

 The linear sequential model


 The prototyping model
 The RAD model
 The incremental model
 The spiral model

A particular process model for software engineering is chosen on the nature of the project and
the application at hand, the methods and the tools to be used, and the controls are required.

All software development can be characterized as a problem-solving loop in which four distinct
stages are encountered:

 Status Quo
 Problem Definition
 Technical Development
 Solution Integration

Software Requirement Analysis:


The requirements gathering process is intensified and focused specifically on software. To
understand the nature of the program(s) to be built, the software engineer (“analyst”) must
understand the information domain for the software, as well as required function, behavior,
performance, and interfacing. Requirements for the both the system and the software are
documented and reviewed with the customer.

Design:
Software design is actually a multi-step process that focuses on four distinct attributes of a
program: data structures, software architecture, interface representations, and procedural
(algorithm) detail. The design process translates requirement into a representation of the software
that can be assessed for quality before code generation begins.

7
Code Generation:
The design must be translated in to a machine-readable form. The testing process focuses on the
logical internals of the software, assuring that all statements have been tested and on the
functional externals that is, conducting tests to uncover errors and ensure that defined inputs will
produce actual results that agree with required results.

Testing:
Once code has been generated, program testing begins. The testing process focuses on the logical
internals of the software, assuring that all statements have been tested and on the functional
externals that is, conducting tests to uncover errors and ensure that defined inputs will produce
actual results that agree with required results.

Maintenance
Software will undoubtedly undergo change after it is delivered to the customer (A possible
exception is embedded software).Change will occur because errors have been encountered,
because the software must be adapted to accommodate change in its external environment (e.g. A
change required because of a new operating system or peripheral device), or because the
customer requires functional or performance enhancements.

8
3. ENVIRONMENT AND TOOLS USED FOR THE SYSTEM

(3.1) INTRODUCTION OF THE .NET FRAMEWORK


.NET Framework (pronounced dot net) is a software framework that runs primarily
on Microsoft Windows. It includes a large library and supports several programming
languages which allows language interoperability (each language can use code written in other
languages). The .NET library is available to all the programming languages that .NET supports.
Programs written for the .NET Framework execute in a software environment (as contrasted
to hardware environment), known as the Common Language Runtime (CLR), an application
virtual machine that provides important services such as security, memory management,
and exception handling. The class library and the CLR together constitute the .NET Framework.

The .NET Framework's Base Class Library provides user interface, data access, database
connectivity, cryptography, web application development, numeric algorithms, and network
communications. Programmers produce software by combining their own source code with the
.NET Framework and other libraries. The .NET Framework is intended to be used by most new
applications created for the Windows platform. Microsoft also produces a popular integrated
development environment largely for .NET software called Visual Studio.

The .NET Framework is an integral Windows component that supports building and running the
next generation of applications and XML Web services. The key components of the .NET
Framework are the common language runtime and the .NET Framework class library, which
includes ADO.NET, ASP.NET, and Windows Forms. The .NET Framework provides a managed
execution environment, simplified development and deployment, and integration with a wide
variety of programming languages.

9
.NET Framework in Context

The .NET Framework is a new computing platform that simplifies application development in
the highly distributed environment of the Internet.

The .NET Framework is designed to fulfill the following objectives:


 To provide a consistent object-oriented programming environment whether object code is
stored and executed locally, executed locally but Internet-distributed, or executed
remotely.
 To provide a code-execution environment that minimizes software deployment and
versioning conflicts.
 To provide a code-execution environment that guarantees safe execution of code,
including code created by an unknown or semi-trusted third party.
 To provide a code-execution environment that eliminates the performance problems of
scripted or interpreted environments.

10
 To make the developer experience consistent across widely varying types of applications,
such as Windows-based applications and Web-based applications.
 To build all communication on industry standards to ensure that code based on the .NET
Framework can integrate with any other code.

(3.1.2) Design Features:


Interoperability
Because computer systems commonly require interaction between new and older applications,
the .NET Framework provides means to access functionality that is implemented in programs
that execute outside the .NET environment. Access to COM components is provided in the
System.Runtime.InteropServices and System.EnterpriseServices namespaces of the framework;
access to other functionality is provided using the P/Invoke feature
.
Common Language Runtime Engine
The Common Language Runtime (CLR) is the execution engine of the .NET Framework. All
.NET programs execute under the supervision of the CLR, guaranteeing certain properties and
behaviors in the areas of memory management, security, and exception handling.

Language Independence
The .NET Framework introduces a Common Type System, or CTS. The
CTS specification defines all possible datatypes and programming constructs supported by the
CLR and how they may or may not interact with each other conforming to the Common
Language Infrastructure (CLI) specification. Because of this feature, the .NET Framework
supports the exchange of types and object instances between libraries and applications written
using any conforming .NET language.

Base Class Library


The Base Class Library (BCL), part of the Framework Class Library (FCL), is a library of
functionality available to all languages using the .NET Framework. The BCL
provides classes which encapsulate a number of common functions, including file reading and
writing, graphic rendering, database interaction, XML document manipulation and so on.

11
Simplified Deployment
The .NET Framework includes design features and tools that help manage the installation of
computer software to ensure that it does not interfere with previously installed software, and that
it conforms to security requirements.

Security
The design is meant to address some of the vulnerabilities, such as buffer overflows, that have
been exploited by malicious software. Additionally, .NET provides a common security model for
all applications.

Portability
The design of the .NET Framework allows it theoretically to be platform agnostic, and
thus cross-platform compatible. That is, a program written to use the framework should run
without change on any type of system for which the framework is implemented. While Microsoft
has never implemented the full framework on any system except Microsoft Windows, the
framework is engineered to be platform agnostic, and cross-platform implementations are
available for other operating systems. Microsoft submitted the specifications for the Common
Language Infrastructure (which includes the core class libraries, Common Type System, and
the Common Intermediate Language), the C# language, and the C++/CLI language to
both ECMA and the ISO, making them available as open standards. This makes it possible for
third parties to create compatible implementations of the framework and its languages on other
platform.

12
(3.1.3) Architectural layout of the .NET Framework

An overview of the .NET architecture.

The .NET Framework has two main components:


1. The Common language runtime
2. The .NET Framework class library.

The Common Language Runtime

CLR is the foundation of the .NET Framework. You can think of the runtime as an agent that
manages code at execution time, providing core services such as memory management, thread
management, and remoting, while also enforcing strict type safety and other forms of code
accuracy that ensure security and robustness. In fact, the concept of code management is a
fundamental principle of the runtime. Code that targets the runtime is known as managed code,
while code that does not target the runtime is known as unmanaged code. The class library, the
other main component of the .NET Framework, is a comprehensive, object-oriented collection of

13
reusable types that you can use to develop applications ranging from traditional command-line or
graphical user interface (GUI) applications to applications based on the latest innovations
provided by ASP.NET, such as Web Forms and XML Web services.

The .NET Framework can be hosted by unmanaged components that load the common language
runtime into their processes and initiate the execution of managed code, thereby creating a
software environment that can exploit both managed and unmanaged features. The .NET
Framework not only provides several runtime hosts, but also supports the development of third-
party runtime hosts.

.NET FRAMEWORK CLASS LIBRARY

The .NET Framework class library is a collection of reusable types that tightly integrate with the
common language runtime. The class library is object oriented, providing types from which your
own managed code can derive functionality. This not only makes the .NET Framework types
easy to use, but also reduces the time associated with learning new features of the .NET

14
Framework. In addition, third-party components can integrate seamlessly with classes in the
.NET Framework.

For example, the .NET Framework collection classes implement a set of interfaces that you can
use to develop your own collection classes. Your collection classes will blend seamlessly with
the classes in the .NET Framework.

As you would expect from an object-oriented class library, the .NET Framework types enable
you to accomplish a range of common programming tasks, including tasks such as string
management, data collection, database connectivity, and file access. In addition to these common
tasks, the class library includes types that support a variety of specialized development scenarios.
For example, you can use the .NET Framework to develop the following types of applications
and services:

a) Console applications.
b) Windows GUI applications (Windows Forms).
c) ASP.NET applications.
d) XML Web services.
e) Windows services.

Security
NET has its own security mechanism with two general features: Code Access Security (CAS),
and validation and verification. Code Access Security is based on evidence that is associated
with a specific assembly. Typically the evidence is the source of the assembly (whether it is
installed on the local machine or has been downloaded from the intranet or Internet). Code
Access Security uses evidence to determine the permissions granted to the code. Other code can
demand that calling code is granted a specified permission. The demand causes the CLR to
perform a call stack walk: every assembly of each method in the call stack is checked for the
required permission; if any assembly is not granted the permission a security exception is
thrown. however, has to split the application into subdomains; it is not done by the CLR

Memory management
The .NET Framework CLR frees the developer from the burden of managing memory (allocating
and freeing up when done); instead it does the memory management itself even though there are
no actual guarantees as to when the Garbage Collector will perform its work, unless an explicit
double-call is issued. To this end, the memory allocated to instantiations of .NET types (objects)
is done contiguously from the managed heap, a pool of memory managed by the CLR. As long
as there exists a reference to an object, which might be either a direct reference to an object or

15
via a graph of objects, the object is considered to be in use by the CLR. When there is no
reference to an object, and it cannot be reached or used, it becomes garbage. However, it still
holds on to the memory allocated to it. .NET Framework includes a garbage collector which runs
periodically, on a separate thread from the application's thread, that enumerates all the unusable
objects and reclaims the memory allocated to them.

The .NET Garbage Collector (GC) is a non-deterministic, compacting, mark-and-sweep garbage


collector. The GC runs only when a certain amount of memory has been used or there is enough
pressure for memory on the system. Since it is not guaranteed when the conditions to reclaim
memory are reached, the GC runs are non-deterministic. Each .NET application has a set of
roots, which are pointers to objects on the managed heap (managed objects). These include
references to static objects and objects defined as local variables or method parameters currently
in scope, as well as objects referred to by CPU registers. When the GC runs, it pauses the
application, and for each object referred to in the root, it recursively enumerates all the objects
reachable from the root objects and marks them as reachable. It uses .NET metadata
and reflection to discover the objects encapsulated by an object, and then recursively walk them.
It then enumerates all the objects on the heap (which were initially allocated contiguously) using
reflection. All objects not marked as reachable are garbage.[9] This is the mark phase.

Since the memory held by garbage is not of any consequence, it is considered free space.
However, this leaves chunks of free space between objects which were initially contiguous. The
objects are then compacted together to make used memory contiguous again. Any reference to an
object invalidated by moving the object is updated to reflect the new location by the GC. The
application is resumed after the garbage collection is over.
The GC used by .NET Framework is actually generational. Objects are assigned a generation;
newly created objects belong to Generation 0. The objects that survive a garbage collection are
tagged as Generation 1, and the Generation 1 objects that survive another collection
are Generation 2 objects. The .NET Framework uses up to Generation 2 objects. Higher
generation objects are garbage collected less frequently than lower generation objects. This helps
increase the efficiency of garbage collection, as older objects tend to have a larger lifetime than
newer objects. Thus, by removing older (and thus more likely to survive a collection) objects
from the scope of a collection run, fewer objects need to be checked and compacted.

(3.2) Overview of ASP.NET:

ASP.NET is more than the next version of Active Server Pages (ASP); it provides a unified Web
development model that includes the services necessary for developers to build enterprise-class
Web applications. While ASP.NET is largely syntax compatible with ASP, it also provides a
new programming model and infrastructure for more scalable and stable applications that help

16
provide greater protection. You can feel free to augment your existing ASP applications by
incrementally adding ASP.NET functionality to them.

ASP.NET is a compiled, .NET-based environment; you can author applications in any .NET
compatible language, including Visual Basic .NET, C#, and JScript .NET. Additionally, the
entire .NET Framework is available to any ASP.NET application. Developers can easily access
the benefits of these technologies, which include the managed common language runtime
environment, type safety, inheritance, and so on.

ASP.NET has been designed to work seamlessly with WYSIWYG HTML editors and other
programming tools, including Microsoft Visual Studio .NET. Not only does this make Web
development easier, but it also provides all the benefits that these tools have to offer, including a
GUI that developers can use to drop server controls onto a Web page and fully integrated
debugging support.

Developers can use Web Forms or XML Web services when creating an ASP.NET application,
or combine these in any way they see fit. Each is supported by the same infrastructure that allows
you to use authentication schemes, cache frequently used data, or customize your application's
configuration, to name only a few possibilities.

 Web Forms allow you to build powerful forms-based Web pages. When building these
pages, you can use ASP.NET server controls to create common UI elements, and
program them for common tasks. These controls allow you to rapidly build a Web Form
out of reusable built-in or custom components, simplifying the code of a page. For more
information, see Web Forms Pages. For information on how to develop ASP.NET server
controls.
 An XML Web service provides the means to access server functionality remotely. Using
XML Web services, businesses can expose programmatic interfaces to their data or
business logic, which in turn can be obtained and manipulated by client and server
applications. XML Web services enable the exchange of data in client-server or server-
server scenarios, using standards like HTTP and XML messaging to move data across
firewalls. XML Web services are not tied to a particular component technology or object-
calling convention. As a result, programs written in any language, using any component
model, and running on any operating system can access XML Web services.

Each of these models can take full advantage of all ASP.NET features, as well as the power of
the .NET Framework and .NET Framework common language runtime. These features and how
you can use them are outlined as follows:

 If you have ASP development skills, the new ASP.NET programming model will seem
very familiar to you. However, the ASP.NET object model has changed significantly
from ASP, making it more structured and object-oriented. Unfortunately this means that
ASP.NET is not fully backward compatible; almost all existing ASP pages will have to
be modified to some extent in order to run under ASP.NET. In addition, major changes to
Visual Basic .NET mean that existing ASP pages written with Visual Basic Scripting
Edition typically will not port directly to ASP.NET. In most cases, though, the necessary

17
changes will involve only a few lines of code.

 Accessing databases from ASP.NET applications is an often-used technique for


displaying data to Web site visitors. ASP.NET makes it easier than ever to access
databases for this purpose. It also allows you to manage the database from your code.

 ASP.NET provides a simple model that enables Web developers to write logic that runs
at the application level. Developers can write this code in the Global.asax text file or in a
compiled class deployed as an assembly. This logic can include application-level events,
but developers can easily extend this model to suit the needs of their Web application..

 ASP.NET provides easy-to-use application and session-state facilities that are familiar to
ASP developers and are readily compatible with all other .NET Framework APIs. For
advanced developers who want to use APIs as powerful as the ISAPI programming
interfaces that were included with previous versions of ASP, ASP.NET offers
theIHttpHandler and IHttpModule interfaces. Implementing the IHttpHandler interface
gives you a means of interacting with the low-level request and response services of the
IIS Web server and provides functionality much like ISAPI extensions, but with a simpler
programming model. Implementing the IHttpModule interface allows you to include
custom events that participate in every request made to your application..

 ASP.NET takes advantage of performance enhancements found in the .NET Framework


and common language runtime. Additionally, it has been designed to offer significant
performance improvements over ASP and other Web development platforms. All
ASP.NET code is compiled, rather than interpreted, which allows early binding, strong
typing, and just-in-time (JIT) compilation to native code, to name only a few of its
benefits. ASP.NET is also easily factorable, meaning that developers can remove
modules (a session module, for instance) that are not relevant to the application they are
developing. ASP.NET also provides extensive caching services (both built-in services
and caching APIs). ASP.NET also ships with performance counters that developers and
system administrators can monitor to test new applications and gather metrics on existing
applications
.
 Writing custom debug statements to your Web page can help immensely in
troubleshooting your application's code. However, they can cause embarrassment if they
are not removed. The problem is that removing the debug statements from your pages
when your application is ready to be ported to a production server can require significant
effort. ASP.NET offers the TraceContext class, which allows you to write custom debug
statements to your pages as you develop them. They appear only when you have enabled
tracing for a page or entire application. Enabling tracing also appends details about a
request to the page, or, if you so specify, to a custom trace viewer that is stored in the root
directory of your application.

 The .NET Framework and ASP.NET provide default authorization and authentication
schemes for Web applications. You can easily remove, add to, or replace these schemes,

18
depending upon the needs of your application.

 ASP.NET configuration settings are stored in XML-based files, which are human
readable and writable. Each of your applications can have a distinct configuration file and
you can extend the configuration scheme to suit your requirements.

 Applications are said to be running side by side when they are installed on the same
computer but use different versions of the .NET Framework.

 IIS 6.0 uses a new process model called worker process isolation mode, which is different
from the process model used in previous versions of IIS. ASP.NET uses this process
model by default when running on Windows Server 2003.

(3.2.1) Some of the most important namespaces in the .NET Framework class library that
pertain to ASP.NET are the following:

System.Web:
Provides classes and interfaces that enable browser-server communication. This namespace
includes the HttpRequest class, which provides extensive information about the current HTTP
request, the HttpResponse class, which manages HTTP output to the client, and
the HttpServerUtility class, which provides access to server-side utilities and
processes. System.Web also includes classes for cookie manipulation, file transfer, exception
information, and output cache control.

System.Web.ApplicationServices:
Provides classes that provide access to ASP.NET forms authentication, roles, and profiles
application services as Windows Communication Foundation (WCF) services.

System.Runtime.Caching:
Contains types that let you implement caching in .NET Framework applications.

System.Web.ClientServices:
Contains classes that support access to the ASP.NET login, roles, and profiles services from
Windows-based applications.

System.Web.Configuration:
Contains classes that are used to programmatically manage ASP.NET configuration. (Most
configuration settings can be made in XML files.)

System.Web.DynamicData:
Contains classes that provide the core functionality for ASP.NET dynamic data and extensibility
features that let you customize dynamic data behavior.

19
System.Web.Handlers:
Contains HTTP handler classes that process HTTP requests to a Web server. (An ASP.NET Web
Forms page -- .aspx file -- is a special form of an HTTP handler.)

System.Web.Management:
Contains classes and interfaces for managing and monitoring the health of Web applications.

System.Web.Profile:
Contains classes that are used to implement the ASP.NET user profile in Web server
applications.

System.Web.Query.Dynamic:
Contains classes that are used to parse expressions from a LinqDataSource control into a
Language-Integrated Query (LINQ).

System.Web.RegularExpressions:
Provides regular expressions that are used to parse ASP.NET files. All members of
the System.Web.RegularExpressions namespace are descendants of the Regex class. (You typically
do not have to parse ASP.NET pages yourself.)

System.Web.Routing:
Provides classes that are used with URL routing, which enables you to use URLs that do not map
to a physical file.

System.Web.Script:
Contains classes that provide client-script resource information.

System.Web.Script.Services:
Provides attributes to customize Web service support for using Ajax functionality in ASP.NET.

System.Web.Security:
Contains classes that are used to implement ASP.NET security in Web server applications.

System.Web.Services:
Consists of the classes that enable you to create XML Web services using ASP.NET and XML
Web service clients. XML Web services are applications that provide the ability to exchange
messages in a loosely coupled environment using standard protocols such as HTTP, XML, XSD,
SOAP, and WSDL. XML Web services let you build modular applications that are interoperable
across a broad variety of implementations, platforms, and devices.

System.Web.SessionState:
Contains classes and interfaces that enable storage of data specific to a single client during a
single browser session on the server. Session state data is used to give the client the appearance
of a persistent connection with the application.

20
System.Web.UI:
Provides classes and interfaces that enable you to create ASP.NET server controls and ASP.NET
Web pages for the user interface of your ASP.NET Web applications. This namespace includes
the Control class, which provides all HTML server controls, Web server controls, and user
controls with a common set of functionality. It also includes the Page control, which is generated
automatically whenever a request is made for an .aspx file in an ASP.NET Web application. Also
included are classes which provide the server controls with data-binding functionality, the ability
to save the view state of a given control or page, and parsing functionality.

System.Web.UI.DataVisualization.Charting:
Contains types for the Chart Web server control.

System.Web.UI.Design.WebControls:
Contains classes that can be used to extend design-time support for Web server controls.

System.Web.UI.Design.WebControls.WebParts:
Contains classes that provide design-time support for controls derived from classes in
the System.Web.UI.WebControls.WebParts namespace.

System.Web.UI.HtmlControls:
Contains a collection of classes that enable you to create HTML server controls on a Web Forms
page. HTML server controls run on the server and map directly to standard HTML tags
supported by most browsers. This enables you to programmatically control the HTML elements
on a Web Forms page.

System.Web.UI.WebControls:
Contains classes that enable you to create Web server controls on a Web page. Web server
controls run on the server and include form controls such as buttons and text boxes. They also
include special-purpose controls such as a calendar. Because Web server controls run on the
server, you can programmatically control these elements. Web server controls are more abstract
than HTML server controls. Their object model does not necessarily reflect HTML syntax.

System.Web.UI.WebControls.WebParts:
Contains an integrated set of classes and interfaces for creating Web pages whose appearance
and behavior can be modified (personalized) by end users. The user-defined settings for each
page are saved for future browser sessions.

System.Web.Util:
Contains classes that enable callback methods to be run under the scope of a transaction and that
enable work to be posted to separate threads.

21
(3.2.2) Page and Control Framework:

The ASP.NET page and controls framework is a programming framework that runs on a Web
server to dynamically produce and render ASP.NET Web pages. ASP.NET Web pages can be
requested from any browser or client device, and ASP.NET renders markup (such as HTML) to
the requesting browser. As a rule, you can use the same page for multiple browsers, because
ASP.NET renders the appropriate markup for the browser making the request. However, you can
design your ASP.NET Web page to target a specific browser and take advantage of the features
of that browser.

ASP.NET Web pages are completely object-oriented. Within ASP.NET Web pages you can
work with HTML elements using properties, methods, and events. The ASP.NET page
framework removes the implementation details of the separation of client and server inherent in
Web-based applications by presenting a unified model for responding to client events in code
that runs at the server. The framework also automatically maintains the state of a page and the
controls on that page during the page processing life cycle. For more information

The ASP.NET page and controls framework also enables you to encapsulate common UI
functionality in easy-to-use, reusable controls. Controls are written once, can be used in many
pages, and are integrated into the ASP.NET Web page that they are placed in during rendering.

The ASP.NET page and controls framework also provides features to control the overall look
and feel of your Web site via themes and skins. You can define themes and skins and then apply
them at a page level or at a control level..

In addition to themes, you can define master pages that you use to create a consistent layout for
the pages in your application. A single master page defines the layout and standard behavior that
you want for all the pages (or a group of pages) in your application. You can then create
individual content pages that contain the page-specific content you want to display. When users
request the content pages, they merge with the master page to produce output that combines the
layout of the master page with the content from the content page.

The ASP.NET page framework also enables you to define the pattern for URLs that will be used
in your site. This helps with search engine optimization (SEO) and makes URLs more user-
friendly..

The ASP.NET page and control framework is designed to generate HTML that conforms to
accessibility guidelines.

(3.2.3) ASP.NET Compilation Overview:

In order for application code to service requests by users, ASP.NET must first compile the code
into one or more assemblies. Assemblies are files that have the file name extension .dll. You can
write ASP.NET code in many different languages, such as Visual Basic, C#, J#, and others.
When the code is compiled, it is translated into a language-independent and CPU-independent
representation called Microsoft Intermediate Language (MSIL). At run time, MSIL runs in the

22
context of the .NET Framework, which translates MSIL into CPU-specific instructions for the
processor on the computer running the application.

There are many benefits to compiling application code including:

 Performance Compiled code is much faster than scripting languages such as


ECMAScript or VBScript because it is a closer representation to machine code and does
not require additional parsing.
 Security Compiled code is more difficult to reverse engineer than non-compiled source
code because it lacks the readability and abstraction of a high-level language. Additionally,
there are obfuscation tools that make compiled code even more resistant to reverse
engineering.
 Stability Code is checked at compile time for syntax errors, type safety, and other
problems. By catching these errors at build-time you can eliminate many errors in your
code.
 Interoperability Because MSIL code supports any .NET language, you can use
assemblies that were originally written in other languages in your code. For example, if
you are writing an ASP.NET Web page in C#, you can add a reference to a .dll file that
was written in Visual Basic.

The ASP.NET compilation architecture includes a number of features including:

 Multiple language support.


 Automatic compilation.
 Flexible deployment.
 Extensible build system.

The following sections describe each of these features.

Multiple Language Support


In ASP.NET 2.0 you can use different languages such as Visual Basic and C# in the same
application because ASP.NET will create multiple assemblies, one for each language. For code
stored in the App_Code folder, you can specify a subfolder for each language.

Automatic Compilation:
ASP.NET automatically compiles your application code and any dependent resources the first
time a user requests a resource from the Web site. In general, ASP.NET creates an assembly for
each application directory (such as App_Code) and one for the main directory. (If files in a
directory are in different programming languages, then separate assemblies will be created for
each language.) You can specify which directories are compiled into single assemblies in
the Compilation section of the Web.config file.

Flexible Deployment
Because ASP.NET compiles your Web site on first user request, you can simply copy your
application's source code to the production Web server. However, ASP.NET also provides

23
precompilation options that allow you to compile your Web site before it has been deployed, or
to compile it after it has been deployed but before a user requests it. Precompilation has several
advantages. It can improve the performance of your Web site on first request because there will
be no lag time while ASP.NET compiles the site. Precompiling can also help you find errors that
might otherwise be found only when a user requests a page. Finally, if you precompile the Web
site before you deploy it, you can deploy the assemblies instead of the source code.

You can precompile a Web site using the ASP.NET compiler tool (ASPNET_Compiler.exe).
The tool that provides the following precompilation options:

 In-place compilation This option performs the same compilation that occurs during
dynamic compilation. Use this option to compile a Web site that has already been
deployed to a production server.
 Non-updateable full precompilation Use this to compile an application and then copy
the compiled output to the production server. All application code, markup, and UI code is
compiled into assemblies. Placeholder files such as .aspx pages still exist so that you can
perform file-specific tasks such as configure permissions, but the files contain no
updateable code. In order to update any page or any code you must precompile the Web
site again and deploy it again.
 Updateable precompilation This is similar to non-updateable full precompilation,
except that UI elements such as .aspx pages and .ascx controls retain all their markup, UI
code, and inline code, if any. You can update code in the file after it has been deployed;
ASP.NET will detect changes to the file and recompile it. Note that code in a code-behind
file (.vb or .cs file) built into assemblies during precompilation, and you therefore cannot
change it without going through the precompilation and deployment steps again..

Extensible Build System:


ASP.NET uses BuildProvider classes to build items such as .aspx pages, .ascx files, and global
resources. You can extend and customize the ASP.NET build system to compile custom
resources by creating classes that inherit from the BuildProvider class. For example, you could
add a new file type and then write a BuildProvider that builds that particular type.

(3.2.4)ASP.NET Security:
Security is a very important aspect of ASP.NET Web applications. The topics in this section
provide background information about security issues that occur in Web applications. The topics
include information about how to mitigate common security threats, how to protect resources in
a Web application, and about how to authenticate and authorize individual users.
ASP.NET Web Application Security:
ASP.NET, in conjunction with Microsoft Internet Information Services (IIS), can authenticate
user credentials such as names and passwords using any of the following authentication methods:
 Windows: Basic, digest, or Integrated Windows Authentication (NTLM or Kerberos).

24
 Forms authentication, in which you create a login page and manage authentication in
your application.
 Client Certificate authentication

ASP.NET controls access to site information by comparing authenticated credentials, or


representations of them, to NTFS file system permissions or to an XML file that lists authorized
users, authorized roles (groups), or authorized HTTP verbs.

Managing Users by Using Membership:


ASP.NET membership enables you to validate and manage user information for your Web
application. It provides functionality for validating user credentials, creating and modifying
membership users, and managing user settings such as passwords and e-mail addresses.
ASP.NET membership is primarily intended for use with ASP.NET forms authentication, but
can be used anywhere within an ASP.NET application.

ASP.NET membership enables you to manage user authentication for your application while
keeping the user information in the data source of your choice. Because ASP.NET membership
uses providers to the membership data source, it does not require extensive code to read and
write membership information.

ASP.NET membership consists primarily of built-in membership providers, which communicate


with the data source, and the static Membership class that exposes the functionality of the
membership providers. You call the Membership class from your ASP.NET code to perform user
validation and management.

(3.3) C# language and the .net framework


(3.3.1)History of C#
.NET framework offers a myriad of languages which puts us programmers into a deep
thought process about which programming language best suits our needs.

Which language is the "best" language choice? If you are a VB wizard, should you take
the time to learn C# or continue to use VB.NET? Are C# ASP.NET pages "faster" than
VB .NET ASP.NET pages? These are questions that you may find yourself asking,
especially when you're just starting to delve into .NET. Fortunately the answer is simple:
there is no "best" language. All .NET languages use, at their root, functionality from the
set of classes provided by the .NET Framework. Therefore, everything
you can do in VB.NET you can do in C#, and vice-a-versa.

The differences occur in three main areas: syntax, object-oriented principles, and the
Visual Studio .NET IDE. Syntax concerns the statements and language elements. Object
Oriented differences are less obvious, and concern differences in implementation and
feature sets between the two languages. IDE differences include things like compiler
settings or attributes. There is also a fourth area of difference: language features that are
present in one language but have no equivalent in the other.

25
If you are more familiar with Java, JScript, or C/C++, you may find C#'s syntax more
familiar than VB.NET's.

A good question that has to be answered in order to keep you interested in learning C# is
Why should you learn another programming language when you already doing enterprise
development in C++ or Java. The very answer at the first go will be C# is intended to be
the premier language for writing NGWS (Next Generation of Windows Services)
applications in the enterprise computing world.

The programming language C# derives from C and C++; however apart from being
entirely object oriented it is type safe and simple too. If you are a C/C++ programmer
your learning curve should be flat. Many C# statements including expressions and
operators have been taken directly taken from your favourite language

An important point about C# is that it simplifies and modernizes C++ in the areas of
classes, namespaces and exception handling. Much of complex features have not been
included or in fact hidden in C# to make it easer to use and more importantly less error
prone for e.g. no more macros, templates and no multiple inheritances (Few of you might
not like it.)

The only expense that I can think of is that your code operates in safe mode, where no
pointers are allowed. However if you want to use pointers you are not restricted from
using it via unsafe code- and no marshalling is involved when calling the unsafe code.

(3.3.2) About C#

C# is an elegant and type-safe object-oriented language that enables developers to build a wide
range of secure and robust applications that run on the .NET Framework. You can use C# to
create traditional Windows client applications, XML Web services, distributed components,
client-server applications, database applications, and much, much more. Microsoft Visual C#
2005 provides an advanced code editor, convenient user interface designers, integrated debugger,
and many other tools to facilitate rapid application development based on version 2.0 of the C#
language and the .NET Framework.

C# syntax is highly expressive, yet with less than 90 keywords, it is also simple and easy to
learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C,
C++ or Java. Developers who know any of these languages are typically able to begin working
productively in C# within a very short time. C# syntax simplifies many of the complexities of
C++ while providing powerful features such as nullable value types, enumerations, delegates,
anonymous methods and direct memory access, which are not found in Java. C# also supports
generic methods and types, which provide increased type safety and performance, and iterators,
which enable implementers of collection classes to define custom iteration behaviors that are
simple to use by client code.

26
As an object-oriented language, C# supports the concepts of encapsulation, inheritance and
polymorphism. All variables and methods, including the Main method, the application's entry
point, are encapsulated within class definitions. A class may inherit directly from one parent
class, but it may implement any number of interfaces. Methods that override virtual methods in a
parent class require the override keyword as a way to avoid accidental redefinition. In C#, a
struct is like a lightweight class; it is a stack-allocated type that can implement interfaces but
does not support inheritance.

In addition to these basic object-oriented principles, C# facilitates the development of software


components through several innovative language constructs, including:

 Encapsulated method signatures called delegates, which enable type-safe event


notifications.
 Properties, which serve as accessors for private member variables.
 Attributes, which provide declarative metadata about types at run time.
 Inline XML documentation comments.

If you need to interact with other Windows software such as COM objects or native Win32
DLLs, you can do this in C# through a process called "Interop." Interop enables C# programs to
do just about anything that a native C++ application can do. C# even supports pointers and the
concept of "unsafe" code for those cases in which direct memory access is absolutely critical.

The C# build process is simple compared to C and C++ and more flexible than in Java. There are
no separate header files, and no requirement that methods and types be declared in a particular
order. A C# source file may define any number of classes, structs, interfaces, and events.

C# programs run on the .NET Framework, an integral component of Windows that includes a
virtual execution system called the common language runtime (CLR) and a unified set of class
libraries. The CLR is Microsoft's commercial implementation of the common language
infrastructure (CLI), an international standard that is the basis for creating execution and
development environments in which languages and libraries work together seamlessly.

Source code written in C# is compiled into an intermediate language (IL) that conforms to the
CLI specification. The IL code, along with resources such as bitmaps and strings, is stored on
disk in an executable file called an assembly, typically with an extension of .exe or .dll. An
assembly contains a manifest that provides information on the assembly's types, version, culture,
and security requirements.

When the C# program is executed, the assembly is loaded into the CLR, which might take
various actions based on the information in the manifest. Then, if the security requirements are
met, the CLR performs just in time (JIT) compilation to convert the IL code into native machine
instructions. The CLR also provides other services related to automatic garbage collection,
exception handling, and resource management. Code that is executed by the CLR is sometimes
referred to as "managed code," in contrast to "unmanaged code" which is compiled into native
machine language that targets a specific system. The following diagram illustrates the compile-

27
time and run time relationships of C# source code files, the base class libraries, assemblies, and
the CLR.

Language interoperability is a key feature of the .NET Framework. Because the IL code
produced by the C# compiler conforms to the Common Type Specification (CTS), IL code
generated from C# can interact with code that was generated from the .NET versions of Visual
Basic, Visual C++, Visual J#, or any of more than 20 other CTS-compliant languages. A single
assembly may contain multiple modules written in different .NET languages, and the types can
reference each other just as if they were written in the same language.

In addition to the run time services, the .NET Framework also includes an extensive library of
over 4000 classes organized into namespaces that provide a wide variety of useful functionality
for everything from file input and output to string manipulation to XML parsing, to Windows
Forms controls. The typical C# application uses the .NET Framework class library extensively to
handle common "plumbing" chores.
28
3.3.3 Statements:
In C#, a complete program instruction is called a statement and each statement ends with a
semicolon (;) . Programs consist of sequences of statements such as:
int myVariable; // a statement
myVariable = 23; // another statement
int anotherVariable = myVariable; // yet another statement

The compiler starts at the beginning of a source code file and reads down, executing statement
after statement in the order encountered. This would be entirely straightforward, and terribly
limiting, were it not for branching . Branching allows you to change the order in which
statements are evaluated.

3.3.4 Data Types


C# is a strongly typed language. That means that every object you create or use in a C# program
must have a specific type (e.g., you must declare the object to be an integer or a string or a Dog
or a Button). Essentially, the type indicates how big the object is (in memory) and what it can do.

Types come in two flavors: those that are built into the language (intrinsic types ) and those you
create . C# offers a number of intrinsic types, show in table

Table . The intrinsic types


C# type Size (in bytes) .NET type Description
byte 1 Byte Unsigned (values 0-255).
char 2 Char Unicode characters.
bool 1 Boolean True or false.
sbyte 1 SByte Signed (values -128 to 127).
short 2 Int16 Signed (short) (values -32,768 to 32,767).
ushort 2 UInt16 Unsigned (short) (values 0 to 65,535).
Signed integer values between -
Int 4 Int32
2,147,483,648 and 2,147,483,647.
Uint Unsigned integer values between 0 and
4 UInt32
4,294,967,295.
float Floating point number. Holds the values
from approximately +/-1.5 * 10-45 to
4 Single
approximately +/-3.4 * 1038 with 7
significant figures.

29
Table . The intrinsic types
C# type Size (in bytes) .NET type Description
double Double-precision floating point; holds the
values from approximately +/-5.0 * 10-324
8 Double
to approximately +/-1.8 * 10308 with 1516
significant figures.
decimal Fixed-precision up to 28 digits and the
position of the decimal point. This is
12 Decimal
typically used in financial calculations.
Requires the suffix "m" or "M."
long Signed integers ranging from -
8 Int64 9,223,372,036,854,775,808 to
9,223,372,036,854,775,807.
ulong Unsigned integers ranging from 0 to
8 UInt64
approximately 1.85 * 1019.

Each type has a name (such as int) and a size (such as 4 bytes). The size tells you how many
bytes each object of this type occupies in memory. (Programmers generally don't like to waste
memory if they can avoid it, but with the cost of memory these days, you can afford to be mildly
profligate if doing so simplifies your program.) The description field of tells you the minimum
and maximum values you can hold in objects of each type.

3.3.5 Variables
A variable is an instance of an intrinsic type (such as int) that can hold a value:
int myVariable = 15;

You initialize a variable by writing its type, its identifier, and then assigning a value to that
variable.An identifier is just an arbitrary name you assign to a variable, method, class, or other
element. In this case, the variable's identifier is myVariable.You can define variables without
initializing them:
int myVariable;

You can then assign a value to myVariable later in your program:


int myVariable;
// some other code here
myVariable = 15; // assign 15 to myVariable

You can also change the value of a variable later in the program. That is why they're called
variables; their values can vary.

int myVariable;
myVariable = 15;
myVariable = 12; // now it is 12

30
3.3.6 Constants:
Variables are a powerful tool, but there are times when you want to manipulate a defined value,
one whose value you want to ensure remains constant. A constant is like a variable in that it can
store a value. However, unlike a variable, you cannot change the value of a constant while the
program runs.For example, you might need to work with the Fahrenheit freezing and boiling
points of water in a program simulating a chemistry experiment. Your program will be clearer if
you name the variables that store these values FreezingPoint and BoilingPoint, but you do not
want to permit their values to be changed while the program is executing. The solution is to use
a constant. Constants come in three flavors: literals, symbolic constants , and enumerations .

3.3.6.1 Literal Constants:


A literal constant is just a value. For example, 32 is a literal constant. It does not have a name; it
is just a literal value. And you can't make the value 32 represent any other value. The value of
32 is always 32. You can't assign a new value to 32, and you can't make 32 represent the value
99 no matter how hard you might try.

3.3.6.2. Symbolic Constants:


Symbolic constants assign a name to a constant value. You declare a symbolic constant using
the following syntax:
const type identifier = value;
The const keyword is followed by a type, an identifier, the assignment operator (=), and the
value with which you'll initialize the constant.

This is similar to declaring a variable, except that you start with the keyword const and
symbolic constants must be initialized. Once initialized, a symbolic constant cannot be altered.
For example, in the following declaration, 32 is a literal constant and FreezingPoint is a
symbolic constant of type int:

const int FreezingPoint = 32;

3.3.6.3. Enumerations:
Enumerations provide a powerful alternative to literal or simple symbolic constants. An
enumeration is a distinct value type, consisting of a set of named constants (called the
enumerator list).you created two related constants:

const int FreezingPoint = 32;


const int BoilingPoint = 212;

You might want to add a number of other useful constants to this list as well, such as:

const int LightJacketWeather = 60;


const int SwimmingWeather = 72;

31
const int WickedCold = 0;

Notice, however, that this process is somewhat cumbersome; also, this syntax shows no logical
connection among these various constants. C# provides an alternate construct, the enumeration,
which allows you to group logically related constants, as in the following:

enum Temperatures
{
WickedCold = 0,
FreezingPoint = 32,
LightJacketWeather = 60,
SwimmingWeather = 72,
BoilingPoint = 212,
}

3.3.7 Strings:
It is nearly impossible to write a C# program without creating strings . A string object holds a
series of characters.You declare a string variable using the string keyword much as you would
create an instance of any type:
string myString;
You specify a string literal by enclosing it in double quotes:
"Hello World"
It is common to initialize a string variable that contains a string literal:
string myString = "Hello World";

3.3.8 Expressions
Statements that evaluate to a value are called expressions . You may be surprised how many
statements do evaluate to a value. For example, an assignment such as:
myVariable = 57;
is an expression; it evaluates to the value assignedin this case, 57.
Because myVariable = 57 is an expression that evaluates to 57, it can be used as part of another
assignment, such as:
mySecondVariable = myVariable = 57;

What happens in this statement is that the literal value 57 is assigned to the variable
myVariable. The value of that assignment (57) is then assigned to the second variable,
mySecondVariable. Thus, the value 57 is assigned to both variables. You can assign a value to
any number of variables with one statement using the assignment operator (=), as in the
following:

int a,b,c,d,e;
a = b = c = d = e = 20;

32
Net Architecture and the .Net Framework:
In the .Net Architecture and the .Net Framework there are different important terms and concepts
which we will discuss one by one.
Common Language Runtime (CLR):
The most important concept of the .Net Framework is the existence and functionality of the Net
Common Language Runtime (CLR), also called .Net Runtime in short. It is a framework.layer
that resides above the OS and handles the execution of all the .Net applications. Our programs
don't directly communicate with the OS but go through the CLR.

MSIL (Microsoft Intermediate Language) Code:


When we compile our .Net Program using any .Net compliant language (like C#, VB.Net,
C++.Net) it does not get converted into the executable binary code but to an intermediate code,
called MSIL or IL, understandable by CLR. MSIL is OS and hardware independent code. When
the program needs to be executed, this MSIL, or intermediate code, is converted to binary
executable code (native code). The presence of IL makes possible the Cross Language
Relationship as all the .Net compliant languages produce similar, standard IL code.

Just In Time Compilers (JITers)


When our IL compiled code needs to be executed, CLR invokes the JIT compilers which
compile the IL code to native executable code (.exe or .dll) that is designed for the specific
machine and OS. JITers in many ways are different from traditional compilers as they compile
the IL to native code only when desired; e.g., when a function is called, the IL of the function's
body is converted to native code just in time. So, the part of code that is not used by that
particular run is never converted to native code. If some IL code is converted to native code, then
the next time it's needed, the CLR reuses the same (already compiled)copy without re-compiling.
So, if a program runs for sometime (assuming that all or most of the functions get called), then it
won't have any just-in-time performance penalty. As JITers are aware of the specific processor
and OS at runtime, they can optimize the code extremely efficiently resulting in very robust
applications. Also, since a JIT compiler knows the exact current state of executable code, they
can also optimize the code by in-lining small function calls (like replacing body of small
function when its called in a loop, savingthe function call time). Although Microsoft stated that
C# and .Net are not competing with languages like C++ in efficiency and speed of execution,

33
JITers can make your code even faster than C++ code in some cases when the program is run
over an extended period of time (like web-servers).

Framework Class Library (FCL)


The .Net Framework provides a huge Framework (or Base) Class Library (FCL) for common,
usual tasks. FCL contains thousands of classes to provide access to Windows API and common
functions like String Manipulation, Common Data Structures, IO, Streams, Threads, Security,
Network Programming, Windows Programming, Web Programming, Data Access, etc. It is
simply the largest standard library ever shipped with any development environment or
programming language. The best part of this library is they follow extremely efficient OO design
(design patterns) making their access and use very simple and predictable. You can use the
classes in FCL in your program just as you would use any other class. You can even apply
inheritance and polymorphism to these classes.

Common Language Specification (CLS)


Earlier, we used the term '.Net Compliant Language' and stated that all the .Net compliant
languages can make use of CLR and FCL. But what makes a language a '.Net compliant'
language? The answer is the Common Language Specification (CLS). Microsoft has released a
small set of specifications that each language should meet to qualify as a .Net Compliant
Language. As IL is a very rich language, it is not necessary for a language to implement all the
IL functionality; rather, it merely needs to meet a small subset of CLS to qualify as a (Net
compliant language. This is the reason why so many languages (procedural and OO.are now
running under the .Net umbrella. CLS basically addresses language design issues and lays down
certain standards. For instance, there shouldn't be any global function declarations, no pointers,
no multiple inheritance and things like that. The important point to note here is that if you keep
your code within the CLS boundary, your code is guaranteed to be usable in any other .Net
language.

Common Type System (CTS):


.Net also defines a Common Type System (CTS). Like CLS, CTS is also a set of standards.CTS
defines the basic data types that IL understands. Each .Net compliant language should map its
data types to these standard data types. This makes it possible for the 2 languages to
communicate with each other by passing/receiving parameters to/from each other. For example,
CTS defines a type, Int32, an integral data type of 32 bits (4 bytes) which is mapped by C#
through int and VB.Net through its Integer data type.

34
Garbage Collector (GC) :
CLR also contains the Garbage Collector (GC), which runs in a low-priority thread and checks
for un-referenced, dynamically allocated memory space. If it finds some data that is no longer
referenced by any variable/reference, it re-claims it and returns it to the OS so it can be used by
other programs as needed. The presence of a standard Garbage Collector frees the programmer
from keeping track of dangling data.

(3.4.4) Basic Data Types and their mapping to the CTS (Common Type System)
There are two kinds of data types in VB.Net
1. Value type (implicit data types, Structure and Enumeration)
2. Reference Type (objects, delegates)
Value types are passed to methods by passing an exact copy while Reference types are passed to
methods by passing only their reference (handle). Implicit data types are defined in the language
core by the language vendor, while explicit data types are types that are made by using or
composing implicit data types.Implicit data types in .net compliant languages are mapped to
types in Common Type System (CTS) and CLS (Common Language Specification). Hence, each
implicit data type in VB.Net has its corresponding .Net type. The implicit data types in VB.Net
are:

1. Boolean
2. Char
3. Byte
4. Short
5. Integer(default)
6. Long
7. Single
8. Double(default)
9. Decimal

Implicit data types are represented in language using 'keywords'; so each of above is a keyword
in VB.Net (Keyword are the words defined by the language and can not be used as identifiers). It
is worth-noting that string is also an implicit data type in VB.Net, so String is a keyword in
VB.Net. Last point about implicit data types is that they are value types and thus stored at the
stack, while user defined types or referenced types are stored at heap. Stack is a data structure
that store items in last in first out (LIFO) fashion. It is an area of memory supported by the
processor and its size is determined at the compile time. Heap is the total memory available at

35
run time. Reference types are allocated at heap dynamically (during the execution of program).
Garbage collector searches for non-referenced data in heap during the execution of program and
returns that space to Operating System.

4. INTRODUCTION TO SQL SERVER

(4.1) INTRODUCTION

Microsoft SQL Server is a relational model database server produced by Microsoft. Its primary
query languages are T-SQL and ANSI SQL. The current version of SQL Server, SQL Server
2008, (code-named "Katmai",) was released (RTM) on August 6, 2008and aims to make data
management self-tuning, self organizing, and self maintaining with the development of SQL
Server Always On technologies, to provide near-zero downtime. SQL Server 2008 also includes
support for structured and semi-structured data, including digital media formats for pictures,
audio, video and other. multimedia data. In current versions, such multimedia data can be stored
as BLOBs (binary large objects), but they are generic bit streams. Intrinsic awareness of
multimedia data will allow specialized functions to be performed on them. According to Paul
Flessner, senior Vice President, Server Applications, Microsoft Corp., SQL Server 2008 can be a
data storage backend for different varieties of data: XML, email, time/calendar, file, document,
spatial, etc as well as perform search, query, analysis, sharing, and synchronization across all
data types.

Other new data types include specialized date and time types and a Spatial data type for location-
dependent data. Structured data and metadata about the file is stored in SQL Server database,
whereas the unstructured component is stored in the file system. Such files can be accessed both
via Win32 file handling APIs as well as via SQL Server using T-SQL; doing the latter accesses
the file data as a BLOB. Backing up and restoring the database backs up or restores the
referenced files as well. SQL Server 2008 also natively supports hierarchical data, and includes
T-SQL constructs to directly deal with them, without using recursive queries.

The Full-Text Search functionality has been integrated with the database engine, which
simplifies management and improves performance. Spatial data will be stored in two types. A
"Flat Earth" (GEOMETRY or planar) data type represents geospatial data which has been
projected from its native, spherical, coordinate system into a plane. A "Round Earth" data type

36
(GEOGRAPHY) uses an ellipsoidal model in which the Earth is defined as a single continuous
entity which does not suffer from the singularities such as the international dateline, poles, or
map projection zone "edges". Approximately 70 methods are available to represent spatial
operations for the Open Geospatial Consortium Simple Features for SQL, Version 1.1.SQL
Server includes better compression features, which also helps in improving scalability. It also
includes Resource Governor that allows reserving resources for certain users or workflows. It
also includes capabilities for transparent encryption of data as well as compression of backups.
SQL Server 2008 supports the ADO.NET Entity Framework and the reporting tools, replication,
and data definition will be built around the Entity Data Model. SQL Server Reporting Services
will gain charting capabilities from the integration of the data visualization products from
Dundas Data Visualization Inc., which was acquired by Microsoft. On the management side,
SQL Server 2008 includes the Declarative Management Framework which allows configuring
policies and constraints, on the entire database or certain tables, declaratively. The version of
SQL Server Management Studio included with SQL Server 2008 supports IntelliSense for SQL
Queries against a SQLServer2008 Database
Enginehttp://en.wikipedia.org/wiki/Microsoft_SQL_Server - cite_note-14. SQL Server 2008 also
makes the databases available via Windows Power Shell providers and management
functionality available as Cmdlets, so that the server and all the running instances can be
managed from Windows PowerShell. SQL Server 2008 R2.

SQL Server 2008 R2 :(formerly codenamed SQL Server "Kilimanjaro") was announced at
TechEd 2009. SQL Server 2008 R2 adds certain features to SQL Server 2008 including master
data management system branded as Master Data Services, a centralized console to manage
multiple SQL Server instances, and support for more than 64 logical processors.

(4.2) DATABASE DESIGN

CREATING DATA BASE IN SQL SERVER

Run the following query in query window

Create database imp(database name)

Another way:-

The following steps demonstrate how to create a database in SQL Server using Enterprise
Manager.

 Right click on the "Databases" icon and select "New Database...":

37
Creating new Databse

38
1. Name your database and click "OK":

Naming the database

New database appears under the "Databases" section of Enterprise Manager.

New database is based on the "Model" database. The Model database is a system database which
is used as a template whenever a new database is created. If we use the left pane to navigate to
our database and expand the tree, we will notice that our database already contains a number of
objects. For example, it already contains tables, views, and stored procedures. These are system
objects which provide information about the database.

39
Default data files in the database

We have just created a database using the default options. When we created the database, a "Data
File" and a "Transaction Log" were created. They were created in the default location for our
server.

If we'd wanted to, we could have specified a different location for these files by using the "Data
Files" tab and "Transaction Log" tab. We also could have changed specifications on whether to
allow the file to grow automatically (as it stores more and more data), and if so, how that growth
should be managed.

40
Properties of data base

How to create a table in a Database

Create table useraccout(table name)(id int identity,username varchar(50))

Another way:-1.Ensuring you have the right database expanded, right click on the "Tables" icon
and select "New Table...":

41
Creating tables in the database
While you have this screen open, do the following: Using the values in the screenshot, complete
the details in the "Column Name" column, the "Data Type" column, "Length" column, and
"Allow Nulls" column.

Make the IndividualId column an "identity column", by setting "Identity" to "Yes" (just use the
same values as in the screenshot). Note that to set values in the bottom pane, you need to select
the column name in the top pane first). This column is going to be an auto-number column - it
will contain an incrementing number for each record that is created.

Set the "Default Value" of the DateCreated column to (getdate()). (This will automatically insert
the current date into that field for each new record).

Design of a table

What we are doing at this stage, is creating the column names, specifying the type of data that
can be entered into them, and setting default values. Restricting the data type for each column is
very important and helps maintain data integrity. For example, it can prevent us from
accidentally entering an email address into a field for storing the current date.

42
Close the table by clicking the close icon, and when prompted, name your table:
We can use Enterprise Manager to add data - all we need to do is open the table, then start
typing.

1. To open the table, right click on the table you wish to open, and select "Open Table >
Return all rows":

Opening of a table

2. You can now start entering the data directly into your table.

43
5. E-R DIAGRAMS

(5.1)E-R Diagrams:
Entity-relationship model, a graphical representation of entities and their relationships to each
other, typically used in computing in regard to the organization of data within databases or
information systems. An entity is a piece of data-an object or concept about which data is stored.
A relationship is how the data is shared between entities

Entity:
An entity type is any type of object that we wish to store data about. Which entity types you
decide to include on your diagram depends on your application. In an accounting application for
a business you would store data about customers, suppliers, products, invoices and payments and
if the business manufactured the products, you would need to store data about materials and
production steps. Each of these would be classified as an entity type because you would want to
store data about each one.

An entity type is considered to be a set of objects. For this reason some people use the alternative
term entity set. An entity is simply one member or example or element or instance of the type or
set. So an entity is one individual within an entity type.

Attributes:
The data that we want to keep about each entity within an entity type is contained in attributes.
An attribute is some quality about the entities that we are interested in and want to hold on the
database. In fact we store the value of the attributes on the database. Each entity within the entity
type will have the same set of attributes, but in general different attribute values.

44
7. Summary

45
46

You might also like