You are on page 1of 59

SYNOPSIS

The objective of the CYBERVOTE project is to develop the first completely


secure cyber voting system based on WAP, WML, XML, HTML and Java technologies
that will enable European citizens to vote through their mobile phones and PCs connected
to Internet. The CYBERVOTE design will be driven by solutions which will allow the
user authentication while guaranteeing ballot secrecy, sanctity and integrity but also the
freedom of expression of the voter and the user-friendliness and the acceptability of the
system.
Trial applications will be conducted with disabled, ill and traveling people on
different pilot elections. CYBER Votes objective is to implement a trustworthy e-voting
protocol which can be integrated to existing infrastructures for identification of voters.
The e-voting system will be able to handle multiple and concurrent elections and different
versions of cryptographic protocols. It will also provide citizen access to supplementary
information related to voting with standard browsers.

PROJECT DESCRIPTION
Cyber Vote uses different methods of encryption, which ensures the security of the
data given to the system, and it ensures voters authentication. Separating the database
server from the Cyber Vote server gives the system another security advantage.
Furthermore, Cyber Vote follows the secret ballots criteria, which separates voters
identity from the ballot, which maintains the privacy of the voting process.
The 2000 presidential elections forced most of the organizations around the world
to think of a better way of voting that enables as much people to cast their ballots in a
convenient way. It was suggested to introduce a system that enables voters to use the
internet to cast their ballots, since the internet is a cheap, fast, and effective way to
transfer data .Many researchers have studied the benefits and threats of using internet for
voting .Most studies raised concerns about voters authentication, security of ballots
during transfer through internet, and maintaining the secret ballot, which means to
separate the identity of the voter from the ballot.
Online voting is not a new concept .In the last three decades, studies tried to come
up with a way to create online voting systems that enable peoples to vote while they are
at their homes. It was not until the late 90s when the idea to grow .Studies expects that
online voting will replace the present voting systems sooner and later.

EXISTING SYSTEM:

There are many technicals that appear when applying remote online voting
systems.

The first issue that can be a threat is a coordinated network flood.

Another problem that prevents the implementation of online voting is the security on the
other side of the system , the voter terminal

This is probably the toughest challenge facing the developers of those systems.

Giving secrecy of ballots, since other people can watch the voting process from behind
the voters back.

Having access to computers and internet is another important issue, since access to
internet varies from one class to another in the society which might not give accurate
result.

PROPOSED SYSTEM:

Flooding any network can be solved by having a backup server that picks up as
soon as the other server stops working.

Furthermore,replacing major servers with smaller servers placed according to population


of voters in different areas will help stopping any kind of coordinate network flooding.

Securing all the voters terminals could be an impossible mission,simply because Voters
run multiple applications on their terminals that might be capable of changing or
manipulating the voting process.

The most practical solution is to have an online scanning tools that scans the voters
computer from potential threats before the voters get to cast their votes.

Another solution that can be more time efficient is transmission a tool to the voters
computer after that stops all the processes running on the machine,except for the
processes the system runs.

This solution will reduce the risk of having security problems on the voters terminals,but
it does not eliminate it.

Having Access to the internet should not have a huge impact on the voting process if we
keep the old fashion way by going to polls where terminals are available,located in the
areas where computer access is not available as much as other areas.

For more security purpose Image Processing is used to recognize the face of the voters.
Advantages:
Online voting provides convenience, cost-saving, and saves the voters from dealing
with heavy traffic, bad weather conditions, and postal services issues. Furthermore, it
helps millions of disabled and blind people to cast their votes without any assistance.

SYSTEM DESIGN

INPUT DESIGN
Input design is a part of overall system design. The main objective during the
input desings is as given below:

To produce a cost-effective method of input.

To achive the highest possible level of accuracy.

To ensure that the input is acceptable and understood by the user.

INPUT STAGES
The main input stages can be listed as below:

Data recording

Data transcription

Data conversion

Data verification

Data control

Data transmission

Data validation

Data correction

INPUT TYPES
It is necessary to determine the various types of inputs. Inputs can be categorized
as follows:

External inputs, which are prime inputs for the system.

Internal inputs, which are user communications with the system.

Operational are computer departments communications to the system.

OUTPUT DESIGN
Outputs from computer systems are required primarily to communicate the results
of processing to users. They are also used to provide a permanent copy of the results for
later consultation. The various types of outputs in general are:
External Outputs, whose destination is outside the organization.
Internal Outputs whose destination is with in organisation and they are the users
main interface with the computer.
Operational outputs whose use is purely with in the computer department.
Interface outputs, which involve the user in communicating directly with

OUTPUT DEFINITION
The outputs should be defined in terms of the following points:

Type of the output

Content of the output

Format of the output

Location of the output

Frequency of the output

Volume of the output

Sequence of the output

It is not always desirable to print or display data as it is held on a computer. It should be


decided as which form of the output is the most suitable.

SOFTWARE REQUIREMENT
Operating System

Windows XP Professional

Environment

Visual Studio .Net 2008

.Net Framework

Version 3.5

Language

C#

Web Technology

Active Server Pages.Net

Web Server

Internet information Server 5.0

Back End

SQL Server 2005

HARDWARE REQUIREMENT

Processor

Pentium IV

RAM

512MB

Monitor size

17SVGA

Hard Disk

80 GB

Extra Device

CD-ROM 52x

Operating System

Windows XP

Keyboard

104 standards Keyboard

ABOUT ASP.NET
INTRODUCTION OF VISUAL STUDIO
In 2002, Visual Studio took the biggest leap in innovation since it was released,
with the introduction of Visual Basic .NET (as it was renamed). After more than a
decade, Visual Basic was overdue for a major overhaul. But .NET goes beyond an
overhaul. It changes almost every aspect of software development. From integrating
Internet functionality to creating object-oriented frameworks, Visual Basic .NET
challenged traditional VB developers to learn dramatic new concepts and techniques.
2005 brings us an enhanced Visual Basic language (renamed this time Visual Basic
2005). New features have been added that cement this languages position as a true
object-oriented language. With Visual Basic 2005, it is still going to be a challenge for the
traditional VB6 developers to learn, but it is an easy road and books like this are here to
help you on your path. First, its necessary to learn the differences between Visual Basic
2005 and the older versions. In some cases, the same functionality is implemented in a
different way. This was not done arbitrarilythere are good reasons for the changes. But
you must be prepared to unlearn old habits and form new ones. Next, you must be open
to the new concepts. Full object orientation, new component techniques, new visual tools
for both local and Internet interfacesall of these and more must become part of your
skill.
THE IMPORTANCE OF VISUAL BASIC

Early in the adoption cycle of .NET, Microsofts new language, C#, got the lions
share of attention. But as .NET adoption has increased, Visual Basics continuing
importance has also been apparent. Microsoft has publicly stated that they consider
Visual Basic the language of choice for applications where developer productivity is one
of the highest priorities. Future development of Visual Basic is emphasizing capabilities
that enable access to the whole expanse of the .NET Framework in the most productive
way, while C# development is emphasizing the experience of writing code. That fits the
traditional role of Visual Basic as the language developers use in the real world to create
business applications as quickly as possible. This difference is more than academic.
One of the most important advantages of the .NET Framework is that it allows
applications to be written with dramatically less code. In the world of business
applications, the goal is to concentrate on writing business logic and to eliminate routine
coding tasks as much as possible. The value in this new world is not in churning out lots
of codeit is in writing robust, useful applications with as little code as possible.
AN OVERVIEW OF THE .NET FRAMEWORK
.NET is a framework that covers all the layers of software development above the
operating system level. It provides the richest level of integration among presentation
technologies, component Technologies and data technologies ever seen on a Microsoft, or
perhaps any, platform. Second, the entire architecture has been created to make it as easy
to develop Internet applications as it is to develop for the desktop. The .NET Framework
actually wraps the operating system, insulating software developed with .NET from
most operating system specifics such as file handling and memory allocation. This
prepares for a possible future in which the software developed for .NET is portable to a
wide variety of hardware and operating system foundations.
VS.NET supports Windows 2003, Windows XP, and all versions of Windows
2000. Programs created for .NET can also run under Windows NT, Windows 98, and
Windows Me, though VS.NET does not run on these systems. Note that in some cases
certain service packs are required to run .NET. The framework starts all the way down at
the memory management and component loading level and goes all the way up to

multiple ways of rendering user and program interfaces. In between, there are layers that
provide just about any system-level capability that a developer would need.

MICROSOFT .NET
At the base is the common language runtime, often abbreviated to CLR. This is
the heart of the .NET Framework it is the engine that drives key functionality. It includes,
for example, a common system of data types. These common types, plus a standard
interface convention, make cross-language inheritance possible. In addition to allocation
and management of memory, the CLR also does reference tracking for objects and
handles garbage collection. The middle layer includes the next generation of standard
system Services such as classes that manage data and Extensible Markup Language
(XML). These services are brought under control of the Framework, making them
universally available and making their usage consistent across languages. The top layer
includes user and program interfaces.
Windows Forms is a new and more advanced way to do standard Win32 screens
(often referred to as smart clients). Web Forms provides a new Web-based user
interface. Perhaps the most revolutionary is Web Services, which provide a mechanism
for programs to communicate over the Internet, using SOAP. Web Services provide an
analog of COM and DCOM for object brokering and interfacing, but based on Internet
technologies so that allowance is made even for integration to non-Microsoft platforms.
Web Forms and Web Services, which constitute the Internet interface portion of .NET, are
implemented by a part of the .NET Framework referred to as ASP.NET.

FEATURES OF ASP.NET
ASP.NET is the next version of Active Server Pages (ASP); it is a unified Web
development platform that provides the services necessary for developers to build
enterprise-class Web applications. While ASP.NET is largely syntax compatible, it also
provides a new programming model and infrastructure for more secure, scalable, and
stable applications. ASP.NET is a compiled, NET-based environment; we can author
applications in any .NET compatible language, including Visual Basic .NET, C#, and
JScript. Additionally, the entire .NET Framework is available to any ASP.NET
application. Developers can easily access the benefits of these technologies, which
include the managed common language runtime environment (CLR), type safety,
inheritance, and so on.
ASP.NET has been designed to work seamlessly with WYSIWYG HTML editors
and other programming tools, including Microsoft Visual Studio .NET. Not only does this
make Web development easier, but it also provides all the benefits that these tools have to
offer, including a GUI that developers can use to drop server controls onto a Web page
and fully integrated debugging support. Developers can choose from the following two
features when creating an ASP.NET application. Web Forms and Web services, or
combine these in any way they see fit. Each is supported by the same infrastructure that
allows you to use authentication schemes; cache frequently used data, or customizes your
application's configuration, to name only a few possibilities.
Web Forms allows us to build powerful forms-based Web pages. When building
these pages, we can use ASP.NET server controls to create common UI elements, and
program them for common tasks. These controls allow to rapidly building a Web Form
out of reusable built-in or custom components, simplifying the code of a page. An XML
Web service provides the means to access server functionality remotely. Using Web
services, businesses can expose programmatic interfaces to their data or business logic,
which in turn can be obtained and manipulated by client and server applications. XML
Web services enable the exchange of data in client-server or server-server scenarios,
using standards like HTTP and XML messaging to move data across firewalls. XML Web
services are not tied to a particular component technology or object-calling convention.

As a result, programs written in any language, using any component model, and running
on any operating system can access XML Web services. Each of these models can take
full advantage of all ASP.NET features, as well as the power of the .NET Framework
and .NET Framework common language runtime.
Accessing databases from ASP.NET applications is an often-used technique for
displaying data to Web site visitors. ASP.NET makes it easier than ever to access
databases for this purpose. It also allows us to manage the database from your code.
ASP.NET provides a simple model that enables Web developers to write logic that runs at
the application level. Developers can write this code in the global.aspx text file or in a
compiled class deployed as an assembly. This logic can include application-level events,
but developers can easily extend this model to suit the needs of their Web application.
ASP.NET provides easy-to-use application and session-state facilities that are familiar to
ASP developers and are readily compatible with all other .NET Framework APIs.
ASP.NET offers the IHttpHandler and IHttpModule interfaces. Implementing the
IHttpHandler interface gives you a means of interacting with the low-level request and
response services of the IIS Web server and provides functionality much like ISAPI
extensions, but with a simpler programming model. Implementing the IHttpModule
interface allows you to include custom events that participate in every request made to
your application. ASP.NET takes advantage of performance enhancements found in
the .NET Framework and common language runtime. Additionally, it has been designed
to offer significant performance improvements over ASP and other Web development
platforms. All ASP.NET code is compiled, rather than interpreted, which allows early
binding, strong typing, and just-in-time (JIT) compilation to native code, to name only a
few of its benefits.
ASP.NET is also easily factorable, meaning that developers can remove modules
(a session module, for instance) that are not relevant to the application they are
developing. ASP.NET provides extensive caching services (both built-in services and
caching APIs). ASP.NET also ships with performance counters that developers and
system administrators can monitor to test new applications and gather metrics on existing
applications. Writing custom debug statements to your Web page can help immensely in

troubleshooting your application's code. However, it can cause embarrassment if it is not


removed. The problem is that removing the debug statements from your pages when your
application is ready to be ported to a production server can require significant effort.
ASP.NET offers the Trace Context class, which allows us to write custom debug
statements to our pages as we develop them. They appear only when you have enabled
tracing for a page or entire application. Enabling tracing also appends details about a
request to the page, or, if you so specify, to a custom trace viewer that is stored in the root
directory of your application.
The .NET Framework and ASP.NET provide default authorization and
authentication schemes for Web applications. We can easily remove, add to, or replace
these schemes, depending upon the needs of our application. ASP.NET configuration
settings are stored in XML-based files, which are human readable and writable. Each of
our applications can have a distinct configuration file and we can extend the
configuration scheme to suit our requirements.
THE .NET FRAMEWORK
The .NET Framework is a new computing platform that simplifies application
development in the highly distributed environment of the Internet.

OBJECTIVES OF .NET FRAMEWORK


1. To provide a consistent object-oriented programming environment whether
object codes is stored and executed locally on Internet-distributed, or executed remotely.
2. To provide a code-execution environment to minimizes software deployment
and guarantees safe execution of code.
3. Eliminates the performance problems.
There are different types of application, such as Windows-based applications and
Web-based applications. To make communication on distributed environment to ensure
that code be accessed by the .NET Framework can integrate with any other code.

THE COMMON LANGUAGE RUNTIME (CLR)


The common language runtime is the foundation of the .NET Framework. It
manages code at execution time, providing important services such as memory
management, thread management, and removing and also ensures more security and
robustness. The concept of code management is a fundamental principle of the runtime.
Code that targets the runtime is known as managed code, while code that does not target
the runtime is known as unmanaged code.

THE .NET FRAME WORK CLASS LIBRARY


It is a comprehensive, object-oriented collection of reusable types used to develop
applications ranging from traditional command-line or graphical user interface (GUI)
applications to applications based on the latest innovations provided by ASP.NET, such as
Web Forms and XML Web services. The .NET Framework can be hosted by unmanaged
components that load the common language runtime into their processes and initiate the
execution of managed code, thereby creating a software environment that can exploit
both managed and unmanaged features. The .NET Framework not only provides several
runtime hosts, but also supports the development of third-party runtime hosts. Internet
Explorer is an example of an unmanaged application that hosts the runtime (in the form
of a MIME type extension). Using Internet Explorer to host the runtime to enables
embeds managed components or Windows Forms controls in HTML documents.

FEATURES OF THE COMMON LANGUAGE RUNTIME


The common language runtime manages memory; thread execution, code
execution, code safety verification, compilation, and other system services these are all
run on CLR.

Security.

Robustness.

Productivity.

Performance.

SECURITY

The runtime enforces code access security. The security features of the runtime
thus enable legitimate Internet-deployed software to be exceptionally featuring rich. With
regards to security, managed components are awarded varying degrees of trust,
depending on a number of factors that include their origin to perform file-access
operations, registry-access operations, or other sensitive functions.

ROBUSTNESS
The runtime also enforces code robustness by implementing a strict type- and
code-verification infrastructure called the common type system (CTS). The CTS ensures
that all managed code is self-describing. The managed environment of the runtime
eliminates many common software issues.

PRODUCTIVITY
The runtime also accelerates developer productivity. For example, programmers
can write applications in their development language of choice, yet take full advantage of
the runtime, the class library, and components written in other languages by other
developers.

PERFORMANCE

The runtime is designed to enhance performance. Although the common language


runtime provides many standard runtime services, managed code is never interpreted. A
feature called just-in-time (JIT) compiling enables all managed code to run in the native
machine language of the system on which it is executing. Finally, the runtime can be
hosted by high-performance, server-side applications, such as Microsoft SQL Server
and Internet Information Services (IIS)

DATA ACCESS WITH ADO.NET


As you develop applications using ADO.NET, you will have different
requirements for working with data. You might never need to directly edit an XML file
containing data - but it is very useful to understand the data architecture in ADO.NET.
ADO.NET offers several advantages over previous versions of ADO:

Interoperability

Maintainability

Programmability

Performance Scalability

INTEROPERABILITY
ADO.NET applications can take advantage of the flexibility and broad acceptance
of XML. Because XML is the format for transmitting datasets across the network, any
component that can read the XML format can process data. The receiving component
need not be an ADO.NET component. The transmitting component can simply transmit
the dataset to its destination without regard to how the receiving component is
implemented. The destination component might be a Visual Studio application or any
other application implemented with any tool whatsoever. The only requirement is that the
receiving component be able to read XML. SO, XML was designed with exactly this kind
of interoperability in mind.

MAINTAINABILITY
In the life of a deployed system, modest changes are possible, but substantial,
Architectural changes are rarely attempted because they are so difficult. As the
performance load on a deployed application server grows, system resources can become
scarce and response time or throughput can suffer. Faced with this problem, software
architects can choose to divide the server's business-logic processing and user-interface
processing onto separate tiers on separate machines. In effect, the application server tier
is replaced with two tiers, alleviating the shortage of system resources. If the original
application is implemented in ADO.NET using datasets, this transformation is made
easier. ADO.NET data components in Visual Studio encapsulate data access functionality
in various ways that help you program more quickly and with fewer mistakes.

PERFORMANCE
ADO.NET datasets offer performance advantages over ADO disconnected record
sets. In ADO.NET data-type conversion is not necessary.

SCALABILITY
ADO.NET accommodates scalability by encouraging programmers to conserve
limited resources. Any ADO.NET application employs disconnected access to data; it
does not retain database locks or active database connections for long durations.

VISUAL STUDIO .NET

Visual Studio .NET is a complete set of development tools for building ASP Web
applications, XML Web services, desktop applications, and mobile applications In
addition to building high-performing desktop applications, you can use Visual Studio's
powerful component-based development tools and other technologies to simplify teambased design, development, and deployment of Enterprise solutions. Visual Basic .NET,
Visual C++ .NET, and Visual C# .NET all use the same integrated development
environment (IDE), which allows them to share tools and facilitates in the creation of
mixed-language solutions. In addition, these languages leverage the functionality of
the .NET Framework and simplify the development of ASP Web applications and XML
Web services.
Visual Studio supports the .NET Framework, which provides a common language
runtime and unified programming classes; ASP.NET uses these components to create
ASP Web applications and XML Web services. Also it includes MSDN Library, which
contains all the documentation for these development tools. XML WEB SERVICES
XML Web services are applications that can receive the requested data using XML over
HTTP. XML Web services are not tied to a particular component technology or objectcalling convention but it can be accessed by any language, component model, or
operating system. In Visual Studio .NET, you can quickly create and include XML Web
services using Visual Basic, Visual C#, JScript, Managed Extensions for C++, or ATL
Server.

XML SUPPORT
Extensible Markup Language (XML) provides a method for describing structured
data. XML is a subset of SGML that is optimized for delivery over the Web. The World
Wide Web Consortium (W3C) defines XML standards so that structured data will be
uniform and independent of applications. Visual Studio .NET fully supports XML,
providing the XML Designer to make it easier to edit XML and create XML schemas.

COMMON LANGUAE SPEGIFICATION (CLS)


Visual Basic.NET is also compliant with CLS (Common Language Specification)
and supports structured exception handling. CLS is set of rules and constructs that are
supported by the CLR (Common Language Runtime). CLR is the runtime environment
provided by the .NET Framework; it manages the execution of the code and also makes
the development process easier by providing services. Visual Basic.NET is a CLScompliant language. Any objects, classes, or components that created in Visual
Basic.NET can be used in any other CLS-compliant language. In addition, we can use
objects, classes, and components created in other CLS-compliant languages in Visual
Basic.NET .The use of CLS ensures complete interoperability among applications,
regardless of the languages used to create the application.

IMPLEMENTATION INHERITANCE
Visual Basic.NET supports implementation inheritance. This means that, while
creating applications in Visual Basic.NET, we can drive from another class, which is
known as the base class that derived class inherits all the methods and properties of the
base class. In the derived class, we can either use the existing code of the base class or
override the existing code. Therefore, with help of the implementation inheritance, code
can be reused.

CONSTRUCTORS AND DESTRUCTORS


Constructors are used to initialize objects, whereas destructors are used to destroy
them. In other words, destructors are used to release the resources allocated to the object.
In Visual Basic.NET the sub finalize procedure is available. The sub finalize procedure is
used to complete the tasks that must be performed when an object is destroyed. The sub
finalize procedure is called automatically when an object is destroyed. In addition, the
sub finalize procedure can be called only from the class it belongs to or from derived
classes.

GARBAGE COLLECTION
Garbage Collection is another new feature in Visual Basic.NET. The .NET
Framework monitors allocated resources, such as objects and variables. In addition,
the .NET Framework automatically releases memory for reuse by destroying objects that
are no longer in use. In Visual Basic.NET, the garbage collector checks for the objects
that are not currently in use by applications. When the garbage collector comes across an
object that is marked for garbage collection, it releases the memory occupied by the
object.

OVERLOADING
Overloading is another feature in Visual Basic.NET. Overloading enables us to
define multiple procedures with the same name, where each procedure has a different set
of arguments. Besides using overloading for procedures, we can use it for constructors
and properties in a class.

MULTITHREADING
Visual Basic.NET also supports multithreading. An application that supports
multithreading can handle multiple tasks simultaneously, we can use multithreading to
decrease the time taken by an application to respond to user interaction. To decrease the
time taken by an application to respond to user interaction, we must ensure that a separate
thread in the application handles user interaction.

STRUCTURED EXCEPTION HANDLING

Visual Basic.NET supports structured handling, which enables us to detect and


remove errors at runtime. In Visual Basic.NET, we need to use TryCatchFinally
statements to create exception handlers.

ABOUT SQL STRUCTURED QUERY LANGUAGE

FEATURES OF SQL SERVER 2000


The OLAP Services feature available in SQL Server version 7.0 is now called
SQL Server 2000 Analysis Services. The term OLAP Services has been replaced with the
term Analysis Services. Analysis Services also includes a new data mining component.
The Repository component available in SQL Server version 7.0 is now called Microsoft
SQL Server 2000 Meta Data Services. References to the component now use the term
Meta Data Services. The term repository is used only in reference to the repository engine
within Meta Data Services
SQL-SERVER database consist of six type of objects,
They are,

TABLE

QUERY

FORM

REPORT

MACRO

TABLES
In relational database systems (DBS) data are represented using tables (relations).
A query issued against the DBS also results in a table. A table has the following structure:
Column 1 Column 2 . . . Column n
A table is uniquely identified by its name and consists of rows that contain the
stored information, each row containing exactly one tuple (or record). A table can have
one or more columns.
A column is made up of a column name and a data type, and it describes an
attribute of the tuples. The structure of a table, also called relation schema, thus is defined
by its attributes.
The type of information to be stored in a table is defined by the data types of the
attributes at table creation time.
SQL uses the terms table, row, and column for relation, tuple, and attribute,
respectively. In this tutorial we will use the terms interchangeably.

A table can have up to 254 columns which may have different or same data types
and sets of values (domains), respectively. Possible domains are alphanumeric data
(strings), numbers and date formats. SQL offers the following basic data types:

char (n): Fixed-length character data (string), n characters long. The maximum
size for n is 255 bytes (2000 in Oracle8). Note that a string of type char is always
padded on right with blanks to full length of n. (+ can be memory consuming).
Example: char (40)

varchar2 (n): Variable-length character string. The maximum size for n is 2000
(4000 in Oracle8). Only the bytes used for a string require storage. Example:
varchar(80)
Number (o, d): Numeric data type for integers and reals. o = overall number of
digits, d = number of digits to the right of the decimal point. Maximum values: o
=38, d= 84 to +127. Examples: number (8), number (5,2)
Note that, e.g., number (5, 2) cannot contain anything larger than 999.99 without
resulting in an error. Data types derived from number are int [eger], dec [imal],
smallint and real.
Date: Date data type for storing date and time.
The default format for a date is: DD-MMM-YY. Examples: 13-OCT-94, 07JAN-98
Long: Character data up to a length of 2GB. Only one long column is allowed
per table.
Further properties of tables are:
The order in which tuples appear in a table is not relevant (unless a query
requires an explicit sorting).
A table has no duplicate tuples (depending on the query, however, duplicate
tuples can appear in the query result).
A database schema is a set of relation schemas. The extension of a database
schema at database run-time is called a database instance or database, for short.
VIEWS OF TABLE
We can work with a table in two types,

Design View

Datasheet View

Design View
To build or modify the structure of a table we work in the table design view. We
can specify what kind of data will be hold.
Datasheet View
To add, edit or analyses the data itself we work in tables datasheet view mode.

QUERY
A query is a question that has to be asked the data. Access gathers data that
answers the question from one or more table. The data that make up the answer is either
dynast (if you edit it) or a snapshot (it cannot be edited).Each time we run query, we get
latest information in the dynast. Access either displays the dynast or snapshot for us to
view or perform an action on it, such as deleting or updating.

FORMS
A form is used to view and edit information in the database record by record .A
form displays only the information we want to see in the way we want to see it. Forms
use the familiar controls such as textboxes and checkboxes. This makes viewing and
entering data easy.
Views of Form
We can work with forms in several primarily there are two views,
They are,

Design View

Form View

Design View

To build or modify the structure of a form, we work in forms design view. We can
add control to the form that are bound to fields in a table or query, includes textboxes,
option buttons, graphs and pictures.
Form View
The form view which display the whole design of the form.

SOURCE CODE
HOME PAGE:
ADMIN LOGIN:
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class AdminLogin : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text == "Admin" && TextBox2.Text == "Admin")
{
Response.Redirect("AdminPage.aspx");

}
else
{
Response.Write("Invalid UserId");
}
}
}
ADMIN PAGE
VOTING DATE DETAILS
SAVING DATE DETAILS
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class VotingDateDetails : System.Web.UI.Page
{
ClsDbLayer _ObjDb = new ClsDbLayer();
protected void Page_Load(object sender, EventArgs e)
{

}
CALENDAR
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
if (TextBox8.Text == "" && TextBox9.Text == "" && TextBox10.Text == "" &&
TextBox11.Text == "")
{
TextBox8.Text = Calendar1.SelectedDate.ToShortDateString();
TextBox9.Text = "";
TextBox10.Text = "";
TextBox11.Text = "";
}
else
{
if (TextBox9.Text == "" && TextBox10.Text == "" && TextBox11.Text == "")
{
TextBox9.Text = Calendar1.SelectedDate.ToShortDateString();
}
else
{
if (TextBox10.Text == "" && TextBox11.Text == "")
{
TextBox10.Text = Calendar1.SelectedDate.ToShortDateString();
}
else
{
if (TextBox11.Text == "")
{
TextBox11.Text = Calendar1.SelectedDate.ToShortDateString();
}

}
}
}
}
SAVING DATE DETAILS
protected void Button2_Click(object sender, EventArgs e)
{
string Query = "insert into Voting_Date values('" + TextBox8.Text + "','" +
TextBox9.Text + "','" + TextBox10.Text + "','" + TextBox11.Text + "')";
int i = _ObjDb.Insert(Query);
if (i != -1)
{
Response.Write("Saved Successfully");
}
else
{
Response.Write("Not Saved");
}
}
}
VOTER REGISTRATION
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;

using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class VoterRegistration : System.Web.UI.Page
{
ClsDbLayer objDb = new ClsDbLayer();
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToShortDateString();
string Query = "select Reg_Start_Date,Reg_End_Date from Voting_Date";
SqlDataReader dr = objDb.Select(Query);
if (dr.Read())
{
Label2.Text = dr[0].ToString();
Label3.Text = dr[1].ToString();
}
if (Label1.Text == Label2.Text && Label1.Text != Label3.Text)
{
Response.Write("You Can Register");
MultiView1.Visible = true;
}
else
{
Response.Write("Time Expired");
MultiView1.Visible = false;
}

}
protected void Button1_Click(object sender, EventArgs e)
{
string Query = "insert into
Voter_Reg(FName,LName,UName,Password,Address,Phone,Email) values('" +
TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text +
"','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "')";
int i = objDb.Insert(Query);
if (i != -1)
{
Response.Write("Register Successfully");
}
else
{
Response.Write("Not Saved");
}
SqlConnection connection = null;
try
{
FileUpload img = (FileUpload)FileUpload1;
Byte[] imgByte = null;
if (img.HasFile && img.PostedFile != null)
{
To create a PostedFile
HttpPostedFile File = FileUpload1.PostedFile;
Create byte Array with file len
imgByte = new Byte[File.ContentLength];
force the control to load data in array
File.InputStream.Read(imgByte, 0, File.ContentLength);
}
Insert the employee name and image into db

string

conn

ConfigurationManager.ConnectionStrings["EmployeeConnString"].ConnectionString;
connection = new SqlConnection();
connection.ConnectionString = "Data Source=localhost;Initial
Catalog=Cyber_Vote;Integrated Security=True";
string sql = "INSERT INTO Emp(empname,empid,imPhoto)
VALUES(@EmpName,@EmpId,@ImPhoto) SELECT @@IDENTITY";
SqlCommand cmd = new SqlCommand("Sp_Voter_Reg", connection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@FName", TextBox1.Text.Trim());
cmd.Parameters.AddWithValue("@LName", TextBox2.Text.Trim());
cmd.Parameters.AddWithValue("@UName", TextBox3.Text.Trim());
cmd.Parameters.AddWithValue("@Password", TextBox4.Text.Trim());
cmd.Parameters.AddWithValue("@Address", TextBox5.Text.Trim());
cmd.Parameters.AddWithValue("@Phone", TextBox6.Text.Trim());
cmd.Parameters.AddWithValue("@Email", TextBox7.Text.Trim());
cmd.Parameters.AddWithValue("@Secret_Qus", TextBox8.Text.Trim());
cmd.Parameters.AddWithValue("@Answer", TextBox9.Text.Trim());
cmd.Parameters.AddWithValue("@Photo", imgByte);
connection.Open();
cmd.Connection = connection;
int i = cmd.ExecuteNonQuery();
FileUpload1.SaveAs(Server.MapPath("Pho".ToString() + @"\" +
FileUpload1.FileName));
}
catch (Exception er)
{
Label1.Text = "There was an error";
}
finally

{
connection.Close();
}

}
protected void Button2_Click(object sender, EventArgs e)
{
}
}
VOTER PAGE
VOTER LOGIN
SIGN IN
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Drawing;
using System.Security.Cryptography;
using System.ComponentModel;
using System.IO;

public partial class VoterRegistration : System.Web.UI.Page


{
ClsDbLayer _objDb = new ClsDbLayer();
byte[] _barray1;
byte[] _barray2;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string Query = "select UName,Password from Voter_Reg where UName like '" +
TextBox1.Text + "'and Password like '" + TextBox2.Text + "' ";
SqlDataReader dr = _objDb.Select(Query);
if (dr.Read())
{
TextBox1.Text = dr[0].ToString();
TextBox2.Text = dr[1].ToString();
Response.Redirect("VotersPage.aspx");
}
else
{
Response.Write("Invalid User Id");
}
Image1.ImageUrl = "~/Handler.ashx?Name=" + TextBox1.Text;
Session["a"] = Image1.ImageUrl.ToString();
}
PHOTO BROWSE

COMPARE
protected void Button2_Click(object sender, EventArgs e)
{
try
{
Reading Bytes From Uploaded Images
Image1.ImageUrl = FileUpload1.PostedFile.FileName;
Image2.ImageUrl = FileUpload2.PostedFile.FileName;
if (FileUpload1.HasFile && FileUpload2.HasFile)
{
using

(BinaryReader

reader1

new

BinaryReader(FileUpload1.PostedFile.InputStream))
{
using (BinaryReader reader2 = new
BinaryReader(FileUpload2.PostedFile.InputStream))
{
_barray1 = reader1.ReadBytes(FileUpload1.PostedFile.ContentLength);
_barray2 = reader2.ReadBytes(FileUpload2.PostedFile.ContentLength);
}
}
}

Converting Byte Array To Image And Then Into Bitmap


ImageConverter ic = new ImageConverter();
ImageConverter ic = new ImageConverter();

Image img = (Image)ic.ConvertFrom(_barray1);


Bitmap bmp1 = new Bitmap(img);
Image img1 = (Image)ic.ConvertFrom(_barray2);
Bitmap bmp2 = new Bitmap(img1);
FileUpload1.SaveAs(Server.MapPath("img").ToString() + @"\" +
FileUpload1.FileName);
Calling Compare Function
if (Class1.Compare(bmp1, bmp2) == Class1.CompareResult.ciCompareOk)
{
Label1.Visible = true;
Label1.Text = "Images Are Same";
Button3.Enabled = true;
}
else

if

(Class1.Compare(bmp1,

bmp2)

==

(Class1.Compare(bmp1,

bmp2)

==

Class1.CompareResult.ciPixelMismatch)
{
Label1.Visible = true;
Label1.Text = "Pixel not Matching";
}
else
Class1.CompareResult.ciSizeMismatch)
{
Label1.Visible = true;
Label1.Text = "Size Is Not Same";
}
}
catch (Exception ex)
{
Label1.Visible = true;

if

Label1.Text = ex.Message.ToString();
}
}
GO TO VOTING PAGE
protected void Button3_Click(object sender, EventArgs e)
{
Response.Redirect("VotersPage.aspx");
}
}
VOTERS PAGE
VOTING
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class VotersPage : System.Web.UI.Page
{
ClsDbLayer objDb = new ClsDbLayer();
protected void Page_Load(object sender, EventArgs e)

{
Label1.Text = DateTime.Now.ToShortDateString();
string Query = "select Vot_Start_Date,Vot_End_Date from Voting_Date";
SqlDataReader dr = objDb.Select(Query);
if (dr.Read())
{
Label2.Text = dr[0].ToString();
Label3.Text = dr[1].ToString();
}
if (Label1.Text == Label2.Text && Label1.Text != Label3.Text)
{
Response.Write("You Can Vote According To the List");
Button2.Visible = true;
Button3.Visible = true ;
}
else
{
Response.Write("Time Expired");
Button2.Visible = false;
Button3.Visible = false;
}
}
VOTING REGULATIONS
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("VotingHomePage.aspx");
}

LOGOUT
protected void Button3_Click(object sender, EventArgs e)
{
Response.Redirect("VotingRegulations.aspx");
}
protected void Button4_Click(object sender, EventArgs e)
{
Response.Redirect("VoterLogin.aspx");
}
}

VOTING PAGE
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class VotingHomePage : System.Web.UI.Page
{
ClsDbLayer _objDb = new ClsDbLayer();
protected void Page_Load(object sender, EventArgs e)

{
}
protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
int i;
if (RadioButton1.Checked == true)
{
RadioButton2.Checked = false;
RadioButton3.Checked = false;
RadioButton4.Checked = false;
string Query = "update Cast_Vote set A_AAAA=A_AAAA+1";
i = _objDb.Insert(Query);
if (i != -1)
{
Response.Write("Voted Successfully");
RadioButton2.Enabled = false;
RadioButton3.Enabled = false;
RadioButton4.Enabled = false;
}
else
{
Response.Write("Error!Try Again");
}
}
}
protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
{
int i;

if (RadioButton2.Checked == true)
{
RadioButton1.Checked = false;
RadioButton3.Checked = false;
RadioButton4.Checked = false;
string Query = "update Cast_Vote set A_AAAA=A_AAAA+1";
i = _objDb.Insert(Query);
if (i != -1)
{
Response.Write("Voted Successfully");
RadioButton1.Enabled = false;
RadioButton3.Enabled = false;
RadioButton4.Enabled = false; ;
}
else
{
Response.Write("Error!Try Again");
}
}
}
protected void RadioButton3_CheckedChanged(object sender, EventArgs e)
{
int i;
if (RadioButton3.Checked == true)
{
RadioButton1.Checked = false;
RadioButton2.Checked = false;
RadioButton4.Checked = false;
string Query = "update Cast_Vote set A_AAAA=A_AAAA+1";
i = _objDb.Insert(Query);

if (i != -1)
{
Response.Write("Voted Successfully");
RadioButton1.Enabled = false;
RadioButton2.Enabled = false;
RadioButton4.Enabled = false;
}
else
{
Response.Write("Error!Try Again");
}
}
}
protected void RadioButton4_CheckedChanged(object sender, EventArgs e)
{
int i;
if (RadioButton4.Checked == true)
{
RadioButton1.Checked = false;
RadioButton2.Checked = false;
RadioButton3.Checked = false;
string Query = "update Cast_Vote set A_AAAA=A_AAAA+1";
i = _objDb.Insert(Query);
if (i != -1)
{
Response.Write("Voted Successfully");
RadioButton1.Enabled = false;
RadioButton2.Enabled = false;
RadioButton3.Enabled = false;
}

else
{
Response.Write("Error!Try Again");
}
}
}
}

VOTING RESULT
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class VotingResults : System.Web.UI.Page
{
ClsDbLayer _objDb = new ClsDbLayer();
protected void Page_Load(object sender, EventArgs e)
{
string Query = "select * from Cast_Vote";

DataSet ds = _objDb.Display(Query);
GridView1.DataSource = ds;
GridView1.DataBind();
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}

SCREEN LAYOUT

HOME PAGE:

ADMIN PAGE:

VOTING REGULATIONS PAGE:

VOTING DATE

REGISTER PAGE

VOTER S SIGN IN PAGE:

LIST PAGE

REGULATION PAGE:

VOTING PAGE

RESULT PAGE

SQL TABLES:

CONCLUSION:
From a proper analysis of positive points and constraints on the component, it
can be safely concluded that the Image Processing is a highly efficient component. This
application is working properly and meeting to all user requirements. This component can
be easily plugged in many other systems.

REFERENCE
1. Azriel Rosenfeld, Picture Processing by Computer, New York: Academic Press, 1969
2."Space Technology Hall of Fame: Inducted Technologies/1994". Space Foundation.
1994. Retrieved 7 January 2010.
3. A Brief, Early History of Computer Graphics in Film, Larry Yaeger, 16 August 2002
(last update), retrieved 24 March 2010.

You might also like