You are on page 1of 112

CITIZENSHIP CODE

ABSTRACT

The increasing use of Internet in a variety of distributed multiparty interactions and transactions
with strong real-time requirements has pushed the search for solutions to the problem of attribute-based
digital interactions.
A promising solution today is represented by automated trust negotiation systems. Trust
negotiation systems allow subjects in different security domains to securely exchange protected
resources and services.
These trust negotiation systems, however, by their nature, may represent a threat to privacy in
that credentials, exchanged during negotiations, often contain sensitive personal information that may
need to be selectively released. In this paper, we address the problem of preserving privacy in trust
negotiations.
We introduce the notion of privacy preserving disclosure, that is, a set that does not include
attributes or credentials, or combinations of these that may compromise privacy.
To obtain privacy preserving disclosure sets, we propose two techniques based on the notions of
substitution and generalization. We argue that formulating the trust negotiation requirements in terms of
disclosure policies is often restrictive.
To solve this problem, we show how trust negotiation requirements can be expressed as
property-based policies that list the properties needed to obtain a given resource.
To better address this issue, we introduce the notion of reference ontology, and formalize the
notion of trust requirement.
Additionally, we develop an approach to derive disclosure policies from trust requirements and
formally state some semantics relationships (i.e., equivalence, stronger than) that may hold between
policies. These relationships can be used by a credential requestor to reason about which disclosure
policies he/she should use in a trust negotiation.

1
CITIZENSHIP CODE

INDEX

S. N CONTENTS

1. INTRODUCTION
2. ANALYSIS
2.1 SYSTEM ANALYSIS
2.2.1.1 SYSTEM SPECIFICATIONS
3. DESIGN APPROACH
3.1 INTRODUCTION TO DESIGN
3.2 DIAGRAMS
3.3 DATA FLOW DIAGRAMS
3.4 E-R DIAGRAMS
4. PROJECT MODULES
5. IMPLEMENTATION
4.1 CONCEPTS AND TECHNIQUES
4.2 TESTING
4.2.1 TEST CASES
6. OUTPUT SCREENS
7. CONCLUSION
8. FUTURE ENHANCEMENTS
9. BIBILIOGRAPHY

2
CITIZENSHIP CODE

3
CITIZENSHIP CODE

INTRODUCTION:

Trust negation is a web based application which is used for government related departments.
Government has various departments like RTO, PASSPORT, and Election Commission and so on. In
order to avoid the queue system in government office and maintain the overall details of public the
project called Trust Negotiation has developed.

Once the public has registered with these sites they need not fill the form for every department at
the time, in other words there is no work for manual registration. The registered form of the public is
maintained globally so that any department can take the personal details of the public. If the public
registered with site and apply for passport they need not apply in passport office just they can mention
their National Id.

The public get their National Id once they registered with this site. By using this National ID
they can visit any government office and easily finish their work. This consumes the time for the public
and government Employee. Suppose if the data given by Public is insuffient he /she has to approach the
concerned government department.

EXISTING SYSTEM:

Already in this type of applying for online application we does not use the privacy fact ,It can be
viewed by everyone and it can be also editable, to achieve privacy we have to maintain the customers
database and entry securely and privacy is the important fact which has to be focused . So here we use
three tier architecture for registering the details in a secure way.

PROPOSED SYSTEM:
In this project we generally deal with the trust negotiation, we obtain the trust negotiation using
an ontology based approach, we develop the project by using online pan card application and online
license application to get the trust negotiation, the project mainly explains about the privacy of a
customer who submits their document online. They no need to type their all personal details they give
only their universal username and password its enough, after giving that all their personal details will
come from the universal database.

4
CITIZENSHIP CODE

5
CITIZENSHIP CODE

SYSTEM ANALYSIS:

MANAGING THE DATA

The fundamental building blocks to restaurant details maximization begin with sufficient,
reliable and accessible data. Full air waybill capture is a good starting point. The way bill history should
be stored in an accessible format in a database that can be updated daily.

The real challenge is not just to capture the complete life cycle of a shipment from original
booking through to invoicing, but to do so in a dynamic and timely way. With new developments in data
handling and communications, it is now possible to build a data warehouse that receives seamless, real
time updates from reservation systems and with minimal changes to existing systems.

Unconstrained Demand

Shipment dimensions cannot be given accurately at the time the booking request is made.
Often the actual dimensions received at tender do not anyway become part of any permanent record.
Since flights will reach their volume limitations before they hit weight limits on some sectors, some
heuristic calculation, such as a function method, is needed to forecast likely volumes.

The first step is to use historic data to gauge the total market demand regardless of the date’s
available capacity. This unconstrained demand is set for each product type by origin and destination
(O&D), day of week, time of day.

Most customers, unlike passengers, are more concerned with speed and reliability than with
delivering. That gives the restaurant carrier an opportunity to route shipments away from congested
bottlenecks and give a better spread of managements across the network.

For example, a booking request comes through the reservation centre to ship between a hub
restaurant and major destination. The route is consistently oversold, so the bid rate is high. The router
will evaluate alternative feasible routes which meet both the shipper’s requirements and the carrier’s
business rules.

Removing the Politics

Effectively, the restaurant management optimization system will allow decisions to be taken that
make optimal use of another, then the choice will not be made. There will be times when the users

6
CITIZENSHIP CODE

override the system’s decisions, but overall it provides the basis for objective network-wide decision-
making, taking away the guesswork and the politics.

Tools

You can use SQL as back-end database and ASP.NET / to develop the project.

SYSTEM REQUIREMENT

Hardware Specification:
Processor Type : Pentium -IV

Speed : 2.4 GHZ

RAM : 512 MB RAM

Hard Disk : 20 GB HD

Software Specification:
Operating System : Win2000/XP

Programming Package : Visual Studio, .Net 2.0

Front End : Asp.Net with C#.

Back End : MS SQL Server2000.

7
CITIZENSHIP CODE

UML Diagrams:
Actor:
A coherent set of roles that users of use cases play when interacting with the use `cases.

Use case:

A description of sequence of actions, including variants, that a system performs that yields an
observable result of value of an actor.

UML stands for Unified Modelling Language. UML is a language for specifying, visualizing and
documenting the system. This is the step while developing any product after analysis. The goal from this
is to produce a model of the entities involved in the project which later need to be built. The
representation of the entities that are to be used in the product being developed need to be designed.

There are various kinds of methods in software design:

They are as follows:

 Use case Diagram


 Sequence Diagram
 Collaboration Diagram
 Activity Diagram
 State chat Diagram

USECASE DIAGRAMS:

8
CITIZENSHIP CODE

Use case diagrams model behaviour within a system and helps the developers understand of what
the user require. The stick man represents what’s called an actor.

Use case diagram can be useful for getting an overall view of the system and clarifying that can
do and more importantly what they can’t do.

Use case diagram consists of use cases and customer and shows the interaction between the use
case and customer.

1. The purpose is to show the interactions between the use case and actor.
2. To represent the system requirements from user’s perspective.
3. An actor could be the end-user of the system or an external system.

A Use case is a description of set of sequence of actions. Graphically it is rendered as an ellipse


with solid line including only its name. Use case diagram is a behavioral diagram that shows a set of
use cases and customer and their relationship. It is an association between the use cases and customer.
An actor represents a real-world object.
EMPLOYEE DETAILS:

START

ADD EMP DETAIL

ADD RECORD

SALARY

SAVE RECORD

REPORT VIEW

EMPLOYE
END
ADMIN

CONTACT US DETAILS:

9
CITIZENSHIP CODE

START

ADD NAME

MAIL ID

SAVE RECORD
ADMIN
END CUSTOMER

SEQUENCE DIAGRAM:

Sequence diagram and collaboration diagram are called INTERACTION DIAGRAMS. An


interaction diagram shows an interaction, consisting of set of objects and their relationship including the
messages that may be dispatched among them.

A sequence diagram is an introduction that empathizes the time ordering of messages.


Graphically a sequence diagram is a table that shows objects arranged along the X-axis and messages
ordered in increasing time along the Y-axis.

RECORD INST EMP DET DAILY RPT CONTUCT US ADMIN

10
CITIZENSHIP CODE

COLLABORATION DIAGRAM:

A collaboration diagram is an introduction diagram that emphasizes the structural organization of


the objects that send and receive messages. Graphically a collaboration diagram is a collection of
vertices and arcs.

ADMIN EMPLOYEE DETAILS

MASTER SUPLIER

CUSTOMER DAILY REPORTS

11
CITIZENSHIP CODE

CLASS DIAGRAM:

Class is nothing but a structure that contains both variables and methods. The Class Diagram
shows a set of classes, interfaces, and collaborations and their relating ships. There is most common
diagram in modeling the object oriented systems and are used to give the static view of a system. It
shows the dependency between the classes that can be used in our system.
The interactions between the modules or classes of our projects are shown below. Each block
contains Class Name, Variables and Methods.

CLASS:
A description of set of objects that share the same attributes, operations, relationships, and
semantics

12
CITIZENSHIP CODE

State Chart Diagram

Sales

1st Qtr
2nd Qtr
3rd Qtr
4th Qtr

DATA FLOW DIAGRAMS

The DFD takes an input-process-output view of a system i.e. data objects flow into the software,
are transformed by processing elements, and resultant data objects flow out of the software.

Data objects represented by labelled arrows and transformation are represented by circles also
called as bubbles. DFD is presented in a hierarchical fashion i.e. the first data flow model represents the
system as a whole. Subsequent DFD refine the context diagram (level 0 DFD), providing increasing
details with each subsequent level.

The DFD enables the software engineer to develop models of the information domain &
functional domain at the same time. As the DFD is refined into greater levels of details, the analyst
performs an implicit functional decomposition of the system. At the same time, the DFD refinement
13
CITIZENSHIP CODE

results in a corresponding refinement of the data as it moves through the process that embody the
applications.

A context-level DFD for the system the primary external entities produce information for use by
the system and consume information generated by the system. The labeled arrow represents data objects
or object hierarchy.

RULES FOR DFD:

 Fix the scope of the system by means of context diagrams.


 Organize the DFD so that the main sequence of the actions
 Reads left to right and top to bottom.
 Identify all inputs and outputs.
 Identify and label each process internal to the system with Rounded circles.
 A process is required for all the data transformation and Transfers. Therefore, never connect a data
store to a data Source or the destinations or another data store with just a Data flow arrow.
 Do not indicate hardware and ignore control information.
 Make sure the names of the processes accurately convey everything the process is done.
 There must not be unnamed process.
 Indicate external sources and destinations of the data, with Squares.
 Number each occurrence of repeated external entities.
 Identify all data flows for each process step, except simple Record retrievals.
 Label data flow on each arrow.
 Use details flow on each arrow.

14
CITIZENSHIP CODE

Data Flow Diagram For National Registration Module:

Citizen Admin Login

National Authenticator only


Registration

Data Flow Diagram For Driving License Module:

Admin Login

Unauthenticated
User
Cross checking of
user’s details in master
database

Collected User information To be National


+ Register
Additional information

Print License

15
CITIZENSHIP CODE

Data Flow Diagram For PAN Card Registration Module:

Admin Login

Unauthenticated
User
Cross checking of
user’s details in master
database

Collected User information To be National


+ Register
Additional information

Print PAN Card

Data Flow Diagram For VoterId Registration Module:

Admin Login

Unauthenticated
User
Cross checking of
user’s details in master
database

Collected User information To be National


+ Register
Additional information

Print VoterId

16
CITIZENSHIP CODE

17
CITIZENSHIP CODE

E-R Diagrams:

The Entity-Relationship (ER) model was originally proposed by Peter in 1976 [Chen76] as a
way to unify the network and relational database views. Simply stated the ER model is a conceptual data
model that views the real world as entities and relationships. A basic component of the model is the
Entity-Relationship diagram which is used to visually represents data objects. Since Chen wrote his
paper the model has been extended and today it is commonly used for database design For the database
designer, the utility of the ER model is:

 it maps well to the relational model. The constructs used in the ER model can easily be
transformed into relational tables.
 it is simple and easy to understand with a minimum of training. Therefore, the model can be
used by the database designer to communicate the design to the end user.
 In addition, the model can be used as a design plan by the database developer to implement a
data model in a specific database management software.

Connectivity and Cardinality

The basic types of connectivity for relations are: one-to-one, one-to-many, and many-to-many.
A one-to-one (1:1) relationship is when at most one instance of a entity A is associated with one instance
of entity B. For example, "employees in the company are each assigned their own office. For each
employee there exists a unique office and for each office there exists a unique employee.

A one-to-many (1:N) relationships is when for one instance of entity A, there are zero, one, or
many instances of entity B, but for one instance of entity B, there is only one instance of entity A. An
example of a 1:N relationships is a department has many employees each employee is assigned to one
department

A many-to-many (M:N) relationship, sometimes called non-specific, is when for one instance
of entityA, there are zero, one, or many instances of entity B and for one instance of entity B
there are zero, one, or many instances of entity A. The connectivity of a relationship describes
the mapping of associated

18
CITIZENSHIP CODE

ER Notation

There is no standard for representing data objects in ER diagrams. Each modeling methodology
uses its own notation. The original notation used by Chen is widely used in academics texts and journals
but rarely seen in either CASE tools or publications by non-academics. Today, there are a number of
notations used, among the more common are Bachman, crow's foot, and IDEFIX.

All notational styles represent entities as rectangular boxes and relationships as lines connecting
boxes. Each style uses a special set of symbols to represent the cardinality of a connection. The notation
used in this document is from Martin. The symbols used for the basic ER constructs are:

 Entities are represented by labelled rectangles. The label is the name of the entity. Entity names
should be singular nouns.
 Relationships are represented by a solid line connecting two entities. The name of the
relationship is written above the line. Relationship names should be verbs
 Attributes, when included, are listed inside the entity rectangle. Attributes which are identifiers
are underlined. Attribute names should be singular nouns.
 Cardinality of many is represented by a line ending in a crow's foot. If the crow's foot is
omitted, the cardinality is one.
 Existence is represented by placing a circle or a perpendicular bar on the line. Mandatory
existence is shown by the bar (looks like a 1) next to the entity for an instance is required.
Optional existence is shown by placing a circle next to the entity that is optional

19
CITIZENSHIP CODE

20
CITIZENSHIP CODE

Modules and its Description:

Modules:

 National Register Module


 Pan card Register Module
 Voter Id Register Module
 License Register Module

 Web Service Module


1. Application Layer
2. Business Layer
3. Data Layer

 Admin Module

NATIONAL REGISTRATION MODULES:

As the name itself defines this is a registration module for public. The public has to give
sufficient data for doing registration. This module contains sub module like PAN CARD Registration,
Voter ID Registration and License Registration.
Data will change from one sub module to another. Validation is done for the purpose that user
should not miss any of the field in the particular registration form. Once the public has registered, he/she
get a national ID which is unique. Using this national ID the public can claim one among or all above
mentioned ID Proof (s).

21
CITIZENSHIP CODE

WEB SERVICE MODULES:

Web Services

Using Web services, your application can publish its function or message to the rest of the world.

Web services use XML to code and to decode data, and SOAP to transport it (using open
protocols).

With Web services, your accounting department's Win 2k server's billing system can connect
with your IT supplier's UNIX server.

Web Services have Two Types of Uses

Reusable application components.

There are things applications need very often. So why make these over and over again?

Web services can offer applications components like currency conversion, weather reports, or
even language translation as services.

Ideally, there will be only one type of each application component, and anyone can use it in their
application.

Connect existing software.

Web services help to solve the interoperability problem by giving different applications a way to
link their data.

With Web services you can exchange data between different applications and different
platforms.

Web Services have three basic platform elements: SOAP, WSDL and UDDI.

SOAP is a simple XML-based protocol to let applications exchange information over HTTP.

SOAP is a protocol for accessing a Web Service.

22
CITIZENSHIP CODE

SOAP stands for Simple Object Access Protocol

SOAP is a communication protocol

SOAP is a format for sending messages

SOAP is designed to communicate via Internet

SOAP is platform independent

SOAP is language independent

SOAP is based on XML

SOAP is simple and extensible

SOAP allows you to get around firewalls

SOAP is a W3C standard

WSDL is an XML-based language for describing Web services and how to access them.

 WSDL stands for Web Services Description Language


 WSDL is based on XML
 WSDL is used to describe Web services
 WSDL is also used to locate Web services
 WSDL is a W3C standard

UDDI is a directory service where businesses can register and search for Web services.

 UDDI stands for Universal Description, Discovery and Integration


 UDDI is a directory for storing information about web services
 UDDI is a directory of web service interfaces described by WSDL
 UDDI communicates via SOAP
23
CITIZENSHIP CODE

 UDDI is built into the Microsoft .NET platform.

Layer

A layer is a reusable portion of code that performs a specific function. In the .NET environment,
a layer is usually setup as a project that represents this specific function. This specific layer is in charge
of working with other layers to perform some specific goal. In an application where the presentation
layer needs to extract information from a backend database, the presentation would utilize a series of
layers to retrieve the data, rather than having the database calls embedded directly within itself. Let’s
briefly look at the latter situation first.

Two-Tier Architecture

When the .NET 2.0 framework became available to the world, there were some neat features that
allowed the developer to connect the framework’s GUI controls directly to the database. This approach
is very handy when rapidly developing applications. However, it’s not always favorable to embed all of
the business logic and data access code directly in the web site, for several reasons:

 Putting all of the code in the web site (business logic and data access) can make the
application harder to maintain and understand.
 Reusing database queries in the presentation layer often isn’t done, because of the typical
data source control setup in the ASP.NET framework.
 Relying on the data source controls can make debugging more difficult, often due to vague
error messages.

So in looking for an alternative, we can separate the data access code and business logic into
separate “layers”, which we’ll discuss next.

The Data Layer

The key component to most applications is the data. The data has to be served to the presentation
layer somehow. The data layer is a separate component (often setup as a separate single or group of
projects in a .NET solution), whose sole purpose is to serve up the data from the database and return it to
the caller. Through this approach, data can be logically reused, meaning that a portion of an application
24
CITIZENSHIP CODE

reusing the same query can make a call to one data layer method, instead of embedding the query
multiple times. This is generally more maintainable.

But the question is how is the data returned? Multiple frameworks employ different techniques,

and below is a summary:

 ADO.NET – Built into the .NET framework, ADO.NET contains a mechanism to query data
out of the database and return it to the caller in a connected or disconnected fashion. This is
the most common approach to working with data, because it’s already readily available Table
Adapters/Strongly-Typed Datasets – Strongly-typed datasets and table adapters provide a
similar means to querying the data through ADO.NET, but add strong-typing features,
meaning custom objects are generated for you to work with.
 Enterprise Library – Enterprise library Data Access Application Block provides a flexible
way to connect to databases of multiple types, without having to know anything about that
database, through an abstract approach
 LINQ-to-SQL – LINQ to SQL is an ORM tool that uses a Data Context object as the central
point to query data from the database. Auto-Generated Code – Tools like Code Smith Studio
automatically generate the code for you based upon a database schema. Simply writing a
script to output the code you want to use and the backend is generated in a short amount of
time.

Most (if not all) options above take advantage of the CRUD (create, read, update, or delete)
operations that databases support, so all of that is available as shown above. There are plenty of
resources online to help you get started.

Business Layer

Though a web site could talk to the data access layer directly, it usually goes through another
layer called the business layer. The business layer is vital in that it validates the input conditions before
calling a method from the data layer.

This ensures the data input is correct before proceeding, and can often ensure that the outputs are
correct as well. This validation of input is called business rules, meaning the rules that the business layer
uses to make “judgments” about the data.
25
CITIZENSHIP CODE

However, business rules don’t only apply to data validation; these rules apply to any calculations
or any other action that takes place in the business layer. Normally, it’s best to put as much logic as
possible in the business layer, which makes this logic reusable across applications.

One of the best reasons for reusing logic is that applications that start off small usually grow in
functionality. For instance, a company begins to develop a web site, and as they realize their business
needs, they later decide to add a smart client application and windows service to supplement the web
site. The business layer helps move logic to a central layer for “maximum reusability.”

Presentation Layer

The ASP.NET web site or windows forms application (the UI for the project) is called the
presentation layer. The presentation layer is the most important layer simply because it’s the one that
everyone sees and uses. Even with a well structured business and data layer, if the presentation layer is
designed poorly, this gives the users a poor view of the system.

It’s best to remove as much business logic out of the UI and into the business layer. This usually
involves more code, but in my mind, the excess time (which ranges from minimal to moderate,
depending on the size of the application) pays off in the end.

However, a well-architected system leaves another question: how do you display it in an


ASP.NET or windows application? This can be more of a problem in ASP.NET, as the controls are more
limited to the type of inputs they can receive. If you use certain architectures, like passing datasets from
the data to the presentation layer, this isn’t as much of a challenge; however, the challenge can come
with business objects that support drill-through business object references.

ADMIN MODULE:

The admin module plays a major role in the application. The Admin module is used to control all
the administrative tasks of the administrator. The administrator takes care of entering all the essential
information in site so that it is accessed world wide with a very fast accessing time and in a well defined
manner. All the essential information is composed by integrating the information in a hierarchical

26
CITIZENSHIP CODE

manner. Each Government wing admin will do all the enhancements works like adding Sub modules,
Editing and Updating the Public Details and so on.

Hardware interface:

Hardware includes any physical device that is connected to the computer and it is controlled by
the computer’s microprocessor. This includes equipment that was connected to the computer when it
was manufactured, as well as peripheral equipment that added later. Some examples of devices are
modems, disk drives, printers and keyboards etc. Hardware interfaces are the plugs, sockets, wires, and
the electrical pulses traveling through them in a particular pattern. Every interface implies a function. At
the hardware level, electronic signals activate functions, data’s are read, written, transmitted, serviced,
analyzed for error etc.

About Front End of the Software:


INTRODUCTION ABOUT .NET FRAMEWORK:
ABOUT C#.NET

Microsoft .NET is one of the latest and new technologies introduced by Microsoft Corporation.
Nowadays we use to connect to the internet using a computer and remote computer responses via a web
page and a collection of web pages are called as Web Sites. The Concept in .NET is that these websites
can integrate with other sites and services using Standard Protocols like HTTP. Microsoft .NET
Platform comprises of four core components such as.NET Building Block Services such as file storage,
calendar called Passport. NET.NET Device Software which will run on latest Internet Devices like
Mobile Phones .NET user experience such as integrating this technology to user created documents
(integrates with XML). For example if you code XML via a .NET Language like C#, it will
automatically create XML document NET Infrastructure which includes .NET Framework (Common
Language Runtime & .NET Framework Class Libraries) Microsoft Visual Studio.NET such as Visual
Basic.NET ,Visual C++.NET etc .NET Enterprise Servers and Microsoft Windows. NET
We can build robust, scalable, distributed applications with the help of .NET
and the part that helps us to develop these applications is called the .NET Framework.

27
CITIZENSHIP CODE

The .NET Framework contains Common Language Runtime (CLR) and the .NET Framework
class libraries also called as Base Class Libraries. All the .NET languages (like C-sharp,
VisualBasic.NET and Visual C++. NET etc) have the .NET Framework class libraries built into them.
The .NET class Libraries also supports File I/O, database operations, XML (Extensible Markup
Language) and SOAP (Simple Object Access Protocol). For example you can develop XML Pages by
using C-sharp language. When someone talks about .NET development and then you should understand
that they are talking about .NET Framework. It includes a Runtime environment and a set of Class
Libraries which is being used by a new language called C-sharp abbreviated as C# (more or less similar
to C/C++/Java family of languages) and all other .NET Languages. Simply speaking C-sharp is a new
language for developing custom solutions for Microsoft’s .NET Platform. The runtime which we
discussed just now is also used by VisualStudio.NET. Visual Studio.NET provides us with a visual
environment to design and develop .NET Applications. Every language in VisualStudio.NET uses this
runtime to execute its applications. Moreover these languages compile its source code into an
intermediate language upon compilation. Hence you can very well use a module written using C-sharp
in a Visual Basic Application. For example you can design a user interface with Visual Basic.NET and
write a DLL function using C-sharp.

COMMON LANGUAGE RUNTIME

28
CITIZENSHIP CODE

Common Language Runtime also called CLR Provides a universal execution engine for
developer’s code. It generates SOAP when it makes remote procedure calls. CLR is independent and is
provided as part of the .NET Framework. The main features of CLR are as follows:
(1) Managed Code
(2) Automatic application installation
(3) Memory Management
(4) Automatic Garbage Collection
(5) Very high level of Security while executing

29
CITIZENSHIP CODE

.NET FRAMEWORK CLASS LIBRARIES

These class libraries works with any language under the common language runtime
environment. It includes Visual Studio.NET, C-Sharp. Therefore if you are familiar
with one .NET language then you can easily migrate to other .NET Languages.
The figure given below shows the .NET Framework hierarchy

The .NET Framework is an integral Windows component that supports building and running the
next generation of applications and XML Web services. It provides a highly productive, standards-
based, Multilanguage environment for integrating existing investments with next generation applications
and services, as well as the agility to solve the challenges of deployment and operation of Internet-scale
applications.
The .NET Framework consists of three main parts: the common language runtime, a hierarchical
set of unified class libraries, and a componentized version of ASP called ASP.NET. 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.

The .NET Framework has two main components: The common language runtime and the .NET
Framework class library

30
CITIZENSHIP CODE

.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.
For example, you can use the .NET Framework to develop the following types of applications
and services:
 Console applications.
 Windows GUI applications (Windows Forms).
 ASP.NET applications.
 XML Web services.
 Windows services.
For example, the Windows Forms classes are a comprehensive set of reusable types that vastly
simplify Windows GUI development. If you write an ASP.NET Web Form application, you can use the
Web Forms classes.

ASSEMBLY:
An assembly is a collection of types and resources that are built to work together and form a logical unit
of functionality

MANIFEST:

Every assembly, whether static or dynamic, contains a collection of data that describes how the
elements in the assembly relate to each other. The assembly manifest contains this assembly metadata.
An assembly manifest contains all the metadata needed to specify the assembly's version requirements
and security identity, and all metadata needed to define the scope of the assembly and resolve references
to resources and classes. The assembly. Manifest can be stored in either a PE file (an .exe or .dll) with
Microsoft intermediate language (MSIL) code or in a standalone PE file that contains only assembly
manifest information.

31
CITIZENSHIP CODE

COMMON LANGUAGE SPECIFICATION (CLS):


It is a set of rules that a language compiler must adhere to in order to create .NET Applications
that run in the CLR. If you are going to create a compiler for .NET, you have to adhere to the rules
enumerated in the common language specification and this enables us to create a club of CLS compliant
languages. Each such compiler will have the following features
(a) Complete access to .NET Framework hierarchy
(b) High level of interoperability with other compliant languages like Visual Basic. NET

COMMON LANGUAGE RUNTIME HOST:


An unmanaged application that uses a set of APIs, called the hosting interfaces, to integrate
managed code into the application. Common language runtime hosts often require a high degree of
customization over the runtime that is loaded into the process. The hosting interfaces allow common
language runtime hosts to specify settings that configure the garbage collector, select the appropriate
build for their environment (server versus workstation), and so on. Common language runtime hosts
often support an extensibility model that allows the end user to dynamically add new pieces of
functionality, such as a new control or a user-written function. These extensions are typically isolated
from each other in the process using application domains and custom security settings. Examples of
common language runtime hosts include ASP.NET, Microsoft Internet Explorer, and a host to run
executables launched from the Windows Shell. See also: application domain, common language
runtime, managed code.
COMMON TYPE SYSTEM:
The specification that determines how the common language runtime defines, uses, and manages
types.

APPLICATION DOMAIN:
A boundary that the common language runtime establishes around objects created within the
same application scope (that is, anywhere along the sequence of object activations beginning with the
application entry point). Application domains help isolate objects created in one application from those
created in other applications so that run-time behavior is predictable. Multiple application domains can
exist in a single process.
.NET (dot-net) is the name Microsoft gives to its general vision of the future of computing, the
view being of a world in which many applications run in a distributed manner across the Internet. We
can identify a number of different motivations driving this vision.
32
CITIZENSHIP CODE

Firstly, distributed computing is rather like object oriented programming, in that it encourages
specialized code to be collected in one place, rather than copied redundantly in lots of places. There are
thus potential efficiency gains to be made in moving to the distributed model.
Secondly, by collecting specialized code in one place and opening up a generally accessible
interface to it, different types of machines (phones, handhelds, desktops, etc.) can all be supported with
the same code. Hence Microsoft's 'run-anywhere' aspiration.
Thirdly, by controlling real-time access to some of the distributed nodes (especially those
concerning authentication), companies like Microsoft can control more easily the running of its
applications. It moves applications further into the area of 'services provided' rather than 'objects owned'.
Interestingly, in taking on the .NET vision, Microsoft seems to have given up some of its
proprietary tendencies (whereby all the technology it touched was warped towards its Windows
operating system). Because it sees its future as providing software services in distributed applications,
the .NET framework has been written so that applications on other platforms will be able to access these
services. For example, .NET has been built upon open standard technologies like XML and SOAP.
At the development end of the .NET vision is the .NET Framework. This contains the Common
Language Runtime, the .NET Framework Classes, and higher-level features like ASP.NET (the next
generation of Active Server Pages technologies) and Win Forms (for developing desktop applications).
The Common Language Runtime (CLR) manages the execution of code compiled for the .NET
platform. The CLR has two interesting features. Firstly, its specification has been opened up so that it
can be ported to non-Windows platforms. Secondly, any number of different languages can be used to
manipulate the .NET framework classes, and the CLR will support them. This has led one commentator
to claim that under .NET the language one uses is a 'lifestyle choice'.
Not all of the supported languages fit entirely neatly into the .NET framework, however (in some
cases the fit has been somewhat Procrustean). But the one language that is guaranteed to fit in perfectly
is C#. This new language, a successor to C++, has been released in conjunction with the .NET
framework, and is likely to be the language. The features of .Net is listed below,

 Better language support


 Programmable controls
 Event-driven programming
 XML-based components
 User authentication, with accounts and roles
 Higher scalability
33
CITIZENSHIP CODE

 Increased performance - Compiled code


 Easier configuration and deployment
 Not fully ASP compatible
 Language Support
 ASP .NET uses the new ADO .NET.
 ASP .NET supports full Visual Basic, not VBScript.
 ASP .NET supports C# (C sharp) and C++.
 ASP .NET supports JScript as before.

LANGUAGE SUPPORT
 ASP .NET uses the new ADO .NET.
 ASP .NET supports full Visual Basic, not VBScript.
 ASP .NET supports C# (C sharp) and C++.
 ASP .NET supports JScript as before.
 ASP .NET Controls
 ASP .NET contains a large set of HTML controls. Almost all HTML elements on a page
can be defined as ASP .NET control objects that can be controlled by scripts.
 ASP .NET also contains a new set of object oriented input controls, like programmable
list boxes and validation controls.A new data grid control supports sorting, data paging,
and everything you expect from a dataset control

ASP .NET CONTROLS:


ASP .NET contains a large set of HTML controls. Almost all HTML elements on a page can be
defined as ASP .NET control objects that can be controlled by scripts. ASP .NET also contains a new set
of object oriented input controls, like programmable list boxes and validation controls. A new data grid
control supports sorting, data paging, and everything you expect from a dataset control.

EVENT AWARE CONTROLS:


All ASP .NET objects on a Web page can expose events that can be processed by ASP .NET
code. Load, Click and Change events handled by code makes coding much simpler and much better
organized.

34
CITIZENSHIP CODE

ASP .NET COMPONENTS:


ASP .NET components are heavily based on XML. Like the new AD Rotator, that uses XML to
store advertisement information and configuration.

USER AUTHENTICATION:
ASP .NET supports forms-based user authentication, including cookie management and
automatic redirecting of unauthorized logins.(You can still do your custom login page and custom user
checking).

USER ACCOUNTS AND ROLES:


ASP .NET allows for user accounts and roles, to give each user (with a given role) access to
different server code and executables.

HIGH SCALABILITY:
Much has been done with ASP .NET to provide greater scalability. Server to server
communication has been greatly enhanced, making it possible to scale an application over several
servers. One example of this is the ability to run XML parsers, XSL transformations and even resource
hungry session objects on other servers.

COMPILED CODE:
The first request for an ASP .NET page on the server will compile the ASP .NET code and keep
a cached copy in memory. The result of this is greatly increased performance.

EASY CONFIGURATION:
Configuration of ASP .NET is done with plain text files. Configuration files can be uploaded or
changed while the application is running. No need to restart the server. No more meta base or registry
puzzle.

EASY DEPLOYMENT:
No more server restart to deploy or replace compiled code. ASP .NET simply redirects all new
requests to the new code.

35
CITIZENSHIP CODE

COMPATIBILITY:
ASP .NET is not fully compatible with earlier versions of ASP, so most of the old ASP code will
need some changes to run under ASP .NET.To overcomes this problem; ASP .NET uses a new file
extension ".aspx". This will make ASP .NET applications able to run side by side with standard ASP
applications on the same server.

HTML SERVER CONTROLS:


HTML elements in ASP.NET files are, by default, treated as text. To make these elements
programmable, add a runat="server" attribute to the HTML element. This attribute indicates that the
element should be treated as a server control.

Note: All HTML server controls must be within a <form> tag with the runat="server" attribute!
Note: ASP.NET requires that all HTML elements must be properly closed and properly nested.

HTML Server Control Description


HtmlAnchor Controls an <a> HTML element
HtmlButton Controls a <button> HTML element
HtmlForm Controls a <form> HTML element
HtmlGeneric Controls other HTML element not specified by a specific HTML
server control, like <body>, <div>, <span>, etc.
HtmlImage Controls an <image> HTML element
HtmlInputButton Controls <input type="button">, <input type="submit">, and <input
type="reset"> HTML elements
HtmlInputCheckBox Controls an <input type="checkbox"> HTML element
HtmlInputFile Controls an <input type="file"> HTML element
HtmlInputHidden Controls an <input type="hidden"> HTML element
HtmlInputImage Controls an <input type="image"> HTML element
HtmlInputRadioButto Controls an <input type="radio"> HTML element
n
HtmlInputText Controls <input type="text"> and <input type="password"> HTML

36
CITIZENSHIP CODE

elements
HtmlSelect Controls a <select> HTML element
HtmlTable Controls a <table> HTML element
HtmlTableCell Controls <td>and <th> HTML elements
HtmlTableRow Controls a <tr> HTML element
HtmlTextArea Controls a <textarea> HTML element

WEB SERVER CONTROLS:

Like HTML server controls, Web server controls are also created on the server and they require a
runat="server" attribute to work. However, Web server controls do not necessarily map to any existing
HTML elements and they may represent more complex elements.
The syntax for creating a Web server control is:
<asp:control_name id="some_id" runat="server" />

Web Server
Description
Control
AdRotator Displays a sequence of images
Button Displays a push button
Calendar Displays a calendar
CheckBox Displays a check box
CheckBoxList Creates a multi-selection check box group
DataGrid Displays fields of a data source in a grid
DataList Displays items from a data source by using templates
DropDownList Creates a drop-down list
HyperLink Creates a hyperlink
Image Displays an image
ImageButton Displays a clickable image
Label Displays static content which is programmable (lets you apply styles to its
content)
LinkButton Creates a hyperlink button
37
CITIZENSHIP CODE

ListBox Creates a single- or multi-selection drop-down list


Literal Displays static content which is programmable (does not let you apply styles
to its content)
Panel Provides a container for other controls
PlaceHolder Reserves space for controls added by code
RadioButton Creates a radio button
RadioButtonList Creates a group of radio buttons
Repeater Displays a repeated list of items bound to the control
Table Creates a table
TableCell Creates a table cell
TableRow Creates a table row
TextBox Creates a text box
Xml Displays an XML file or the results of an XSL transform

VALIDATION SERVER CONTROLS:


A Validation server control is used to validate the data of an input control. If the data does not
pass validation, it will display an error message to the user. The syntax for creating a Validation server
control is:

<asp:control_na
me id="some_id"
Description
runat="server" />
Validation Server Control
CompareValidator Compares the value of one input control to the value of
another input control or to a fixed value
CustomValidator Allows you to write a method to handle the validation of
the value entered
RangeValidator Checks that the user enters a value that falls between two
values
RegularExpressionValidator Ensures that the value of an input control matches a
specified pattern

38
CITIZENSHIP CODE

RequiredFieldValidator Makes an input control a required field


ValidationSummary Displays a report of all validation errors occurred in a Web
page

ADO .NET:
Most applications need data access at one point of time making it a crucial component when
working with applications. Data access is making the application interact with a database, where all the
data is stored. Different applications have different requirements for database access. VB .NET uses
ADO .NET (Active X Data Object) as it's data access and manipulation protocol which also enables us
to work with data on the Internet. Let's take a look why ADO .NET came into picture replacing ADO.
Evolution of ADO.NET
The first data access model, DAO (data access model) was created for local databases with the
built-in Jet engine which had performance and functionality issues. Next RDO (Remote Data Object)
and ADO (Active Data Object) which were designed for Client Server architectures but soon ADO took
over RDO. ADO was a good architecture but as the language changes so is the technology. With ADO,
all the data is contained in a record set object which had problems when implemented on the
network and penetrating firewalls. ADO was a connected data access, which means that when a
connection to the database is established the connection remains open until the application is closed.
Leaving the connection open for the lifetime of the application raises concerns about database security
and network traffic. Also, as databases are becoming increasingly important and as they are serving
more people, a connected data access model makes us think about its productivity. For example, an
application with connected data access may do well when connected to two clients, the same may do
poorly when connected to 10 and might be unusable when connected to 100 or more. Also, open
database connections use system resources to a maximum extent making the system performance less
effective.

39
CITIZENSHIP CODE

WHY ADO.NET?
To cope up with some of the problems mentioned above, ADO .NET came into existence.
ADO .NET addresses the above mentioned problems by maintaining a disconnected database access
model which means, when an application interacts with the database, the connection is opened to serve
the request of the application and is closed as soon as the request is completed. Likewise, if a database is
updated, the connection is opened long enough to complete the Update operation and is closed. By
keeping connections open for only a minimum period of time, ADO .NET conserves system resources
and provides maximum security for databases and also has less impact on system performance. Also,
ADO .NET when interacting with the database uses XML and converts all the data into XML
format for database related operations making them more efficient.

THE ADO.NET DATA ARCHITECTURE:


Data Access in ADO.NET relies on two components: DataSet and Data Provider.

DATASET :

The dataset is a disconnected, in-memory representation of data. It can be considered as a local


copy of the relevant portions of the database. The Dataset is persisted in memory and the data in it can
be manipulated and updated independent of the database. When the use of this DataSet is finished,
changes can be made back to the central database for updating. The data in Dataset can be loaded from
any valid data source like Microsoft SQL server database, an Oracle database or from a Microsoft
Access database.

40
CITIZENSHIP CODE

DATA PROVIDER:
The Data Provider is responsible for providing and maintaining the connection to the database. A
Data Provider is a set of related components that work together to provide data in an efficient and
performance driven manner. The .NET Framework currently comes with two Data Providers: the
SQL Data Provider which is designed only to work with Microsoft's SQL Server 7.0 or later and the
OLEDB Data Provider which allows us to connect to other types of databases like Access and Oracle.
Each Data Provider consists of the following component classes:
The Connection object which provides a connection to the database
The Command object which is used to execute a command The Data Reader object which provides a
forward-only, read only, connected record set The Data Adapter object which populates a disconnected
Data Set with data and performs update .Data access with ADO.NET can be summarized as follows:
A connection object establishes the connection for the application with the database. The
command object provides direct execution of the command to the database. If the command returns
more than a single value, the command object returns a Data Reader to provide the data. Alternatively,
the Data Adapter can be used to fill the Dataset object. The database can be updated using the command
object or the Data Adapter.

41
CITIZENSHIP CODE

THE CONNECTION OBJECT:

The Connection object creates the connection to the database. Microsoft Visual Studio .NET
provides two types of Connection classes: the SqlConnection object, which is designed specifically to
connect to Microsoft SQL Server 7.0 or later, and the OleDbConnection object, which can provide
connections to a wide range of database types like Microsoft Access and Oracle. The Connection object
contains all of the information required to open a connection to the database.

THE COMMAND OBJECT:

The Command object is represented by two corresponding classes: SqlCommand and


OleDbCommand. Command objects are used to execute commands to a database across a data
connection. The Command objects can be used to execute stored procedures on the database, SQL
commands, or return complete tables directly. Command objects provide three methods that are used to
execute commands on the database.

EXECUTENONQUERY:

Executes commands that have no return values such as INSERT, UPDATE or DELETE.

EXECUTE SCALAR:

Returns a Single Value from a Database Query

EXECUTEREADER:

Returns a Result Set By Way of a Data reader Object

42
CITIZENSHIP CODE

THE DATA READER OBJECT:

The Data Reader object provides a forward-only, read-only, connected stream recordset from a
database. Unlike other components of the Data Provider, DataReader objects cannot be directly
instantiated. Rather, the DataReader is returned as the result of the Command object's ExecuteReader
method. The SqlCommand.ExecuteReader method returns a SqlDataReader object, and the
OleDbCommand.ExecuteReader method returns an OleDbDataReader object. The DataReader can
provide rows of data directly to application logic when you do not need to keep the data cached in
memory. Because only one row is in memory at a time, the DataReader provides the lowest overhead in
terms of system performance but requires the exclusive use of an open Connection object for the lifetime
of the DataReader.

THE DATA ADAPTER OBJECT:


The Data Adapter is the class at the core of ADO .NET's disconnected data access. It is
essentially the middleman facilitating all communication between the database and a Data Set. The Data
Adapter is used either to fill a Data Table or Data Set with data from the database with its Fill method.
After the memory-resident data has been manipulated, the Data Adapter can commit the changes to the
database by calling the Update method. The Data Adapter provides four properties that represent
database commands:
 Select Command
 Insert Command
 Delete Command
 Update Command
When the Update method is called, changes in the Data Set are copied back to the database and
the appropriate Insert Command, Delete Command, or Update Command is executed.

43
CITIZENSHIP CODE

History of the back end:

Access version 1.0 was released in November 1992.Microsoft specified the minimum operating
system for Version 2.0 as Microsoft Windows v3.0 with 4 MB of RAM. 6 MB RAM was recommended
along with a minimum of 8 MB of available hard disk space (14 MB hard disk space recommended).
The product was shipped on seven 1.44 MB diskettes. The manual shows a 1993 copyright date.
The software worked well with very large records sets but testing showed some circumstances
caused data corruption. For example, file sizes over 700 MB were problematic. (Note that most hard
disks were smaller than 700 MB at the time this was in wide use). The Getting Started manual warns
about a number of circumstances where obsolete device drivers or incorrect configurations can cause
data loss.
Access' initial codename was Cirrus. This was developed before Visual Basic and the forms
engine was called Ruby. Bill Gates saw the prototypes and decided that the Basic language component
should be co-developed as a separate expandable application. This project was called Thunder. The two
projects were developed separately as the underlying forms engines were incompatible with each other;
however, these were merged together again after VBA.

SQL INTRODUCTION:

SQL stands for Structured Query Language and is used to pull information from databases.SQL
offers many features making it a powerfully diverse language that also offers a secure way to work with
databases.

SQL (commonly expanded to Structured Query Language – is the most popular computer
language used to create, modify, retireve and manipulate data from relational database management
systems. The language has evolved beyond its original purpose to support object-relational database
management systems. It is an ANSI/ISO standard.

SQL alone can input, modify, and drop data from databases. In this tutorial we use command line
examples to show you the basics of what we are able to accomplish. With the use of web languages such
as

HTML and PHP, SQL becomes an even greater tool for building dynamic web pages.

44
CITIZENSHIP CODE

DATABASE:

A database is nothing more than an empty shell, like a vacant warehouse. It offers no real
functionality what so ever, other than holding a name. Tables are the next tier of our tree offering a wide
scope of functionality. If you follow our warehouse example, a SQL table would be the physical
shelving inside our vacant warehouse. Each SQL table is capable of housing 1024 columns(shelves).
Depending on the situation, your goods may require reorganization, reserving, or removal. SQL tables
can be manipulated in this same way or in any fashion the situation calls for.

SQL SERVER:

Microsoft's SQL Server is steadily on the rise in the commercial world gaining popularity
slowly. This platform has a GUI "Windows" type interface and is also rich with functionality. A free
trial version can be downloaded at the Microsoft web site, however it is only available to Windows
users.

SQL QUERIES:

Queries are the backbone of SQL. Query is a loose term that refers to a widely available set of
SQL commands called clauses. Each clause (command) performs some sort of function against the
database. For instance, the create clause creates tables and databases and the select clause selects rows
that have been inserted into your tables. We will dive deeper in detail as this tutorial continues but for
now let's take a look at some query structure.

VIEWS:

Views are nothing but saved SQL statements, and are sometimes referred as “Virtual Tables”.
Keep in mind that Views cannot store data (except for Indexed Views); rather they only refer to data
present in tables.

Let’s checkout the basic syntax for creating a view:

CREATE VIEW <View_Name>


45
CITIZENSHIP CODE

AS

<SELECT Statement>

GO

There are two important options that can be used when a view is created. They are
SCHEMABINDING and ENCRYPTION. We shall have a detailed look on both of these, shortly, but
first of all, let’s take a look of an example of a typical view creation statement without any options.

DATA STORAGE:

The main unit of data storage is a database, which is a collection of tables with typed columns.
SQL Server supports different data types, including primary types such as Integer, Float, Decimal, Char
(including character strings), Varchar (variable length character strings), binary (for unstructured blobs
of data), Text (for textual data) among others. It also allows user-defined composite types (UDTs) to be
defined and used. SQL Server also makes server statistics available as virtual tables and views (called
Dynamic Management Views or DMVs). A database can also contain other objects including views,
stored procedures, indexes and constraints, in addition to tables, along with a transaction log. A SQL
Server database can contain a maximum of 2 31 objects, and can span multiple OS-level files with a
maximum file size of 220 TB. The data in the database are stored in primary data files with an
extension .mdf. Secondary data files, identified with an .ndf extension, are used to store optional
metadata. Log files are identified with the .ldf extension.

Storage space allocated to a database is divided into sequentially numbered pages, each 8 KB in
size. A page is the basic unit of I/O for SQL Server operations. A page is marked with a 96-byte header
which stores metadata about the page including the page number, page type, free space on the page and
the ID of the object that owns it. Page type defines the data contained in the page - data stored in the
database, index, allocation map which holds information about how pages are allocated to tables and
indexes, change map which holds information about the changes made to other pages since last backup
or logging, or contain large data types such as image or text. While page is the basic unit of an I/O
operation, space is actually managed in terms of an extent which consists of 8 pages. A database object
can either span all 8 pages in an extent ("uniform extent") or share an extent with up to 7 more objects
("mixed extent").
46
CITIZENSHIP CODE

A row in a database table cannot span more than one page, so is limited to 8 KB in size.
However, if the data exceeds 8 KB and the row contains Varchar or Varbinary data, the data in those
columns are moved to a new page (or possible a sequence of pages, called Allocation unit) and replaced
with a pointer to the data.

For physical storage of a table, its rows are divided into a series of partitions (numbered 1 to n).
The partition size is user defined; by default all rows are in a single partition. A table is split into
multiple partitions in order to spread a database over a cluster. Rows in each partition are stored in either
B-tree or heap structure. If the table has an associated index to allow fast retrieval of rows, the rows are
stored in-order according to their index values, with a B-tree providing the index. The data is in the leaf
node of the leaves, and other nodes storing the index values for the leaf data reachable from the
respective nodes. If the index is non-clustered, the rows are not sorted according to the index keys. An
indexed view has the same storage structure as an indexed table. A table without an index is stored in an
unordered heap structure. Both heaps and B-trees can span multiple allocation units.

BUFFER MANAGEMENT:

SQL Server buffers pages in RAM to minimize disc I/O. Any 8 KB page can be buffered in-
memory, and the set of all pages currently buffered is called the buffer cache. The amount of memory
available to SQL Server decides how many pages will be cached in memory. The buffer cache is
managed by the Buffer Manager. Either reading from or writing to any page copies it to the buffer
cache. Subsequent reads or writes are redirected to the in-memory copy, rather than the on-disc version.

The page is updated on the disc by the Buffer Manager only if the in-memory cache has not been
referenced for some time. While writing pages back to disc, asynchronous I/O is used whereby the I/O
operation is done in a background thread so that other operations do not have to wait for the I/O
operation to complete. Each page is written along with its checksum when it is written. When reading
the page back, its checksum is computed again and matched with the stored version to ensure the page
has not been damaged or tampered with in the mean time.

LOGGING AND TRANSACTION:

SQL Server ensures that any change to the data is ACID-compliant, i.e., it uses transactions to
ensure that any operation either totally completes or is undone if fails, but never leave the database in an
intermediate state. Using transactions, a sequence of actions can be grouped together, with the guarantee
47
CITIZENSHIP CODE

that either all actions will succeed or none will. SQL Server implements transactions using a write-ahead
log. Each log entry is identified by an increasing Log Sequence Number (LSN) which ensure that no
event overwrites another. SQL Server ensures that the log will be written onto the disc before the actual
page is written back. This enables SQL Server to ensure integrity of the data, even if the system fails. If
both the log and the page were written before the failure, the entire data is on persistent storage and
integrity is ensured. If only the log was written (the page was either not written or not written
completely), then the actions can be read from the log and repeated to restore integrity. If the log wasn't
written, then also the integrity is maintained, even though the database is in a state when the transaction
as if never occurred. If it was only partially written, then the actions associated with the unfinished
transaction are discarded. Since the log was only partially written, the page is guaranteed to have not
been written, again ensuring data integrity. Removing the unfinished log entries effectively undoes the
transaction. SQL Server ensures consistency between the log and the data every time an instance is
restarted.

CONCURRENCY AND LOCKING:

SQL Server allows multiple clients to use the same database concurrently. As such, it needs to
control concurrent access to shared data, to ensure data integrity - when multiple clients update the same
data, or clients attempt to read data that is in the process of being changed by another client. SQL Server
provides two modes of concurrency control: pessimistic concurrency and optimistic concurrency. When
pessimistic concurrency control is being used, SQL Server controls concurrent access by using locks.
Locks can be either shared or exclusive. Exclusive lock grants the user exclusive access to the data - no
other user can access the data as long as the lock is held. Shared locks are used when some data is being
read - multiple users can read from data locked with a shared lock, but not acquire an exclusive lock.
The latter would have to wait for all shared locks to be released. Locks can be applied on different levels
of granularity - on entire tables, pages, or even on a per-row basis on tables. For indexes, it can either be
on the entire index or on index leaves.

The level of granularity to be used is defined on a per-database basis by the database


administrator. While a fine grained locking system allows more users to use the table or index
simultaneously, it requires more resources. So it does not automatically turn into higher performing
solution. SQL Server also includes two more lightweight mutual exclusion solutions - latches and spin
locks - which are less robust than locks but are less resource intensive.

48
CITIZENSHIP CODE

SQL Server uses them for DMVs and other resources that are usually not busy. SQL Server also
monitors all worker threads that acquire locks to ensure that they do not end up in deadlocks - in case
they do, SQL Server takes remedial measures, which in many cases is to kill one of the threads
entangled in a deadlock and rollback the transaction it started. To implement locking, SQL Server
contains the Lock Manager.

The Lock Manager maintains an in-memory table that manages the database objects and locks,
if any, on them along with other metadata about the lock. Access to any shared object is mediated by the
lock manager, which either grants access to the resource or blocks it.

SQL Server also provides the optimistic concurrency control mechanism, which is similar to the
multiversion concurrency control used in other databases. The mechanism allows a new version of a row
to be created whenever the row is updated, as opposed to overwriting the row, i.e., a row is additionally
identified by the ID of the transaction that created the version of the row. Both the old as well as the new
versions of the row are stored and maintained, though the old versions are moved out of the database
into a system database identified as Tempdb.

When a row is in the process of being updated, any other requests are not blocked (unlike
locking) but are executed on the older version of the row. If the other request is an update statement, it
will result in two different versions of the rows - both of them will be stored by the database, identified
by their respective transaction IDs.

DATA RETRIEVAL:

The main mode of retrieving data from an SQL Server database is querying for it. The query is
expressed using a variant of SQL called T-SQL, a dialect Microsoft SQL Server shares with Sybase
SQL Server due to its legacy. The query declaratively specifies what is to be retrieved. It is processed by
the query processor, which figures out the sequence of steps that will be necessary to retrieve the
requested data.

The sequence of actions necessary to execute a query is called a query plan. There might be
multiple ways to process the same query. For example, for a query that contains a join statement and a
select statement, executing join on both the tables and then executing select on the results would give the
49
CITIZENSHIP CODE

same result as selecting from each table and then executing the join, but result in different execution
plans. In such case, SQL Server chooses the plan that is supposed to yield the results in the shortest
possible time. This is called query optimization and is performed by the query processor itself.

SQL Server includes a cost-based query optimizer which tries to optimize on the cost, in terms of
the resources it will take to execute the query. Given a query, the query optimizer looks at the database
schema, the database statistics and the system load at that time. It then decides which sequence to access
the tables referred in the query, which sequence to execute the operations and what access method to be
used to access the tables. For example, if the table has an associated index, whether the index should be
used or not - if the index is on a column which is not unique for most of the columns (low "selectivity"),
it might not be worthwhile to use the index to access the data. Finally, it decides whether to execute the
query concurrently or not.

While a concurrent execution is more costly in terms of total processor time, because the
execution is actually split to different processors might mean it will execute faster. Once a query plan is
generated for a query, it is temporarily cached. For further invocations of the same query, the cached
plan is used. Unused plans are discarded after some time. SQL Server also allows stored procedures to
be defined. Stored procedures are parameterized T-SQL queries that are stored in the server itself (and
not issued by the client application as is the case with general queries). Stored procedures can accept
values sent by the client as input parameters, and send back results as output parameters.

They can also call other stored procedures, and can be selectively provided access to. Unlike
other queries, stored procedures have an associated name, which is used at runtime to resolve into the
actual queries. Also because the code need not be sent from the client every time (as it can be accessed
by name), it reduces network traffic and somewhat improves performance. Execution plans for stored
procedures are also cached as necessary.

SQL CLR:

Microsoft SQL Server 2005 includes a component named SQL CLR via which it integrates with
.NET Framework. Unlike most other applications that use .NET Framework, SQL Server itself hosts the
.NET Framework runtime, i.e., memory, threading and resource management requirements of .NET
Framework are satisfied by SQLOS itself, rather than the underlying Windows operating system.

50
CITIZENSHIP CODE

SQLOS provides deadlock detection and resolution services for .NET code as well. With SQL
CLR, stored procedures and triggers can be written in any managed .NET language, including C# and
VB.NET. Managed code can also be used to define UDTs which can be persisted in the database.
Managed code is compiled to .Net assemblies and after being verified for type safety, registered at the
database. After that, they can be invoked like any other procedure. However, only a subset of the Base
Class Library is available, when running code under SQL CLR. Most APIs relating to user interface
functionality are not available.

When writing code for SQL CLR, data stored in SQL Server databases can be accessed using the
ADO. NET APIs like any other managed application that accesses SQL Server data. However, doing
that creates a new database session, different from the one in which the code is executing. To avoid this,
SQL Server provides some enhancements to the ADO.NET provider that allows the connection to be
redirected to the same session which already hosts the running code. Such connections are called context
connections and are set by setting context connection parameter to true in the connection string. SQL
Server also provides several other enhancements to the ADO.NET API, including classes to work with
tabular data or a single row of data as well as classes to work with internal metadata about the data
stored in the database. It also provides access to the XML features in SQL Server, including XQuery
support. These enhancements are also available in T-SQL Procedures in consequence of the introduction
of the new XML Datatype (query, value, nodes functions).

SERVICES:

SQL Server also includes an assortment of add-on services. While these are not essential for the
operation of the database system, these provide value added services on top of the core database
management system. These services either run as a part of some SQL Server component or out-of-
process as Windows Service and presents their own API to control and interact with them.

SERVICE BROKER:

The Service Broker, which runs as a part of the database engine, provides a reliable messaging
and message queuing platform for SQL Server applications. Used inside an instance, it is used to
provide an asynchronous programming environment. For cross instance applications, Service Broker

51
CITIZENSHIP CODE

communicates over TCP/IP and allows the different components to be synchronized together, via
exchange of messages.

REPLICATION SERVICES:

SQL Server Replication Services are used by SQL Server to replicate and synchronize database
objects, either in entirety or a subset of the objects present, across replication agents, which might be
other database servers across the network, or database caches on the client side. Replication follows a
publisher/subscriber model, i.e., the changes are sent out by one database server ("publisher") and are
received by others ("subscribers"). SQL Server supports three different types of replication:

TRANSACTION REPLICATION:

Each transaction made to the publisher database (master database) is synced out to subscribers,
who update their databases with the transaction. Transactional replication synchronizes databases in near
real time.

MERGE REPLICATION:

Changes made at both the publisher and subscriber databases are tracked, and periodically the
changes are synchronized bi-directionally between the publisher and the subscribers. If the same data
has been modified differently in both the publisher and the subscriber databases, synchronization will
result in a conflict which has to be resolved - either manually or by using pre-defined policies.

SNAPSHOT REPLICATION:

Snapshot replication published a copy of the entire database (the then-snapshot of the data) and
replicates out to the subscribers. Further changes to the snapshot are not tracked.

ANALYSIS SERVICES:

52
CITIZENSHIP CODE

SQL Server Analysis Services adds OLAP and data mining capabilities for SQL Server
databases. The OLAP engine supports MOLAP, ROLAP and HOLAP storage modes for data. Analysis
Services supports the XML for Analysis standard as the underlying communication protocol. The cube
data can be accessed using MDX queries. Data mining specific functionality is exposed via the DMX
query language. Analysis Services includes various algorithms – Decision trees, clustering algorithm,
Naïve Bayes algorithm, time series analysis, sequence clustering algorithm, linear and logistic
regression analysis, and neural networks - for use in data mining.

REPORTING SERVICES:

SQL Server Reporting Services is a report generation environment for data gathered from SQL
Server databases. It is administered via a web interface. Reporting services features a web services
interface to support the development of custom reporting applications. Reports are created as RDL files.

Reports can be designed using recent versions of Microsoft Visual Studio (including Visual
Studio.NET 2003 onwards) with Business Intelligence Development Studio, installed or with the
included Report Builder. Once created, RDL files can be rendered in a variety of formats including
Excel, PDF, CSV, XML, TIFF (and other image formats), and HTML Web Archive.

NOTIFICATION SERVICES:

Introduced and available only with Sql Server 2005, SQL Server Notification Services is a
platform for generating notifications, which are sent to Notification Services subscribers. A subscriber
registers for a specific event or transaction (which is registered on the database server as a trigger); when
the event occurs, Notification Services uses Service Broker to send a message to the subscriber
informing about the occurrence of the event.

INTEGRATION SERVICES:

SQL Server Integration Services is used to integrate data from different data sources. It is used
for the ETL capabilities for SQL Server for data warehousing needs. Integration Services includes GUI
tools to build data extraction workflows integration various functionality such as extracting data from
53
CITIZENSHIP CODE

various sources, querying data, transforming data including aggregating, duplication and merging data,
and then loading the transformed data onto other sources, or sending e-mails detailing the status of the
operation

USES:
Access is used by small businesses, within departments of large corporations, and hobby
programmers to create ad hoc customized desktop systems for handling the creation and manipulation of
data. Access can also be used as the database for basic web based applications hosted on Microsoft's
Internet Information Services and utilizing Microsoft Active Server Pages ASP. More complex web
applications may require tools like PHP/MySql or ASP/Microsoft SQL Server.
Some professional application developers use Access for rapid application development,
especially for the creation of prototypes and standalone applications that serve as tools for on-the-road
salesmen. Access does not scale well if data access is via a network, so applications that are used by
more than a handful of people tend to rely on a Client-Server based solution such as Oracle, DB2,
Microsoft SQL Server, Windows SharePoint Services, PostgreSQLl, MySQLl, Alpha Five, MaxDB, or
FileMaker. However, an Access "front end" (the forms, reports, queries and VB code) can be used
against a host of database backends, including JET (file-based database engine, used in Access by
default), Microsoft SQL Server, Oracle, and any other ODBC-compliant product.
One of the benefits of Access from a programmer's perspective is its relative compatibility with
SQL (structured query language) —queries may be viewed and edited as SQL statements, and SQL
statements can be used directly in Macros and VBA Modules to manipulate Access tables. In this case,
"relatively compatible" means that SQL for Access contains many quirks, and as a result, it has been
dubbed "Bill's SQL" by industry insiders. Users may mix and use both VBA and "Macros" for
programming forms and logic and offers object-oriented possibilities.
MSDE (Microsoft SQL Server Desktop Engine) 2000, a mini-version of MS SQL Server 2000,
is included with the developer edition of Office XP and may be used with Access as an alternative to the
Jet Database Engine.
Unlike a complete RDBMS, the Jet Engine lacks database triggers and stored procedures.
Starting in MS Access 2000 (Jet 4.0), there is a syntax that allows creating queries with parameters, in a
way that looks like creating stored procedures, but these procedures are limited to one statement per
procedure. Microsoft Access does allow forms to contain code that is triggered as changes are made to
the underlying table (as long as the modifications are done only with that form), and it is common to use

54
CITIZENSHIP CODE

pass-through queries and other techniques in Access to run stored procedures in RDBMS that support
these.
In ADP files (supported in MS Access 2000 and later), the database-related features are entirely
different, because this type of file connects to a MSDE or Microsoft SQL Server, instead of using the Jet
Engine. Thus, it supports the creation of nearly all objects in the underlying server (tables with
constraints and triggers, views, stored procedures and UDF-s). However, only forms, reports, macros
and modules are stored in the ADP file (the other objects are stored in the back-end database).

DEVELOPMENT:

Access allows relatively quick development because all database tables, queries, forms, and
reports are stored in the database. For query development, Access utilizes the Query Design Grid, a
graphical user interface that allows users to create queries without knowledge of the SQL programming
language. In the Query Design Grid, users can "show" the source tables of the query and select the fields
they want returned by clicking and dragging them into the grid. Joins can be created by clicking and
dragging fields in tables to fields in other tables. Access allows users to view and manipulate the SQL
code if desired.
The programming language available in Access is, as in other products of the Microsoft Office
suite, Microsoft Visual Basic for Applications. Two database access libraries of COM components are
provided: the legacy Data Access Objects (DAO), only available with Access, and the new ActiveX
Data Objects (ADO).
Access can be applied to small projects but scales poorly to larger projects involving multiple
concurrent users because it is a desktop application, not a true client-server database. When a Microsoft
Access database is shared by multiple concurrent users, processing speed suffers. The effect is dramatic
when there are more than a few users or if the processing demands of any of the users are high. Access
includes an Upsizing Wizard that allows users to upsize their database to Microsoft SQL Server if they
want to move to a true client-server database.
Since all database queries, forms, and reports are stored in the database, and in keeping with the
ideals of the relational model, there is no possibility of making a physically structured hierarchy with
them.
One design technique is to divide an Access application between data and programs. One
database should contain only tables and relationships, while another would have all programs, forms,
reports and queries, and links to the first database tables. Unfortunately, Access allows no relative paths
55
CITIZENSHIP CODE

when linking, so the development environment should have the same path as the production
environment (though it is possible to write a "dynamic-linker" routine in VBA that can search out a
certain back-end file by searching through the directory tree, if it can't find it in the current path). This
technique also allows the developer to divide the application among different files, so some structure is
possible.

56
CITIZENSHIP CODE

SOURCE CODE:

Coding:
FOR ADMIN LOGIN PAGE:
protected void btnAdminLogin_Click(object sender, EventArgs e)

de.Name = txtUname.Text;

de.Fathername = txtpassword.Text;

if (rbtnNational.Checked == true)

if (b.UserLogin(de))

if (RadioButton1.Checked == true)

Session["uname"] = txtUname.Text;

Session["pwd"] = txtpassword.Text;

Response.Redirect("view.aspx");

57
CITIZENSHIP CODE

else

Response.Redirect("AdminNation.aspx");

else

MessageBox.Show("Invalid Login");

else if (rbtnPan.Checked == true)

if (b.loginpan(de))

if (RadioButton1.Checked == true)

Session["uname"] = txtUname.Text;

58
CITIZENSHIP CODE

Session["pwd"] = txtpassword.Text;

Response.Redirect("view.aspx");

else

Response.Redirect("PANCARD.aspx");

else

MessageBox.Show("Invalid Login");

else if (rbtnLicense.Checked == true)

if (b.loginrdo(de))

if (RadioButton1.Checked == true)

59
CITIZENSHIP CODE

Session["uname"] = txtUname.Text;

Session["pwd"] = txtpassword.Text;

Response.Redirect("view.aspx");

else

Response.Redirect("DrivingLincese.aspx");

else

MessageBox.Show("Invalid Login");

else if (rbtnvote.Checked == true)

if (b.loginvote(de))

if (RadioButton1.Checked == true)

60
CITIZENSHIP CODE

Session["uname"] = txtUname.Text;

Session["pwd"] = txtpassword.Text;

Response.Redirect("view.aspx");

else

Response.Redirect("Voterregistration.aspx");

else

MessageBox.Show("Invalid Login");

else

61
CITIZENSHIP CODE

MessageBox.Show("Select any one Admin Login");

FOR NATIONAL REGISTRATION PAGE:

protected void btnSubmit_Click(object sender, EventArgs e)

de.Name = txtName.Text;

de.Fathername = txtfathername.Text;

de.Mothername = txtmothername.Text;

de.Tongue = txtmothername.Text;

de.Genter = txtgender.Text;

de.Dob = txtdob.Text;

de.Martial = txtmartialstatus.Text;

de.Email = txtemail.Text;

de.Qualification = txtqualification.Text;

de.Contactno = txtcontactno.Text;

62
CITIZENSHIP CODE

de.Presentaddress = txtpaddress.Text;

de.Permanentaddress = txtperaddress.Text;

de.City = txtcity.Text;

de.State = txtstate.Text;

b.nationreg(de);

txtName.Text = "";

txtfathername.Text = "";

txtmothername.Text = "";

txtmothertongue.Text = "";

txtgender.Text = "";

txtdob.Text = ""; txtmartialstatus.Text = ""; txtemail.Text = ""; txtqualification.Text = "";


txtcontactno.Text = "";

txtpaddress.Text = ""; txtperaddress.Text = ""; txtcity.Text = ""; txtstate.Text = "";

MessageBox.Show("Sucessfully Registred");

MessageBox.Show("Your Nationid sended to your mailid");

63
CITIZENSHIP CODE

FOR DRIVING LICENSE PAGE

protected void btnSubmit_Click1(object sender, EventArgs e)

int imglen = txtphoto.PostedFile.ContentLength;

byte[] picbyte = new byte[imglen];

string imgtype = txtphoto.PostedFile.ContentType;

txtphoto.PostedFile.InputStream.Read(picbyte, 0, imglen);

string date = DateTime.Now.ToShortDateString();

string renivaldate = DateTime.Now.AddYears(20).ToShortDateString();

con.Open();

com = new SqlCommand("INSERT into tbtLicense values('" + txtName.Text + "','" +


txtfathername.Text + "','" + txtmothername.Text + "','" + txtmothertongue.Text + "','" + txtgender.Text +
"','" + txtdob.Text + "','" + txtmartialstatus.Text + "','" + txtemail.Text + "','" + txtqualification.Text +
"','" + txtcontactno.Text + "','" + txtpaddress.Text + "','" + txtperaddress.Text + "','" + txtcity.Text + "','"
+ txtstate.Text + "','" + txtnationid.Text + "','" + txttype.Text + "','" + txtblood.Text + "','" +
txtlicense.Text + "','" + txttest.Text + "','" + date + "','" + renivaldate + "','" + picbyte + "','" +
txtlicenseno.Text + "')", con);

com.ExecuteNonQuery();

string nationid = txtnationid.Text;

Session["nationid"] = nationid;

Session["dlno"] = txtlicenseno.Text;
64
CITIZENSHIP CODE

Session["name"] = txtName.Text;

Session["sonof"] = txtfathername.Text;

Session["address"] = txtperaddress.Text;

Session["dob"] = txtdob.Text;

if (System.IO.File.Exists(Server.MapPath(".") + "\\PHOTOS\\" + nationid + ".jpg"))

System.IO.File.Delete(Server.MapPath(".") + "\\PHOTOS\\" + nationid + ".jpg");

txtphoto.SaveAs(Server.MapPath(".") + "\\PHOTOS\\" + nationid + ".jpg");

Response.Redirect("lisenceprint.aspx");

FOR PRINT PAGE (ID CARD)


protected void Page_Load(object sender, EventArgs e)

string panid = Session["panid"].ToString();

Label7.Text = Session["panid"].ToString();

Label8.Text = Session["name"].ToString();

Label10.Text = Session["address"].ToString();

Label11.Text = Session["dob"].ToString();

//string TestStr = "Test";

65
CITIZENSHIP CODE

Label9.Text = Session["date"].ToString();

Image1.AlternateText = "No Image";

Image1.ImageUrl = "~\\PHOTOS\\" + panid + ".jpg";

EDIT USER PROFILE PAGE


protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)

con.Open();

com = new SqlCommand("update voter_reg set name='" +


((TextBox)GridView1.Rows[e.RowIndex].Cells[1].Controls[0]).Text + "',fathername='" +
((TextBox)GridView1.Rows[e.RowIndex].Cells[2].Controls[0]).Text + "',mothername='" +
((TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0]).Text + "' where nationid='" +
((TextBox)GridView1.Rows[e.RowIndex].Cells[15].Controls[0]).Text + "'", con);

com.ExecuteNonQuery();

con.Close();

GridView1.EditIndex = -1;

bind();

66
CITIZENSHIP CODE

protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)

GridView1.EditIndex = e.NewEditIndex;

bind();

protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)

con.Open();

com = new SqlCommand("delete from Voter_reg where nationid='" +


GridView1.Rows[e.RowIndex].Cells[15].Text.ToString() + "'", con);

com.ExecuteNonQuery();

con.Close();

bind();

public void bind()

con.Open();

com = new SqlCommand("select *from Voter_reg", con);

da = new SqlDataAdapter(com);

da.Fill(ds);

GridView1.DataSource = ds;

GridView1.DataBind();
67
CITIZENSHIP CODE

con.Close();

public void bindnation()

con.Open();

com = new SqlCommand("select *from national_reg", con);

da = new SqlDataAdapter(com);

da.Fill(ds);

GridView2.DataSource = ds;

GridView2.DataBind();

con.Close();

public void bindtbtlicense()

con.Open();

com = new SqlCommand("select *from tbtlicense", con);

da = new SqlDataAdapter(com);

da.Fill(ds);

GridView3.DataSource = ds;

GridView3.DataBind();

con.Close();

68
CITIZENSHIP CODE

public void bindpancard()

con.Open();

com = new SqlCommand("select *from pancard", con);

da = new SqlDataAdapter(com);

da.Fill(ds);

GridView4.DataSource = ds;

GridView4.DataBind();

con.Close();

protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs


e)

GridView1.EditIndex = -1;

bind();

protected void GridView2_RowCancelingEdit(object sender, GridViewCancelEditEventArgs


e)

GridView1.EditIndex = -1;

bindnation();

}
69
CITIZENSHIP CODE

protected void GridView2_RowDeleting(object sender, GridViewDeleteEventArgs e)

protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)

protected void GridView2_RowUpdating(object sender, GridViewUpdateEventArgs e)

protected void GridView3_RowDeleting(object sender, GridViewDeleteEventArgs e)

con.Open();

com = new SqlCommand("delete from tbtlicense where nationid='" +


GridView3.Rows[e.RowIndex].Cells[15].Text.ToString() + "'", con);

com.ExecuteNonQuery();

con.Close();

bindtbtlicense();

protected void GridView3_RowEditing(object sender, GridViewEditEventArgs e)

{
70
CITIZENSHIP CODE

GridView3.EditIndex = e.NewEditIndex;

bindtbtlicense();

protected void GridView3_RowUpdating(object sender, GridViewUpdateEventArgs e)

con.Open();

com = new SqlCommand("update tbtlicense set name='" +


((TextBox)GridView3.Rows[e.RowIndex].Cells[1].Controls[0]).Text + "',fathername='" +
((TextBox)GridView3.Rows[e.RowIndex].Cells[2].Controls[0]).Text + "',mothername='" +
((TextBox)GridView3.Rows[e.RowIndex].Cells[3].Controls[0]).Text + "' where nationid='" +
((TextBox)GridView3.Rows[e.RowIndex].Cells[15].Controls[0]).Text + "'", con);

com.ExecuteNonQuery();

con.Close();

GridView3.EditIndex = -1;

bindtbtlicense();

protected void GridView3_RowCancelingEdit(object sender, GridViewCancelEditEventArgs


e)

GridView3.EditIndex = -1;

bindtbtlicense();

protected void GridView4_RowCancelingEdit(object sender, GridViewCancelEditEventArgs


e)

71
CITIZENSHIP CODE

GridView4.EditIndex = -1;

bindpancard();

protected void GridView4_RowDeleting(object sender, GridViewDeleteEventArgs e)

con.Open();

com = new SqlCommand("delete from pancard where nationid='" +


GridView4.Rows[e.RowIndex].Cells[15].Text.ToString() + "'", con);

com.ExecuteNonQuery();

con.Close();

bindpancard();

protected void GridView4_RowEditing(object sender, GridViewEditEventArgs e)

GridView4.EditIndex = e.NewEditIndex;

bindpancard();

protected void GridView4_RowUpdating(object sender, GridViewUpdateEventArgs e)

con.Open();

com = new SqlCommand("update pancard set name='" +


((TextBox)GridView4.Rows[e.RowIndex].Cells[1].Controls[0]).Text + "',fathername='" +
72
CITIZENSHIP CODE

((TextBox)GridView4.Rows[e.RowIndex].Cells[2].Controls[0]).Text + "',mothername='" +
((TextBox)GridView4.Rows[e.RowIndex].Cells[3].Controls[0]).Text + "' where nationid='" +
((TextBox)GridView4.Rows[e.RowIndex].Cells[15].Controls[0]).Text + "'", con);

com.ExecuteNonQuery();

con.Close();

GridView4.EditIndex = -1;

bindpancard();

protected void GridView2_RowDeleting1(object sender, GridViewDeleteEventArgs e)

con.Open();

com = new SqlCommand("delete from national_reg where nationid='" +


GridView2.Rows[e.RowIndex].Cells[15].Text.ToString() + "'", con);

com.ExecuteNonQuery();

con.Close();

bindnation();

protected void GridView2_RowEditing1(object sender, GridViewEditEventArgs e)

GridView2.EditIndex = e.NewEditIndex;

bindnation();

protected void GridView2_RowUpdating1(object sender, GridViewUpdateEventArgs e)

73
CITIZENSHIP CODE

con.Open();

com = new SqlCommand("update national_reg set name='" +


((TextBox)GridView2.Rows[e.RowIndex].Cells[2].Controls[0]).Text + "',fathername='" +
((TextBox)GridView2.Rows[e.RowIndex].Cells[3].Controls[0]).Text + "',mothername='" +
((TextBox)GridView2.Rows[e.RowIndex].Cells[4].Controls[0]).Text + "' where nationid='" +
((TextBox)GridView2.Rows[e.RowIndex].Cells[16].Controls[0]).Text + "'", con);

com.ExecuteNonQuery();

con.Close();

GridView2.EditIndex = -1;

bindnation();

protected void GridView2_RowCancelingEdit1(object sender, GridViewCancelEditEventArgs


e)

GridView2.EditIndex = -1;

bindnation();

USER DETAILS PAGE

protected void Page_Load(object sender, EventArgs e)

if (!IsPostBack)

74
CITIZENSHIP CODE

string uname = Session["uname"].ToString();

string pwd = Session["pwd"].ToString();

if(uname=="nation"&& pwd=="nation")

DropDownList1.Items.Add("...Select...");

DropDownList1.Items.Add("national_reg");

else if (uname == "pan" && pwd == "pan")

DropDownList1.Items.Add("...Select...");

DropDownList1.Items.Add("pancard");

else if (uname == "rdo" && pwd == "rdo")

DropDownList1.Items.Add("...Select...");

DropDownList1.Items.Add("tbtlicense");

else if (uname == "vote" && pwd == "vote")

75
CITIZENSHIP CODE

DropDownList1.Items.Add("...Select...");

DropDownList1.Items.Add("voter_reg");

76
CITIZENSHIP CODE

77
CITIZENSHIP CODE

TESTING:

SYSTEM TESTING:

Testing is performed to identify errors. It is used for quality assurance. Testing is an integral part
of the entire development and maintenance process. The goal of the testing during phase is to verify that
the specification has been accurately and completely incorporated into the design, as well as to ensure
the correctness of the design itself. For example the design must not have any logic faults in the design
is detected before coding commences, otherwise the cost of fixing the faults will be considerably higher
as reflected. Detection of design faults can be achieved by means of inspection as well as walkthrough.
Testing is one of the important steps in the software development phase. Testing checks for the errors, as
a whole of the project testing involves the following test cases:

Static analysis is used to investigate the structural properties of the Source code. Dynamic testing
is used to investigate the behavior of the source code by executing the program on the test data.

UNIT TESTING:

Unit testing is conducted to verify the functional performance of each modular component of the
software. Unit testing focuses on the smallest unit of the software design (i.e.), the module. The white-
box testing techniques were heavily employed for unit testing.

78
CITIZENSHIP CODE

79
CITIZENSHIP CODE

FUNCTIONAL TESTS:

Functional test cases involved exercising the code with nominal input values for which the
expected results are known, as well as boundary values and special values, such as logically related
inputs, files of identical elements, and empty files.

Three types of tests in Functional test:

 Performance Test
 Stress Test
 Structure Test

PERFORMANCE TEST:

It determines the amount of execution time spent in various parts of the unit, program
throughput, and response time and device utilization by the program unit.

STRESS TEST:

Stress Test is those test designed to intentionally break the unit. A Great deal can be learned
about the strength and limitations of a program by examining the manner in which a programmer in
which a program unit breaks.

STRUCTURED TEST:

Structure Tests are concerned with exercising the internal logic of a program and traversing
particular execution paths. The way in which White-Box test strategy was employed to ensure that the
test cases could guarantee that all independent paths within a module have been exercised at least once.
Exercise all logical decisions on their true or false sides. Execute all loops at their boundaries and within
their operational bounds. Exercise internal data structures to assure their validity. Checking attributes for
their correctness. Handling end of file condition, I/O errors, buffer problems and textual errors in output
information

80
CITIZENSHIP CODE

INTEGRATION TESTING:

Integration testing is a systematic technique for construction the program structure while at the
same time conducting tests to uncover errors associated with interfacing. i.e., integration testing is the
complete testing of the set of modules which makes up the product. The objective is to take untested
modules and build a program structure tester should identify critical modules.

Critical modules should be tested as early as possible. One approach is to wait until all the units
have passed testing, and then combine them and then tested. This approach is evolved from unstructured
testing of small programs. Another strategy is to construct the product in increments of tested units. A
small set of modules are integrated together and tested, to which another module is added and tested in
combination. And so on. The advantages of this approach are that, interface dispenses can be easily
found and corrected.

The major error that was faced during the project is linking error. When all the modules are
combined the link is not set properly with all support files. Then we checked out for interconnection and
the links. Errors are localized to the new module and its intercommunications. The product development
can be staged, and modules integrated in as they complete unit testing. Testing is completed when the
last module is integrated and tested.

TESTING TECHNIQUES / TESTING STRATRGIES:

TESTING:

Testing is a process of executing a program with the intent of finding an error. A good test case
is one that has a high probability of finding an as-yet –undiscovered error. A successful test is one that
uncovers an as-yet- undiscovered error.

System testing is the stage of implementation, which is aimed at ensuring that the system works
accurately and efficiently as expected before live operation commences. It verifies that the whole set of
programs hang together. System testing requires a test consists of several key activities and steps for run
program, string, system and is important in adopting a successful new system. This is the last chance to
detect and correct errors before the system is installed for user acceptance testing.

81
CITIZENSHIP CODE

The software testing process commences once the program is created and the documentation and
related data structures are designed. Software testing is essential for correcting errors. Otherwise the
program or the project is not said to be complete.

Software testing is the critical element of software quality assurance and represents the ultimate
the review of specification design and coding.

Testing is the process of executing the program with the intent of finding the error. A good test
case design is one that as a probability of finding an yet undiscovered error. A successful test is one that
uncovers an yet undiscovered error. Any engineering product can be tested in one of the two ways:

WHITE BOX TESTING:

This testing is also called as Glass box testing. In this testing, by knowing the specific functions
that a product has been design to perform test can be conducted that demonstrate each function is fully
operational at the same time searching for errors in each function. It is a test case design method that
uses the control structure of the procedural design to derive test cases. Basis path testing is a white box
testing.

Basis path testing are:

 Flow graph notation


 Cyclomatic complexity
 Deriving test cases
 Graph matrices Control

BLACK BOX TESTING:

In this testing by knowing the internal operation of a product, test can be conducted to ensure
that “all gears mesh”, that is the internal operation performs according to specification and all internal

82
CITIZENSHIP CODE

components have been adequately exercised. It fundamentally focuses on the functional requirements of
the software. The steps involved in black box test case design are:

 Graph based testing methods


 Equivalence partitioning
 Boundary value analysis
 Comparison testing

SOFTWARE TESTING STRATEGIES:

A software testing strategy provides a road map for the software developer. Testing is a set
activity that can be planned in advance and conducted systematically. For this reason a template for
software testing a set of steps into which we can place specific test case design methods should be
strategy should have the following characteristics :Testing begins at the module level and works
“outward” toward the integration of the entire computer based system. Different testing techniques are
appropriate at different points in time. The developer of the software and an independent test group
conducts testing. Testing and Debugging are different activities but debugging must be accommodated
in any testing strategy.

INTEGRATION TESTING:

Integration testing is a systematic technique for constructing the program structure while at the
same time conducting tests to uncover errors associated with. Individual modules, which are highly
prone to interface errors, should not be assumed to work instantly when we put them together. The
problem of course, is “putting them together”- interfacing. There may be the chances of data lost across
on another’s sub functions, when combined may not produce the desired major function; individually
acceptable impression may be magnified to unacceptable levels; global data structures can present
problems.

VALIDATION TESTING:

Software validation is achieved through a series of tests that demonstrates conformity with
requirements. A test plan outlines the classes of test to be conducted and a test procedure defines

83
CITIZENSHIP CODE

specific test cases that will be used to demonstrate conformity with requirements. Thus the proposed
system under consideration has been tested by validation and found to be working satisfactorily.

PROGRAM TESTING:

The logical and syntax errors have been pointed out by program testing. A syntax error is an
error in a program statement that in violates one or more rules of the language in which it is written. An
improperly defined field dimension or omitted keywords are common syntax error. These errors are
shown through error messages generated by the computer. A logic error on the other hand deals with the
incorrect data fields, out-off-range items and invalid combinations. Since the compiler s will not deduct
logical error, the programmer must examine the output. Condition testing exercises the logical
conditions contained in a module.

The possible types of elements in a condition include a Boolean operator, Boolean variable, a
pair of Boolean parentheses A relational operator or on arithmetic expression. Condition testing method
focuses on testing each condition in the program the purpose of condition test is to deduct not only
errors in the condition of a program but also other a errors in the program.

SECURITY TESTING:

Security testing attempts to verify the protection mechanisms built in to a system well, in fact,
protect it from improper penetration. The system security must be tested for invulnerability from frontal
attack must also be tested for invulnerability from rear attack. During security, the tester places the role
of individual who desires to penetrate system.

84
CITIZENSHIP CODE

SYSTEM SECURITY MEASURES:

System security refers to the technical innovations and procedures applied to the hardware and
operating systems to protect against deliberate or accidental damage from a defined threat. In contrast,
data security is the protection of data from disclosure, modification and destruction. Data privacy and
security are issues that go beyond the scope of system development. They are actually a societal
concern. Our organization depends heavily on the use of data bases requires special controls to maintain
viable information. These controls are classified in to three general categories.

 Physical securities are production from fire flood and other physical damage.
 Database integrity through data validation techniques.
 Control measures through passwords encryption and monitoring users on a regular basis.

Password is the most common authentication mechanism based on sharing of secret. In a


password –based system each user has a password, which may initially be assigned by the system or an
administrator. In Online Recruitment System, only administrator is allowed to change the user’s
passwords. The system stores all users passwords and users them to authenticate the user. When logging
in, the system request the user supplies a presumably secret, user specific password. This way the
passwords provide protection to some extent the proper backup of data in the form of hardcopies as well
as on paper stationary is a measure of disaster recovery planning.

85
CITIZENSHIP CODE

System Analysis:

Assuming that a new system is to be developed, the next phase is system analysis. Analysis
involved a detailed study of the current system, leading to specifications of a new system. Analysis is a
detailed study of various operations performed by a system and their relationships within and outside the
system. During analysis, data are collected on the available files, decision points and transactions
handled by the present system. Interviews, on-site observation and questionnaire are the tools used for
system analysis
All procedures, requirements must be analyzed and documented in the form of detailed data flow
diagrams (DFDs), data dictionary, logical data structures and miniature specifications. System Analysis
also includes sub-dividing of complex process involving the entire system, identification of data store
and manual processes.

The important steps in system analysis are:

 Specification of what the new system is to accomplish based on the user requirements.
 Functional hierarchy showing the functions to be performed by the new system and their
relationship with each other.
 Function network, which are similar to function hierarchy but they highlight those
functions, which are common to more than one procedure.
 List of attributes of the entities - these are the data items which need to be held about
each entity (record)

86
CITIZENSHIP CODE

FEASIBILITY STUDY:

Feasibility is the determination of whether or not a project is worth doing. The processes is
followed in making this determination is called a feasibility study. Feasibility study is the test of system
proposal according to its workability, Impact on the organization ability to meet user’s needs, and
effective use of resources. The result of feasibility study is a formal proposal. This is simply a report – a
formal document detailing the nature and scope of the proposed solution .The main objective of a
feasibility study is to test the technical, social and economic feasibility of developing a computer
system. This is done by investigation the existing system in the area under investigation and generating
ideas about a new system. On studying the feasibility of the system, three major considerations are dealt
with, to find whether the automation of the system is feasible. They are discussed as follows;

TECHNICAL FEASIBILITY:

A system that can be developed technically and that will be used if installed must still be a good
invested for the organization. The assessment of technical feasibility must be based on an outline design
on system requirements in terms of inputs, outputs, files, programs, procedures. Technical feasibility
centers around the existing computer system and to what extend it can support the proposed system. The
current technical resources, which are available in the organization, are capable of handling the
requirements in the aspect of technical staff. Technical feasibility also involves the investigations such
as whether the proposed system provides adequate response to inquiries and whether it can be expanded
if developed. The current project is to be designed so as to fit to the expectations of various categories of
people concerned with it. Besides some technical experts who also have the computer knowledge are to
be trained over the project enabling them to take care of the technical problems. The system is
developed to meet the demands of the existing . The system is also reliable and easy to use. So it is
found that this project is technically practicable keeping the clients requirements in mind.

ECONOMIC FEASIBILITY:

87
CITIZENSHIP CODE

The technique of cost benefit analysis is often used as a basis for assessing economic feasibility.
Economic feasibility deals with the analysis of costs against benefits (i.e) whether the benefits to the
enjoyed due to the new system are worthy when compared to the costs to be spent on the system.
Economic analysis is the nose frequently used technique for evaluating the cost effectiveness of the
proposed project. More commonly know as cost / benefit analysis, the procedure is to determine whether
the project have the benefits and savings. Further compared with the existing-costs in the manual
procedure, the current project involves less investment.

The cost when compared to the benefits of the system are much low. Hence the system is
economically feasible. The conversion of the staff in maintaining the paper records to some other
important work is possible which may be taken as the added advantages of this project. Accurate and
reliable information exchange with reasonable cost is possible. Taking this into consideration, the
system is found to be economically feasible.

OPERATIONAL FEASIBILITY:

Proposed projects are beneficial only if they can be turned into information systems that will
meet the company’s operating requirements. Simply stated, this test of feasibility asks if the system will
work when it is developed and installed. There are questions that will help to test the operational
feasibility of a project.

The following aspects are considered during the time of feasibility study:

The changes brought to the system.

The operational skills that will be required for entering data and the training to be given are also
considered.

TIME FEASIBILITY:

88
CITIZENSHIP CODE

The only point is “Can the project be developed in time so that it can be used before any new
proposal come to the company. The software is feasible with time as it will be developed in the
estimated time limit.

RESOURCE FEASIBILITY:

The issue of consideration here is “does the developer has enough resources to develop such
software and to succeed in it?” i.e. the resources that would be required to develop and implement the
software. The resources not only include the hardware, software, and technology but also require money,
men power. It also takes into consideration the resources required at client side when the software has
been installed.

BEHAVIORAL FEASIBILITY:

People are inherently resistant to change, and because of any new thing changes are made.
Evolution of any new system over existing system is a reason for resistant by people. So, for a project
the respective behavioral feasibility is calculated, so as to have complete knowledge of what problems
would be faced after implementing the software. In this software, the user can never face any kind of
problems, as the software is highly user friendly.

89
CITIZENSHIP CODE

Organizational Profile:

Invictus Technology Solutions ITS specializes in offering our customers total web solutions. As
a Privately owned and funded startup, we have been building our business with a strong commitment to
deliver IT solutions in time. We are working towards development of innovative and creative products,
services and concepts providing total information. We pride ourselves in being a fast developing firm.
ITS possesses the best of the skills and wide spread expertise in proposing, designing, developing, and
implementing such solutions in diversified technologies and platforms. Experts, who are fastidiously
chosen, continuously trained and nurtured through a specially designed recruitment and retention
program.

Who we are?

Invictus Technology Solutions is a leading consulting and IT services company, offering a wide
array of solutions customized for a range of key verticals and horizontals. ITS was established by a
group of professionals and technocrats, having rich experience in software development, providing web
based IT solutions, project management and IT management. ITS works using an excellent team of
young, energetic, qualified professionals under the supervision and guidance of an experienced
management team. Now our team strength is around one hundred and twenty qualified professionals.
We have a unique business model, where learning solutions and software development complement each
other.

Management Profile:

Mr. M. Muthukumar is the CEO of ITS. An Engineering graduate, having more than a decade of
IT experience is an eminent entrepreneur. He spearheads the company with an excellent team who
shares his vision.

90
CITIZENSHIP CODE

91
CITIZENSHIP CODE

92
CITIZENSHIP CODE

93
CITIZENSHIP CODE

94
CITIZENSHIP CODE

95
CITIZENSHIP CODE

96
CITIZENSHIP CODE

97
CITIZENSHIP CODE

98
CITIZENSHIP CODE

99
CITIZENSHIP CODE

100
CITIZENSHIP CODE

101
CITIZENSHIP CODE

102
CITIZENSHIP CODE

103
CITIZENSHIP CODE

104
CITIZENSHIP CODE

CONCLUSION:

The increasing use of Internet in a variety of distributed multiparty interactions and transactions
with strong real-time requirements has pushed the search for solutions to the problem of attribute-based
digital interactions. A promising solution today is represented by automated trust negotiation systems.
Trust negotiation systems allow subjects in different security domains to securely exchange protected
resources and services. These trust negotiation systems, however, by their nature, may represent a threat
to privacy in that credentials, exchanged during negotiations, often contain sensitive personal
information that may need to be selectively released. In this paper, we address the problem of preserving
privacy in trust negotiations. We introduce the notion of privacy preserving disclosure, that is, a set that
does not include attributes or credentials, or combinations of these, that may compromise privacy. To
obtain privacy preserving disclosure sets, we propose two techniques based on the notions of
substitution and generalization. We argue that formulating the trust negotiation requirements in terms of
disclosure policies is often restrictive. To solve this problem, we show how trust negotiation
requirements can be expressed as property-based policies that list the properties needed to obtain a given
resource. To better address this issue, we introduce the notion of reference ontology, and formalize the
notion of trust requirement. Additionally, we develop an approach to derive disclosure policies from
trust requirements and formally state some semantics relationships (i.e., equivalence, stronger than) that
may hold between policies. These relationships can be used by a credential requestor to reason about
which disclosure policies he/she should use in a trust negotiation.

105
CITIZENSHIP CODE

106
CITIZENSHIP CODE

FUTURE ENHANCEMENTS:

This application avoids the manual work and the problems concern with it. It is an easy way
to obtain the information regarding the various products information that are present in the Super
markets.

Well I and my team members have worked hard in order to present an improved website
better than the existing one’s regarding the information about the various activities. Still ,we found out
that the project can be done in a better way. Primarily, when we request information about a particular
product it just shows the company, product id, product name and no. of quantities available. So, after
getting the information we can get access to the product company website just by a click on the product
name .

The next enhancement that we can add the searching option. We can directly search to the
particular product company from this site .These are the two enhancements that we could think of at
present.

107
CITIZENSHIP CODE

108
CITIZENSHIP CODE

BIBLIOGRAPHY:

1 E. Bertino, E. Ferrari, and A. Squicciarini, “Privacy Preserving Trust Negotiations,” Proc.


Fourth Int'l Workshop Privacy Enhancing Technologies, 2004.

2 E Bertino, E. Ferrari, and A. Squicciarini, “$Trust{\hbox{-}}{\cal{X}}$ — A Peer to Peer


Framework for Trust Establishment,” IEEE Trans. Knowledge and Data Eng., vol. 16, no. 7, pp. 827-
842, Apr. 2004.

3 E. Bertino, E. Ferrari, and A. Squicciarini, “Trust Negotiations: Concepts, Systems, and


Languages,” IEEE Computing in Science and Eng., vol. 6, no. 4, pp. 27-34, 2004.

4 P. Bonatti and S. Kraus, “Foundations on Secure Deductive Databases,” IEEE Trans.


Knowledge and Data Eng., vol. 7, no. 3, pp. 406-422, 1995.

5 P. Bonatti and P. Samarati, “Regulating Access Services and Information Release on the Web,”
Proc. Seventh ACM Conf. Computer and Comm. Security, 2000.

6 R. Brand, “Microdata Protection through Noise Addition,” Inference Control in Statistical


Databases, from Theory to Practice, pp. 97-116. London: Springer-Verlag, 2002.

109
CITIZENSHIP CODE

7 S. Brands, Rethinking Public Key Infrastructure and Digital Credentials. MIT Press, 2000.

The following books were referred during the analysis and execution phase of the project

MICROSOFT .NET WITH C#

Microsoft .net series

ASP .NET 2.0 PROFESSIONAL

Wrox Publishers

ASP .NET WITH C# 2005

Apress Publications

C# COOK BOOK

O Reilly Publications

PROGRAMMING MICROSOFT ASP .NET 2.0 APPLICATION

110
CITIZENSHIP CODE

Wrox Professional Guide

BEGINNING ASP .NET 2.0 E-COMMERCE IN C# 2005

Novice to Professional.

WEBSITES:

www.google.com

www.microsoft.com

111
CITIZENSHIP CODE

112

You might also like