Sie sind auf Seite 1von 72

ONLINE CERTIFICATE VERIFICATON

ABSTRACT:

Some of them will go to countries, high schools or tertiary institutions to continue to attend,
and some will be ready to enter the workplace employment. During the course of study, the
students all kinds of excellent performance certificates, score transcripts, diplomas, etc., will
become an important reference for admitting new schools or new works. As schools make
various awards or diplomas, only the names of the schools and the students are input. Due to
the lack of effective anti-forge mechanism, events that cause the graduation certificate to be
forged often get noticed. In order to solve the problem of counterfeiting certificates, the
digital certificate system based on blockchain technology would be proposed. By the
unmodifiable property of blockchain. It will provide the demand unit to verify the
authenticity of the paper certificate through mobile phone scanning or website inquiries.
Through the unmodifiable properties of the blockchain, the system not only enhances the
credibility of various paper-based certificates, but also electronically reduces the loss risks of
various types of certificates.
TABLE OF CONTENTS

Title CONTENTS Page No.

1 CHAPTER 1 : INTRODUCTION

1.1 EXISTING SYSTEM


1.1.1 HARDWARE CONFIGURATION
1.1.2 SOFTWARE SPECIFICATION

2. CHAPTER 2 : SYSTEM STUDY

2.1 EXISTING SYSTEM

2.1.1DRAWBACKS

2.2 PROPOSED SYSTEM

2.2,1FEATURES

3. SYSTEM DESIGN AND DEVELOPMENT

3.1 FILE DESIGN

3.2 INPUT DESIGN

3.3OUTPUT DESIGN

3.4 DATABASE DESIGN

3.5SYSTEM DEVELOPMENT

3.5.1DESCRIPTION OF MODULES

4. CHAPTER 4 : TESTING AND IMPLEMENTATION


5. CHAPTER 5: CONCLUSION BIBLIOGRAPHY

APPENDICES

A.DATA FLOW DIAGRAM

B.TABLE STRUCTURE

C.SAMPLE CODING

D.SAMPLE INPUT

E.SAMPLE OUTPUT

CHAPTER 1

INTRODUCTION
Advances in information technology, the wide availability of the Internet, and
common usage of mobile devices have changed the lifestyle of human beings. Virtual
currency, digital coins originally designed for use online, has begun tobe extensively adopted
in real life. Because of theconvenience of the Internet, various virtual currencies arethriving,
including the most popularBitcoin, Ether, and Ripple the value of which has surged recently.
Peopleare beginning to pay attention to blockchain, the backbonetechnology of these
revolutionary currencies. Blockchainfeatures a decentralized and incorruptible database that
hashigh potential for a diverse range of uses.
Blockchain is a distributed database that is widely used forrecording distinct
transactions. Once a consensus is reached among different nodes, the transaction is added to a
block that already holds records of several transactions. Each block contains the hash value of
its last counterpart for connection.All the blocks are connected and together they form a
blockchain.
Data are distributed among various nodes (thedistributed data storage) and are thus
decentralized. Consequently, the nodes maintain the database together. Under blockchain, a
block becomes validated only once it has been verified by multiple parties. Furthermore, the
data in blocks cannot be modified arbitrarily.
A blockchain-based smart contract, for example, creates a reliable system because it
dispels doubts about information’s veracity. Because information technology has developed
rapidly in recent years, data protection is more necessary than ever. Graduates, whether they
choose to continue studying or start job hunting, require various certificates for interviews.
However, they often find that they have lost their educational and commendation certificates.
Reapplying for hard copies can be time-consuming because certificates are granted by
different organizations and in-person application may be necessary. By contrast, applying for
an e-copy can save paper and time. By providing information for identity verification,
graduates are able to apply for any certificate easily. Nevertheless, because of this
convenience, forged degree certificates, licenses, and certificates are prevalent. Consequently,
schools and companies cannot instantly validate the documents they receive. To solve this
problem, a certificate system based on blockchain was designed in this study. Data are stored
in different nodes, and anyone who wishes to modify a particular internal datum must request
that other nodes modify it simultaneously. Thus, the system is highly reliable.
1.2 SOFTWARE SPECIFICATION
This chapter is about the software language and the tools used in the development of
the project. The platform used here is .NET. The Primary languages are C#, VB, and J#. In
this project C# is chosen for implementation.

1.2.1 HARDWARE CONFIGURATION


 Processor : Pentium Dual Core 2.00GHZ
 Hard disk : 40 GB
 Mouse : Logitech.
 RAM : 4 GB(Minimum)
 Keyboard : 110 keys enhanced

1.2.2 SOFTWARE CONFIGURATION


 Operating system : Windows 7(service pack1),8,8.1 and 10
 Front End :Microsoft Visual Studio 2017
 Coding Language : C#
 Backend : SQL Server 2012
 
2. SYSTEM STUDY

2.1 EXISTING SYSTEM

Blockchain is an online ledger that provides decentralized and transparent data


sharing. With distributed recordings, all transaction data (stored in nodes) are compressed and
added to different blocks. Data of various types are distributed in distinct blocks, enabling
verifications to be made without the use of intermediaries. All the nodes then form a
blockchain with timestamps. The data stored in each block can be verified simultaneously
and become inalterable once entered. The whole process is open to the public, transparent,
and secure.
2.1.1 DRAWBACKS:
The key issues in students certificate verification and validation for schools,
universities, and also banks and other businesses are in storage, retrieval and access to data.

2.2 PROPOSED SYSTEM:


Data security is one of the major features of blockchain technology. Blockchain is a
large and open-access online ledger in which each node saves and verifies the same data.
Using the proposed blockchain-based system reduces the likelihood of certificate forgery.
The process of certificate application and automated certificate granting are open and
transparent in the system. Blockchain is a decentralized distributed database. The working
processes of the system developed in this study are as follows: Schools grant a degree
certificate and enter the student’s data into the system. Next, the system automatically records
the serial number of the student in a blockchain. The certificate system stores all the data in
the decentralised database. Instead of sending conventional hard copies, schools grant e-
certificates containing a quick saving all data in blockchain have been successfully saved.
Each graduate also receives an inquiry number and electronic file of their certificate graduate
simply sends the serial number or e-certificate units (i.e., Institution) have entered the
information of a graduate, the system creates an e-certificate containing a Hash code and
generates a serial number for the certificate. The data are then recorded in the blockchain.
Next, the system sends a notification and inquiry number to the graduate for future inquiries.
2.2.1 FEATURES:
Blockchain technology to solve certificate validation problems in storing and
accessing of data. Blockchain technology provides a common shared platform from where to
store, retrieve and access certificate and documents. The very nature of the technology is in
the distributed, shared, open ledgers, verifiable by all.

HOW TO VERIFY DOCUMENTS (CERTIFICATES) ON A BLOCKCHAIN


There are multiple numbers of ways through which one can verify the existence of a
document on the blockchain. The easiest of them is to re-upload the document to verify its
existence. Upon re-uploading of the document, the proof of its existence gets verified, as the
cryptographic digest and the marker for the transaction are also verified. The other ways are
to check the transaction record of the bitcoin blockchain to verify the existence of a time-
stamped document. Returning to the verification page of the original time-stamped document
also verifies its existence. Thus, the existence of a time-stamped document on a prior date
gets proven.This will help banks, educational institutions and healthcare industries verify
documents and certificates in very less time, cost, and effort.
3. SYSTEM DESIGN AND DEVELOPMENT:
3.1 FILE DESIGN:
OBJECTIVES

We developed a decentralized application and designed a certificate system based on


blockchain. This technology was selected because it is incorruptible, encrypted, and trackable
and permits data synchronization. By integrating the features of blockchain, the system
improves the efficiency operations at each stage. The system saves on paper, cuts
management costs, prevents document forgery, and provides accurate and reliable
information on digital certificates.
CHAPTER 2

LITERATURE SURVEY
Title: "Digital certificate for a painting based on blockchain technology"
Author:ZhenzhiQiu,
Year:2017
Description:

The concept of blockchain was proposed by SatoshiNakamoto in 2012. Blockchain is


an online ledger thatprovides decentralized and transparent data sharing. Withdistributed
recordings, all transaction data (stored in nodes)are compressed and added to different blocks.
Data of various types are distributed in distinct blocks, enabling verifications to be made
without the use of intermediaries. All the nodes then form a blockchain with timestamps. The
data stored ineach block can be verified simultaneously and becomeinalterable once entered.
The whole process is open to thepublic, transparent, and secure. The emergence of Ethereum
Smart Contracts in 2013 boosted blockchain technology, which became blockchain 2.0.
blockchain 1.0 was mainly adopted by Bitcoin to solve problems concerning cryptocurrencies
and decentralized payments. Blockchain 2.0 focused on decentralizing the entire market and
is employed to transform assets through smart contracts, thereby creating value through the
emergence of alternatives to Bitcoin .

Title: "Secure storage service of electronic ballot system based on block chain algorithm"
Author:Yong Shi,
Year:2017
Description:

Building an electronic voting system that satisfies the legal requirements of legislators
has been a challenge for a long time. Distributed ledger technologies is an exciting
technological advancement in the information technology world. Blockchain technologies
offer an infinite range of applications benefiting from sharing economies. This paper aims to
evaluate the application of blockchain as service to implement distributed electronic voting
systems. The paper elicitates the requirements of building electronic voting systems and
identifies the legal and technological limitations of using blockchain as a service for realizing
such systems. The paper starts by evaluating some of the popular blockchain frameworks that
offer blockchain as a service. We then propose a novel electronic voting system based on
blockchain that addresses all limitations we discovered. More generally this paper evaluates
the potential of distributed ledger technologies through the description of a case study,
namely the process of an election and implementing a blockchain-based application which
improves the security and decreases the cost of hosting a nationwide election.

Title: "Semi-centralized Blockchain Smart Contracts: Centralized Verification and Smart


Computing under Chains in the EthereumBlockchain"
Author:Xiuping Lin,
Year:2017
Description:

Smart contracts were first proposed by Nick Szabo in theearly 1990s. He explained
that a smart contract enabledcomputers to execute transaction clauses. As blockchain
hasbecome popular, smart contracts have received increasedattention. Smart contracts are the
main feature of Ethereum, ablockchain platform founded in 2015. A smart contract is
“adigital contract that is written in source code and executed bycomputers, which integrates
the tamper-proof mechanism ofblockchain”. Smart contracts can be created using
theEthereumblockchain. Developers are able, according to theirneeds, to specify any
instruction in smart contracts; developvarious types of applications, including those that
interactwith other contracts; store data; and transfer Ethers.Additionally, smart contracts that
are deployed in blockchainsare copied to each node to prevent contract tampering.
Withrelated operations executed by computers and servicesprovided by Ethereum, human
error can be reduced to avoiddisputes regarding such contracts. Smart contracts are mostly
used in voting system and cryptocurrency applications.smart contracts for cryptocurrency
transactions. Thehigh-level programming languages used for writing smartcontracts are
mainly Solidity, Serpent, and LLL.Currently, most developers employ Solidity to write
smartcontracts and compile the instructions into bytecode for theEVM to execute. Certain
costs are incurred when developerscreate smart contracts.

CHAPTER 3

PROJECT IMPLEMENTATION

PROJECT MODULES:
1. Students
2. Institution
3. BlockChain Network
4. Certificate Validation

1. Students
2. Institution

3. BlockChain Network
4. Certificate Validation

SYSTEM ARCHITECTURE
Blockchain is a decentralized distributed database. The working processes of the system
developed in this study are as follows:
1. Institution grant a degree certificate and enter the student’sdata into the system. Next, the
system automatically recordsthe serial number of the student in a blockchain.
2. The certificate system verifies all the data.
3. Instead of sending conventional hard copies, schools grante-certificates containing a quick
response hash code to thegraduates whose data have been successfully verified. Eachgraduate
also receives an inquiry number and electronic fileof their certificate.
4. When applying for a job, a graduate simply sends the serialnumber or e-certificate with a
hash code to the target

SYSTEM DESIGN:
USE CASE DIAGRAM:

A use case diagram is a type of behavioral diagram created from a Use-case


analysis. The purpose of use case is to present overview of the functionality provided by the
system in terms of actors, their goals and any dependencies between those use cases protected
visibility allows child classes to access information they inherited from a parent class.

CLASS DIAGRAM:
A class diagram in the UML is a type of static structure diagram that describes the
structure of a system by showing the system’s classes, their attributes, and the relationships
between the classes.

Private visibility hides information from anything outside the class partition. Public
visibility allows all other classes to view the marked information.

Protected visibility allows child classes to access information they inherited from a
parent class.

SEQUENCE DIAGRAM:
A sequence diagram in UML is a kind of interaction diagram that shows how the
processes operate with one another and in what order.

It is a construct of a message sequence chart. Sequence diagrams are sometimes


called Event-trace diagrams, event scenarios, and timing diagrams.

The below diagram shows the sequence flow shows how the process occurs in this
project.
ACTIVITY DIAGRAM:

Activity diagram are a loosely defined diagram to show workflows of stepwise


activities and actions, with support for choice, iteration and concurrency. UML, activity
diagrams can be used to describe the business and operational step-by-step workflows of
components in a system. UML activity diagrams could potentially model the internal logic of
a complex operation. In many ways UML activity diagrams are the object-oriented equivalent
of flow charts and data flow diagrams (DFDs) from structural development.
COMPONENT DIAGRAM:

Components are wired together by using an assembly connector to connect the


required interface of one component with the provided interface of another component. This
illustrates the service consumer - service provider relationship between the two
components.

An assembly connector is a "connector between two components that defines that one
component provides the services that another component requires. An assembly connector is
a connector that is defined from a required interface or port to a provided interface or port."
CHAPTER 4

REQUIREMENTS

4.1. GENERAL

Using this requirement, our application provides high service with efficiently.
Software requirements deal with defining software resource requirements and pre-requisites
that need to be installed on a server that provide optimal functioning of an application. These
requirements or pre-requisites are generally not included in the software installation package
and need to be installed separately before the software is installed. The most common set of
requirements defined by any operating system or software application is the physical
computer resources, also known as hardware, hardware requirements list is often
accompanied by a hardware compatibility list (HCL), especially in case of operating systems.
An HCL lists tested, compatible, and sometimes incompatible hardware devices for a
particular operating system or application. The following sub-sections discuss the various
aspects of hardware requirements.

CHAPTER 5

5.2. DOTNET

5.2 .1INTRODUCTION TO DOTNET

Microsoft .NET is a set of Microsoft software technologies for rapidly


building and integrating XML Web services, Microsoft Windows-based applications, and
Web solutions. The .NET Framework is a language-neutral platform for writing programs
that can easily and securely interoperate. There’s no language barrier with .NET: there are
numerous languages available to the developer including Managed C++, C#, Visual Basic
and Java Script. The .NET framework provides the foundation for components to interact
seamlessly, whether locally or remotely on different platforms. It standardizes common data
types and communications protocols so that components created in different languages can
easily interoperate.

“.NET” is also the collective name given to various software components


built upon the .NET platform. These will be both products (Visual Studio.NET and
Windows.NET Server, for instance) and services (like Passport, .NET My Services, and so
on).
5.2.2 THE .NET FRAMEWORK

The .NET Framework has two main parts:

1. The Common Language Runtime (CLR).

2. A hierarchical set of class libraries.

The CLR is described as the “execution engine” of .NET. It provides the environment within
which programs run.

The most important features are

 Conversion from a low-level assembler-style language, called Intermediate


Language (IL), into code native to the platform being executed on.
 Memory management, notably including garbage collection.
 Checking and enforcing security restrictions on the running code.
 Loading and executing programs, with version control and other such
features.
 The following features of the .NET framework are also worth description

5.2.3 MANAGE CODE

The code that targets .NET, and which contains certain extra Information - “metadata”
- to describe itself. Whilst both managed and unmanaged code can run in the runtime, only
managed code contains the information that allows the CLR to guarantee, for instance, safe
execution and interoperability.

5.2.4 MANAGE DATA

With Managed Code comes Managed Data. CLR provides memory allocation and
Deal location facilities, and garbage collection. Some .NET languages use Managed Data by
default, such as C#, Visual Basic.NET and JScript.NET, whereas others, namely C++, do not.
Targeting CLR can, depending on the language you’re using, impose certain constraints on
the features available. As with managed and unmanaged code, one can have both managed
and unmanaged data in .NET applications - data that doesn’t get garbage collected but instead
is looked after by unmanaged code.
5.2.5 COMMON TYPE SYSTEM (CTS)

The CLR uses something called the Common Type System (CTS) to strictly enforce
type-safety. This ensures that all classes are compatible with each other, by describing types
in a common way. CTS define how types work within the runtime, which enables types in
one language to interoperate with types in another language, including cross-language
exception handling. As well as ensuring that types are only used in appropriate ways, the
runtime also ensures that code doesn’t attempt to access memory that hasn’t been allocated to
it.

5.2.6 COMMON LANGUAGE SPECIFICATION

The CLR provides built-in support for language interoperability. To ensure that you
can develop managed code that can be fully used by developers using any programming
language, a set of language features and rules for using them called the Common Language
Specification (CLS) has been defined. Components that follow these rules and expose only
CLS features are considered CLS-compliant.

5.2.7 THE CLASS LIBRARY

.NET provides a single-rooted hierarchy of classes, containing over 7000 types. The
root of the namespace is called System; this contains basic types like Byte, Double, Boolean,
and String, as well as Object. All objects derive from System. Object. As well as objects,
there are value types. Value types can be allocated on the stack, which can provide useful
flexibility. There are also efficient means of converting value types to object types if and
when necessary.

The set of classes is pretty comprehensive, providing collections, file, screen, and
network I/O, threading, and so on, as well as XML and database connectivity. The class
library is subdivided into a number of sets (or namespaces), each providing distinct areas of
functionality, with dependencies between the namespaces kept to a minimum.

LANGUAGES SUPPORTED BY .NET

The multi-language capability of the .NET Framework and Visual Studio .NET
enables developers to use their existing programming skills to build all types of applications
and XML Web services. The .NET framework supports new versions of Microsoft’s old
favorites Visual Basic and C++ (as VB.NET and Managed C++), but there are also a number
of new additions to the family.

Visual Basic .NET has been updated to include many new and improved language
features that make it a powerful object-oriented programming language. These features
include inheritance, interfaces, and overloading, among others. Visual Basic also now
supports structured exception handling, custom attributes and also supports multi-threading.

Visual Basic .NET is also CLS compliant, which means that any CLS-compliant
language can use the classes, objects, and components you create in Visual Basic .NET.

Managed Extensions for C++ and attributed programming are just some of the enhancements
made to the C++ language. Managed Extensions simplify the task of migrating existing C++
applications to the new .NET Framework.

C# is Microsoft’s new language. It’s a C-style language that is essentially “C++ for Rapid
Application Development”. Unlike other languages, its specification is just the grammar of
the language. It has no standard library of its own, and instead has been designed with the
intention of using the .NET libraries as its own.

Microsoft Visual J# .NET provides the easiest transition for Java-language developers into
the world of XML Web Services and dramatically improves the interoperability of Java-
language programs with existing software written in a variety of other programming
languages.

Active State has created Visual Perl and Visual Python, which enable .NET-aware
applications to be built in either Perl or Python. Both products can be integrated into the
Visual Studio .NET environment. Visual Perl includes support for Active State’s Perl Dev
Kit.
FEATURES OF C#

1. C# is a simple, modern, object oriented language derived from C++ and Java. 
2. It aims to combine the high productivity of Visual Basic and the raw power of C++. 
3. It is a part of Microsoft Visual Studio7.0. 
4. Visual studio supports Vb, VC++, C++, Vbscript, Jscript. All of these languages provide
access to the Microsoft .NET platform. 
5. .NET includes a Common Execution engine and a rich class library. 
6. Microsoft's JVM equiv. is Common language run time (CLR). 
7. CLR accommodates more than one languages such as C#, VB.NET, Jscript, ASP.NET, C+
+. 
8. Source code --->Intermediate Language code (IL) ---> (JIT Compiler) Native code. 
9.The classes and data types are common to all of the .NET languages. 
10. We may develop Console application, Windows application, and Web application using
C#. 
11. In C# Microsoft has taken care of C++ problems such as Memory management, pointers
etc. 
12.It supports garbage collection, automatic memory management and a lot. 

MAIN FEATURES OF C# 


1. Pointers are missing in C#. 
2. Unsafe operations such as direct memory manipulation are not allowed. 
3. In C# there is no usage of "::" or "->" operators. 
4. Since it`s on .NET, it inherits the features of automatic memory management and garbage
collection. 
5. Varying ranges of the primitive types like Integer, Floats etc. 
6. Integer values of 0 and 1 are no longer accepted as Boolean values. Boolean values are
pure true or false values in C# so no more errors of "="operator and "=="operator. "==" is
used for comparison operation and "=" is used for assignment operation. 

TYPE SAFE 
1. In C# we cannot perform unsafe casts like convert double to a Boolean. 
2. Value types (primitive types) are initialized to zeros and reference types (objects and
classes are initialized to null by the compiler automatically. 
3. Arrays are zero base indexed and are bound checked. 
4. Overflow of types can be checked. 

INTEROPERABILITY 
1. C# includes native support for the COM and windows based applications. 
2. Allowing restricted use of native pointers. 
3. Users no longer have to explicitly implement the unknown and other COM interfaces,
those features are built in. 
4. C# allows the users to use pointers as unsafe code blocks to manipulate your old code. 
Objectives of .NET Framework

1. Platform dependent

2. Language Independent

3. Language Interoperability

4. Security

5. Database Connectivity
6. Globalization of Application

1. Platform Independent: As dll or exe files are executable in any operating system with the
help of the CLR (common language runtime), hence .net is called as platform independent.

2. Language Independent: As .net application logic can be developed in any .net framework
compatible languages, hence it is called as Language Independent.

Specification in ASP.net

It provides set of rules to be followed while integrating with the language.

Language Interoperability: The code written in one language should be used from the
application developed using other language.

Security: The .net applications attain high level of security.

Database Connectivity: A new Database connectivity model to connect Database.

Globalization of Application: Designing the applications for supporting multiple languages


and cultures.
5.5 COMPONETS OF .NET FRMEWORK

The .NET Framework is an integral Windows component that supports building and
running the next generation of applications and XML Web services. The .NET Framework is
designed to fulfill the following objectives:

 To provide a consistent object-oriented programming environment whether object


code is stored and executed locally, executed locally but Internet-distributed, or
executed remotely.
 To provide a code-execution environment that minimizes software deployment and
versioning conflicts.
 To provide a code-execution environment that promotes safe execution of code,
including code created by an unknown or semi-trusted third party.
 To provide a code-execution environment that eliminates the performance problems
of scripted or interpreted environments.
 To make the developer experience consistent across widely varying types of
applications, such as Windows-based applications and Web-based applications.
 To build all communication on industry standards to ensure that code based on the
.NET Framework can integrate with any other code.
The .NET Framework has two main components: the common language runtime and the
.NET Framework class library. The common language runtime is the foundation of the .NET
Framework. You can think of the runtime as an agent that manages code at execution time,
providing core services such as memory management, thread management, and remoting,
while also enforcing strict type safety and other forms of code accuracy that promote security
and robustness. In fact, the concept of code management is a fundamental principle of the
runtime. Code that targets the runtime is known as managed code, while code that does not
target the runtime is known as unmanaged code. The class library, the other main component
of the .NET Framework, is a comprehensive, object-oriented collection of reusable types that
you can use to develop applications ranging from traditional command-line or graphical user
interface (GUI) applications to applications based on the latest innovations provided by
ASP.NET, such as Web Forms and XML Web services.

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

For example, ASP.NET hosts the runtime to provide a scalable, server-side environment for
managed code. ASP.NET works directly with the runtime to enable ASP.NET applications
and XML Web services, both of which are discussed later in this topic.

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 enables you to
embed managed components or Windows Forms controls in HTML documents. Hosting the
runtime in this way makes managed mobile code (similar to Microsoft® ActiveX® controls)
possible, but with significant improvements that only managed code can offer, such as semi-
trusted execution and isolated file storage.

COMMON LANGUAGE RUNTIME


The common language runtime manages memory, thread execution, code execution, code
safety verification, compilation, and other system services. These features are intrinsic to the
managed code that runs on the common language runtime. With regards to security, managed
components are awarded varying degrees of trust, depending on a number of factors that
include their origin (such as the Internet, enterprise network, or local computer). This means
that a managed component might or might not be able to perform file-access operations,
registry-access operations, or other sensitive functions; even if it is being used in the same
active application. The runtime enforces code access security. For example, users can trust
that an executable embedded in a Web page can play an animation on screen or sing a song,
but cannot access their personal data, file system, or network. The security features of the
runtime thus enable legitimate Internet-deployed software to be exceptionally feature rich.

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 various Microsoft and third-party language compilers
generate managed code that conforms to the CTS. This means that managed code can
consume other managed types and instances, while strictly enforcing type fidelity and type
safety.

BASE CLASS LIBRARY

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

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

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

 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.

FEATURES OF THE COMMON LANGUAGE RUNTIME

Common Language Runtime is a heart of the .net framework. It actually manages the code


during Execution. The Code that runs under the CLR is called “Managed Code”. The code
that is executed  under .net runtime gets benefits like cross language inheritance,
cross language exception handling, enhanced Security, Versioning and development
support, a simplified model for component interaction, debugging and Profiling services.

FEATURES PROVIDED BY CLR

Automatic memory management: - The CLR provides the Garbage Collection feature for
managing the life time of object. This relives a programmer from memory management
task.

Standard Type System: - The CLR Implement a formal Specification called the Common
Type System (CTS). CTS is important part of rules that ensures that objects written in
different language can interact with each other.

Language interoperability: - It is the ability of an application to interact with another


application written in a different programming language. Language interoperability helps
maximum code reuse. The CLR provides support for language interoperability by
specifying and enforcing CTS and by providing metadata.
Platform Independence: - The Compiler compiles code language, which is CPU-
independent. This means that the code can be executed from any platform that supports
the .Net CLR.

Security Management: - In .net platform, Security is achieved through the code access
Security (CAS) model. In the model, CLR enforces the restriction an managed code
through the object called “permissions”. The CLR allows the code to perform only that
task for which it has permissions. In other words, the CAS model specifies what the code
can access instead of specifies who can access resources.
Type Safety: - This feature ensures that object is always accessed in compatible ways.
Therefore the CLR will prohibit a code from assign a 10-byte value to an object that
occupies 8 bytes.

BENEFITS OF CLR 

 Performance improvement
 The ability to easily use components developed in other languages.
 Extensible types provided by library.
 New Language features such as inheritance, interfaces etc.
 Complete Object-Oriented design.
 Very Strong Type Safety.
 A good blend of Visual Basic simplicity and c++ power.
 Syntax and keywords similar to c and c++.
 Use of delegates rather than function pointers for increased type safety and
security.

5.6 ASP.NET OVERVIEW

ASP.Net is a web development platform, which provides a programming model, a


comprehensive software infrastructure and various services required to build up robust web
application for PC, as well as mobile devices.

ASP.Net works on top of the HTTP protocol and uses the HTTP commands and policies to
set a browser-to-server two-way communication and cooperation.
ASP.Net is a part of Microsoft .Net platform. ASP.Net applications are complied codes,
written using the extensible and reusable components or objects present in .Net framework.
These codes can use the entire hierarchy of classes in .Net framework.

The ASP.Net application codes could be written in either of the following languages:

 C#
 Visual Basic .Net
 Jscript
 J#

ASP.Net is used to produce interactive, data-driven web applications over the internet. It
consists of a large number of controls like text boxes, buttons and labels for assembling,
configuring and manipulating code to create HTML pages.

ASP.Net Web Forms Model:

ASP.Net web forms extend the event-driven model of interaction to the web applications.
The browser submits a web form to the web server and the server returns a full markup page
or HTML page in response.

All client side user activities are forwarded to the server for stateful processing. The server
processes the output of the client actions and triggers the reactions.

Now, HTTP is a stateless protocol. ASP.Net framework helps in storing the information
regarding the state of the application, which consists of:

 Page state

 Session state

The page state is the state of the client, i.e., the content of various input fields in the web
form. The session state is the collective obtained from various pages the user visited and
worked with, i.e., the overall session state. To clear the concept, let us take up an example of
a shopping cart as follows.

User adds items to a shopping cart. Items are selected from a page, say the items page, and
the total collected items and price are shown in a different page, say the cart page. Only
HTTP cannot keep track of all the information coming from various pages. ASP.Net session
state and server side infrastructure keeps track of the information collected globally over a
session.

The ASP.Net runtime carries the page state to and from the server across page requests while
generating the ASP.Net runtime codes and incorporates the state of the server side
components in hidden fields.

This way the server becomes aware of the overall application state and operates in a two-
tiered connected way.

ASP.Net Component Model:

The ASP.Net component model provides various building blocks of ASP.Net pages.
Basically it is an object model, which describes:

 Server side counterparts of almost all HTML elements or tags, like <form> and
<input>.

 Server controls, which help in developing complex user-interface for example the
Calendar control or the Gridview control.

ASP.Net is a technology, which works on the .Net framework that contains all web-related
functionalities. The .Net framework is made of an object-oriented hierarchy. An ASP.Net
web application is made of pages. When a user requests an ASP.Net page, the IIS delegates
the processing of the page to the ASP.Net runtime system.

The ASP.Net runtime transforms the .aspx page into an instance of a class, which inherits
from the base class Page of the .Net framework. Therefore, each ASP.Net page is an object
and all its components i.e., the server-side controls are also objects.

5.6.1 ASP.NET ARCHITECTURE
ASP.NET is based on the fundamental architecture of .NET Framework. Visual studio
provide a uniform way to combine the various features of this Architecture.
Architecture is explained form bottom to top in the following discussion.

 At the bottom of the Architecture is Common Language Runtime. NET Framework


common language runtime resides on top of the operating system services. The
common language runtime loads and executes code that targets the runtime. This code
is therefore called managed code. The runtime gives you, for example, the ability for
cross-language integration. 

 .NET Framework provides a rich set of class libraries. These include base classes, like
networking and input/output classes, a data class library for data access, and classes
for use by programming tools, such as debugging services. All of them are brought
together by the Services Framework, which sits on top of the common language
runtime.

 ADO.NET is Microsoft’s ActiveX Data Object (ADO) model for the .NET
Framework. ADO.NET is not simply the migration of the popular ADO model to the
managed environment but a completely new paradigm for data access and
manipulation.

ADO.NET is intended specifically for developing web applications. This is evident


from its two major design principles:

 Disconnected Datasets—In ADO.NET, almost all data manipulation is done outside


the context of an open database connection.
 Effortless Data Exchange with XML—Datasets can converse in the universal data
format of the Web, namely XML.

 The 4th layer of the framework consists of the Windows application model and, in
parallel,theWebapplicationmodel.The Web application model-in the slide presented
as ASP.NET-includesWebFormsandWebServices.ASP.NET comes with built-in
Web Forms controls, which are responsible forgenerating the user interface. They
mirror typical HTML widgets like text boxes or buttons. If these controls do not fit
your needs, you are free to create your own user controls.

Web Services brings you a model to bind different applications over the Internet. This
model is based on existing infrastructure and applications and is therefore standard-
based,simple,andadaptable.

Web Services are software solutions delivered via Internet to any device. Today, that
means Web browsers on computers, for the most part, but the device-agnostic design
of .NET will eliminate this limitation. 
 One of the obvious themes of .NET is unification and interoperability between
various programming languages. In order to achieve this; certain rules must be laid
and all the languages must follow these rules. In other words we cannot have
languages running around creating their own extensions and their own fancy new data
types. CLS is the collection of the rules and constraints that every language (that
seeks to achieve .NET compatibility) must follow.
 The CLR and the .NET Frameworks in general, however, are designed in such a way
that code written in one language can not only seamlessly be used by another
language. Hence ASP.NET can be programmed in any of the .NET compatible
language whether it is VB.NET, C#, Managed C++ or JScript.NET.

5.6.2 ASP.NET PAGE LIFE CYCLE

ASP.Net life cycle specifies, how:

 ASP.Net processes pages to produce dynamic output

 The application and its pages are instantiated and processed


 ASP.Net compiles the pages dynamically

The ASP.Net life cycle could be divided into two groups:

 Application Life Cycle

 Page Life Cycle

ASP.Net Application Life Cycle:

The application life cycle has the following stages:

 User makes a request for accessing application resource, a page. Browser sends this
request to the web server.

 A unified pipeline receives the first request and the following events take place:

 An object of the ApplicationManager class is created.

 An object of the HostingEnvironment class is created to provide information


regarding the resources.

 Top level items in the application are compiled.

 Response objects are created .the application objects: HttpContext, HttpRequest and
HttpResponse are created and initialized.

 An instance of the HttpApplication object is created and assigned to the request. The
request is processed by the HttpApplication class. Different events are raised by this
class for processing the request.

ASP.Net Page Life Cycle:

When a page is requested, it is loaded into the server memory, processed and sent to the
browser. Then it is unloaded from the memory. At each of this steps, methods and events are
available, which could be overridden according to the need of the application. In other words,
you can write your own code to override the default code.

The Page class creates a hierarchical tree of all the controls on the page. All the components
on the page, except the directives are part of this control tree. You can see the control tree by
adding trace= "true" to the Page directive. We will cover page directives and tracing under
'directives' and 'error handling'.

The page life cycle phases are:

 Initialization

 Instantiation of the controls on the page

 Restoration and maintenance of the state

 Execution of the event handler codes

 Page rendering

Understanding the page cycle helps in writing codes for making some specific thing happen
at any stage of the page life cycle. It also helps in writing custom controls and initializing
them at right time, populate their properties with view-state data and run control behavior
code.

Following are the different stages of an ASP.Net page:

 Page request. when ASP.Net gets a page request, it decides whether to parse and
compile the page or there would be a cached version of the page; accordingly the
response is sent
 Starting of page life cycle. at this stage, the Request and Response objects are set. If
the request is an old request or post back, the IsPostBack property of the page is set to
true. The UICulture property of the page is also set.
 Page initialization. At this stage, the controls on the page are assigned unique ID by
setting the UniqueID property and themes are applied. For a new request postback
data is loaded and the control properties are restored to the view-state values.
 Page load. At this stage, control properties are set using the view state and control
state values.
 Validation. Validate method of the validation control is called and if it runs
successfully, the IsValid property of the page is set to true.
 Postback event handling. If the request is a postback (old request), the related event
handler is called.
 Page rendering. At this stage, view state for the page and all controls are saved. The
page calls the Render method for each control and the output of rendering is written to
the OutputStream class of the Page's Response property.
 Unload. The rendered page is sent to the client and page properties, such as Response
and Request are unloaded and all cleanup done.

 ASP.Net Page Life Cycle Events:

 At each stage of the page life cycle, the page raises some events, which could be
coded. An event handler is basically a function or subroutine, bound to the event,
using declarative attributes like onclick or handle.

 Following are the page life cycle events:


 PreInit. PreInit is the first event in page life cycle. It checks the IsPostBack property
and determines whether the page is a postback. It sets the themes and master pages,
creates dynamic controls and gets and sets profile property values. This event can be
handled by overloading the OnPreInit method or creating a Page_PreInit handler.
 Init . Init event initializes the control property and the control tree is built. This event
can be handled by overloading the OnInit method or creating a Page_Init handler.
 InitComplete . InitComplete event allows tracking of view state. All the controls turn
on view-state tracking.
 LoadViewState. LoadViewState event allows loading view state information into the
controls.
 LoadPostData. During this phase, the contents of all the input fields defined with the
<form> tag are processed.
 Preload. Preload occurs before the post back data is loaded in the controls. This event
can be handled by overloading the On Preload method or creating a Page_PreLoad
handler.
 Load. The Load event is raised for the page first and then recursively for all child
controls. The controls in the control tree are created. This event can be handled by
overloading the On Load method or creating a Page Load handler.
 Load Complete. The loading process is completed, control event handlers are run and
page validation takes place. This event can be handled by overloading the
OnLoadComplete method or creating a Page_LoadComplete handler.
 PreRender. The PreRender event occurs just before the output is rendered. By
handling this event, pages and controls can perform any updates before the output is
rendered.
 PreRenderComplete. As the PreRender event is recursively fired for all child
controls, this event ensures the completion of the pre-rendering phase.
 SaveStateComplete. State of control on the page is saved. Personalization, control
state and view state information is saved. The HTML markup is generated. This stage
can be handled by overriding the Render method or creating a Page Render handler.
 Unload. The Unload phase is the last phase of the page life cycle. It raises the Unload
event for all controls recursively and lastly for the page itself. Final cleanup is done
and all resources and references, such as database connections, are freed. This event
can be handled by modifying the On Unload method or creating a Page_UnLoad
handler.

An ASP.Net page is made of number of server controls along with the HTML controls, text
and images. Sensitive data from the page and the states of different controls on the page are
stored in hidden fields and forms the context of that page request.

ASP.Net runtime controls all association between a page instance and its state. An ASP.Net
page is an object of the Page Class or inherited from it.

All the controls on the pages are also objects of the related control class inherited from a
parent Control class. When a page is run an instance of the page object is created along with
all its content controls.

An ASP.Net page is also a server side file saved with the .aspx extension. It is modular in
nature and can be divided into the following core sections:

 Page directives

 Code Section

 Page Layout

 Page directives:

The page directives set up the environments for the page to run. The @Page directive defines
page-specific attributes used by the ASP.Net page parser and compiler. Page directives
specify how the page should be processed, and which assumptions are to be taken about the
page.

It allows importing namespaces, loading assemblies and registering new controls with custom
tag names and namespace prefixes. We will discuss all of these concepts in due time.

Code Section:

The code section provides the handlers for the page and control events along with other
functions required. We mentioned that, ASP.Net follows an object model. Now, these objects
raises events when something happens on the user interface, like a user clicks a button or
moves the cursor. How these events should be handled? That code is provided in the event
handlers of the controls, which are nothing but functions bound to the controls.

The code section or the code behind file provides all these event handler routines, and other
functions used by the developer. The page code could be precompiled and deployed in the
form of a binary assembly.

Page Layout:

 The page layout provides the interface of the page. It contains the server controls, text,
inline JavaScript and HTML tags:.

5.7 SQL SERVER 2012:

SQL Server 2005 will be soon reaching its three-year mark, which in terms of software life-
cycle translates into fairly advanced maturity. While this is still far from retirement age, the
name of its successor, SQL Server 2012, suggests that it might be time for you to start
looking into what the new generation has to offer. The release of SQL Server 2012, originally
introduced as Yukon, has already been postponed, but its current Beta 2 implementation
(with several incremental Community Technical Previews expected before Beta 3 becomes
available early next year) brings promise of a timely RTM stage (planned for summer next
year). In this series of articles, we will look into functional highlights of the new incarnation
of the Microsoft database management system, focusing on those that are likely to remain
unchanged in the final product.
Improvements to the database engine, the details of which are not published by Microsoft,
and the corresponding changes to the main infrastructure components are reflected by a
substantial number of new features as well as enhancements to existing ones. The most
relevant ones can be grouped into several categories, such as high availability and scalability,
security, data management, administration and maintenance, and development.

The demand for high availability is becoming increasingly common and is no longer limited
to major corporate and governmental clients. This results not only from a growing level of
customer expectations, but also from the new political climate associated with more stringent
legislative and regulatory requirements, in which disaster recovery and business continuity
are more relevant than ever. However, businesses are also, at the same time, extremely
interested in keeping their costs to a minimum. Microsoft tries to address these expectations
by implementing scalability enhancements, which ensure that SQL Server can perform
equally well in environments of any size, and by the introduction of several versions of SQL
Server 2012 (geared towards more specialized needs) such as:

 SQL Server Standard Edition - offering the most diverse set of features and intended
for the majority of clients.
 SQL Server 2012 Express Edition - serving as the replacement for Microsoft Data
Engine (MSDE) and available for download from t. Like its predecessor, it was
designed with developers in mind, however, unlike the previous version, it also
includes a Web based management interface.
 SQL Server 2012 Mobile Edition - as a successor to SQL Server 2012 Windows CE
Edition, it is intended for Windows mobile-based devices, such as Tablet PCs, Pocket
PCs, and Smart phones

5.7.1 FEATURES OF SQL SERVER

Microsoft SQL Server 2012

The following is a list of the new features provided in SQL Server 2012:

 Database mirroring

 Database snapshots

 CLR integration
 Service Broker

 Database Mail

 User-defined functions
 Indexed views
 Distributed partitioned views
 INSTEAD OF and AFTER triggers
 New data types
 Cascading RI constraints
 Multiple SQL Server instances
 XML support
 Log shipping

Database mirroring
Database mirroring is a new high-availability feature in SQL Server 2012. It's similar
to server clustering in that failover is achieved by the use of a stand-by server; the difference
is that the failover is at the database level rather than the server level. The primary database
continuously sends transaction logs to the backup database on a separate SQL Server
instance. A third SQL Server instance is then used as a witness database to monitor the
interaction between the primary and the mirror databases.

Database snapshots
A database snapshot is essentially an instant read-only copy of a database, and it is a
great candidate for any type of reporting solution for your company. In addition to being a
great reporting tool, you can revert control from your primary database to your snapshot
database in the event of an error. The only data loss would be from the point of creation of
the database snapshot to the event of failure.

CLR integration
With SQL Server 2012, you now have the ability to create custom .NET objects with
the database engine. For example, stored procedures, triggers, and functions can now be
created using familiar .NET languages such as VB and C#. Exposing this functionality gives
you tools that you never had access to before such as regular expressions.
Service Broker
This feature gives you the ability to create asynchronous, message-based applications
in the database entirely through TSQL. The database engine guarantees message delivery,
message order consistency, and handles message grouping. In addition, Service Broker gives
you the ability to send messages between different SQL Server instances. Server Broker is
also used in several other features in SQL Server 2012. For example, you can define Event
Nonfictions in the database to send a message to a Queue in the database when someone
attempts to alter a table structure, of if there is a string of login failures.Database Mail
Database Mail, the eventual successor to SQL Mail, is greatly enhanced e-mail
solution available in the database engine. With Database Mail, there is no longer a
dependency on Microsoft Outlook or MAPI e-mail clients. Database Mail uses standard
SMTP to send e-mail messages. These messages may contain query results, attachments
(which can be governed by the DBA), and is fully cluster aware. In addition, the e-mail
process runs outside of the database engine space, which means that messages can continue
to be queued even when the database engine has stopped.

User-Defined Functions

SQL Server has always provided the ability to store and execute SQL code routines
via stored procedures. In addition, SQL Server has always supplied a number of built-in
functions. Functions can be used almost anywhere an expression can be specified in a query.
This was one of the shortcomings of stored procedures—they couldn't be used in line in
queries in select lists, where clauses, and so on. Perhaps you want to write a routine to
calculate the last business day of the month. With a stored procedure, you have to exec the
procedure, passing in the current month as a parameter and returning the value into an output
variable, and then use the variable in your queries. If only you could write your own function
that you could use directly in the query just like a system function. In SQL Server 2012, you
can.

SQL Server 2012 introduces the long-awaited support for user-defined functions.
User-defined functions can take zero or more input parameters and return a single value—
either a scalar value like the system-defined functions, or a table result. Table-valued
functions can be used anywhere table or view expressions can be used in queries, and they
can perform more complex logic than is allowed in a view.
Indexed Views

Views are often used to simplify complex queries, and they can contain joins and
aggregate functions. However, in the past, queries against views were resolved to queries
against the underlying base tables, and any aggregates were recalculated each time you ran a
query against the view. In SQL Server 2012 Enterprise or Developer Edition, you can define
indexes on views to improve query performance against the view. When creating an index on
a view, the result set of the view is stored and indexed in the database. Existing applications
can take advantage of the performance improvements without needing to be modified.

Indexed views can improve performance for the following types of queries:

 Joins and aggregations that process many rows


 Join and aggregation operations that are performed frequently within many queries
 Decision support queries that rely on summarized, aggregated data that is infrequently
updated

Distributed Partitioned Views

SQL Server 7.0 provided the ability to create partitioned views using the UNION
ALL statement in a view definition. It was limited, however, in that all the tables had to
reside within the same SQL Server where the view was defined. SQL Server 2012 expands
the ability to create partitioned views by allowing you to horizontally partition tables across
multiple SQL Servers. The feature helps you scale out one database server to multiple
database servers, while making the data appear as if it comes from a single table on a single
SQL Server. In addition, partitioned views are now able to be updated.

INSTEAD OF and AFTER Triggers

In versions of SQL Server prior to 7.0, a table could not have more than one trigger
defined for INSERT, UPDATE, and DELETE. These triggers only fired after the data
modification took place. SQL Server 7.0 introduced the ability to define multiple AFTER
triggers for the same operation on a table. SQL Server 2012 extends this capability by
providing the ability to define which AFTER trigger fires first and which fires last.
SQL Server 2012 also introduces the ability to define INSTEAD OF triggers.
INSTEAD OF triggers can be specified on both tables and views. (AFTER triggers can still
only be specified on tables.) If an INSTEAD OF trigger is defined on a table or view, the
trigger will be executed in place of the data modification action for which it is defined. The
data modification is not executed unless the SQL code to perform it is included in the trigger
definition.

New Data types

SQL Server 2012 introduces three new data types. Two of these can be used as datatypes
for local variables, stored procedure parameters and return values, user-defined function
parameters and return values, or table columns:

 bigint—An 8-byte integer that can store values from –263 (–9223372036854775808)
through 263-1 (9223372036854775807).
 sql_variant—A variable-sized column that can store values of various SQL Server-
supported data types, with the exception of text, ntext, timestamp, and sql_variant.

The third new datatype, the table datatype, can be used only as a local variable datatype
within functions, stored procedures, and SQL batches. The table datatype cannot be passed as
a parameter to functions or stored procedures, nor can it be used as a column datatype. A
variable defined with the table datatype can be used to store a result set for later processing.
A table variable can be used in queries anywhere a table can be specified.

Text in Row Data

In previous versions of SQL Server, text and image data was always stored on a
separate page chain from where the actual data row resided. The data row contained only a
pointer to the text or image page chain, regardless of the size of the text or image data. SQL
Server 2012 provides a new text in row table option that allows small text and image data
values to be placed directly in the data row, instead of requiring a separate data page. This
can reduce the amount of space required to store small text and image data values, as well as
reduce the amount of I/O required to retrieve rows containing small text and image data
values.

Cascading RI Constraints

In previous versions of SQL Server, referential integrity (RI) constraints were


restrictive only. If an insert, update, or delete operation violated referential integrity, it was
aborted with an error message. SQL Server 2012 provides the ability to specify the action to
take when a column referenced by a foreign key constraint is updated or deleted. You can
still abort the update or delete if related foreign key records exist by specifying the NO
ACTION option, or you can specify the new CASCADE option, which will cascade the
update or delete operation to the related foreign key records.

Multiple SQL Server Instances

Previous versions of SQL Server supported the running of only a single instance of
SQL Server at a time on a computer. Running multiple instances or multiple versions of SQL
Server required switching back and forth between the different instances, requiring changes
in the Windows registry. (The SQL Server Switch provided with 7.0 to switch between 7.0
and 6.5 performed the registry changes for you.)

SQL Server 2005 provides support for running multiple instances of SQL Server on
the same system. This allows you to simultaneously run one instance of SQL Server 6.5 or
7.0 along with one or more instances of SQL Server 2012. Each SQL Server instance runs
independently of the others and has its own set of system and user databases, security
configuration, and so on. Applications can connect to the different instances in the same way
they connect to different SQL Servers on different machines.

XML Support

Extensible Markup Language has become a standard in Web-related programming to


describe the contents of a set of data and how the data should be output or displayed on a
Web page. XML, like HTML, is derived from the Standard Generalize Markup Language
(SGML). When linking a Web application to SQL Server, a translation needs to take place
from the result set returned from SQL Server to a format that can be understood and
displayed by a Web application. Previously, this translation needed to be done in a client
application.

SQL Server 2012 provides native support for XML. This new feature provides the ability to
do the following:

 Return query result sets directly in XML format.


 Retrieve data from an XML document as if it were a SQL Server table.
 Access SQL Server through a URL using HTTP. Through Internet Information
Services (IIS), you can define a virtual root that gives you HTTP access to the data
and XML functionality of SQL Server 2012.

Log Shipping

The Enterprise Edition of SQL Server 2012 now supports log shipping, which you can use to
copy and load transaction log backups from one database to one or more databases on a
constant basis. This allows you to have a primary read/write database with one or more read-
only copies of the database that are kept synchronized by restoring the logs from the primary
database. The destination database can be used as a warm standby for the primary database,
for which you can switch users over in the event of a primary database failure. Additionally,
log shipping provides a way to offload read-only query processing from the primary database
to the destination database.

This capability was available in previous versions of SQL Server, but it required the DBA to
manually set up the process and schedule the jobs to copy and restore the log backups. SQL
Server 2012 officially supports log shipping and has made it easier to set up via the Database
Maintenance Plan Wizard. This greatly simplifies the process by automatically generating the
jobs and configuring the databases to support log shipping.

DDL triggers
In previous articles, I outlined how you can use data definition language (DDL) triggers in
SQL Server 2012 to implement custom database and server auditing solutions for Sarbanes-
Oxley compliance (here are part one and part two of my SOX articles). DDL triggers are
defined at the server or database level and fire when DDL statements occur. This gives you
the ability to audit when new tables, stored procedures, or logins are created.
Ranking functions
SQL Server 2012 provides you with the ability to rank result sets returned from the database
engine. This allows you to customize the manner in which result sets are returned, such as
creating customized paging functions for Web site data.
Row versioning-based isolation levels
This new database engine feature improves database read concurrency by reducing the
amount of locks being used in your database. There are two versions of this feature (both of
which must be enabled at the database level):
 Read Committed Isolation Using Row Versioning is used at the individual
statement level, and guarantees that the data is consistent for the duration of the statement.
 Snapshot Isolation is used at the transaction level, and guarantees that the data is
consistent for the duration of the transaction.

The database engine is able to guarantee the consistency through row versions stored in the
temped database. When a statement or transaction is issued with their respective isolation
levels, read operations accessing the same data that is being involved in a transaction will
read from the previous version of the data that is stored in temped. Using these techniques in
the appropriate situations can significantly decrease your database locking issues
CHAPTER 9

SOFTWARE TESTING

9.1 GENERAL
The purpose of testing is to discover errors. Testing is the process of trying to
discover every conceivable fault or weakness in a work product. It provides a way to check
the functionality of components, sub-assemblies, assemblies and/or a finished product It is
the process of exercising software with the intent of ensuring that the Software system meets
its requirements and user expectations and does not fail in an unacceptable manner. There are
various types of test. Each test type addresses a specific testing requirement.

9.2 DEVELOPING METHODOLOGIES


The test process is initiated by developing a comprehensive plan to test the general
functionality and special features on a variety of platform combinations. Strict quality control
procedures are used.
The process verifies that the application meets the requirements specified in the
system requirements document and is bug free. The following are the considerations used to
develop the framework from developing the testing methodologies.

9.3 TYPES OF TESTS

9.3.1 Unit testing

Unit testing involves the design of test cases that validate that the internal program
logic is functioning properly, and that program input produces valid outputs. All decision
branches and internal code flow should be validated. It is the testing of individual software
units of the application .it is done after the completion of an individual unit before
integration. This is a structural testing, that relies on knowledge of its construction and is
invasive. Unit tests perform basic tests at component level and test a specific business
process, application, and/or system configuration. Unit tests ensure that each unique path of a
business process performs accurately to the documented specifications and contains clearly
defined inputs and expected results.

9.3.2 Functional test


Functional tests provide systematic demonstrations that functions tested are available
as specified by the business and technical requirements, system documentation, and user
manuals.
Functional testing is centered on the following items:
Valid Input : identified classes of valid input must be accepted.
Invalid Input : identified classes of invalid input must be rejected.
Functions : identified functions must be exercised.
Output : identified classes of application outputs must be exercised.
Systems/Procedures: interfacing systems or procedures must be invoked.

9.3.3 System Test


System testing ensures that the entire integrated software system meets requirements.
It tests a configuration to ensure known and predictable results. An example of system testing
is the configuration oriented system integration test. System testing is based on process
descriptions and flows, emphasizing pre-driven process links and integration points.

9.3.4 Performance Test


The Performance test ensures that the output be produced within the time limits,and
the time taken by the system for compiling, giving response to the users and request being
send to the system for to retrieve the results.

9.3.5 Integration Testing


Software integration testing is the incremental integration testing of two or more
integrated software components on a single platform to produce failures caused by interface
defects.
The task of the integration test is to check that components or software applications,
e.g. components in a software system or – one step up – software applications at the company
level – interact without error.

9.3.6 Acceptance Testing


User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional
requirements.

Acceptance testing for Data Synchronization:


 The Acknowledgements will be received by the Sender Node after the Packets are
received by the Destination Node
 The Route add operation is done only when there is a Route request in need
 The Status of Nodes information is done automatically in the Cache Updating process
CODING:

Main Execution Page:

using System;
usingSystem.Collections.Generic;
using System.IO;
usingSystem.Linq;
usingSystem.Threading.Tasks;
usingMicrosoft.AspNetCore;
usingMicrosoft.AspNetCore.Hosting;
usingMicrosoft.Extensions.Configuration;
usingMicrosoft.Extensions.Logging;

namespaceBlockChainSecurity
{
publicclassProgram
{
publicstaticvoid Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}

publicstaticIWebHostBuilderCreateWebHostBuilder(string[] args) =>


WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
}

using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Threading.Tasks;
usingMicrosoft.AspNetCore.Builder;
usingMicrosoft.AspNetCore.Identity;
usingMicrosoft.AspNetCore.Identity.UI;
usingMicrosoft.AspNetCore.Hosting;
usingMicrosoft.AspNetCore.Http;
usingMicrosoft.AspNetCore.HttpsPolicy;
usingMicrosoft.AspNetCore.Mvc;
usingMicrosoft.EntityFrameworkCore;
usingBlockChainSecurity.Data;
usingMicrosoft.Extensions.Configuration;
usingMicrosoft.Extensions.DependencyInjection;
usingRotativa.AspNetCore;

namespaceBlockChainSecurity
{
publicclassStartup
{
publicStartup(IConfiguration configuration)
{
Configuration = configuration;
}

publicIConfiguration Configuration { get; }

// This method gets called by the runtime. Use this method to add services to the container.
publicvoidConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a
given request.
options.CheckConsentNeeded = context =>true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});

services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
services.AddDefaultIdentity<IdentityUser>()
.AddDefaultUI(UIFramework.Bootstrap4)
.AddEntityFrameworkStores<ApplicationDbContext>();

services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
}

// This method gets called by the runtime. Use this method to configure the HTTP request
pipeline.
publicvoid Configure(IApplicationBuilder app, IHostingEnvironmentenv)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseDatabaseErrorPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios,
see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}

app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseCookiePolicy();

app.UseAuthentication();

app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});

RotativaConfiguration.Setup(env);
}
}
}
BlockChain Model Page:

using System;
usingSystem.ComponentModel.DataAnnotations;

namespaceBlockChainSecurity.Models
{
publicclassBlock
{
publicGuid Id { get; set; }

publicDateTimeTimeStamp { get; set; }

publicstring Hash { get; set; }

publicstringPreviousHash { get; set; }

// Data
publicstringFirstName { get; set; }
publicstringLastName { get; set; }
[EmailAddress]
publicstring Email { get; set; }
publicstring Gender { get; set; }
[Display(Name ="University")]
publicstring College { get; set; }
publicstring Department { get; set; }
publicDateTimeDateOfBirth { get; set; }

publicint Proof { get; set; }

public Block()
{
TimeStamp = DateTime.UtcNow;
}
}
}

Student Model Page:

using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Threading.Tasks;

namespaceBlockChainSecurity.Models
{
publicclassData
{
publicGuid Id { get; set; }
publicstringFirstName { get; set; }
publicstringLastName { get; set; }
publicstring Gender { get; set; }
publicstring College { get; set; }
publicstring Department { get; set; }
publicDateTimeDateOfBirth { get; set; }

publicGuidDataOfBlock { get; set; }


public Block Block { get; set; }
}
}

Node Status Model Page:

usingBlockChainSecurity.Models;
using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Threading.Tasks;

namespaceBlockChainSecurity.ModelsWeb
{
publicclassNodeStatusViewModel
{
public List<NetworkNode> Nodes { get; set; }
public BlockChain Chain { get; set; }
}
}

Home Controller Page:

using System;
usingSystem.Collections.Generic;
usingSystem.Diagnostics;
usingSystem.Linq;
usingSystem.Threading.Tasks;
usingMicrosoft.AspNetCore.Mvc;
usingBlockChainSecurity.Models;
usingBlockChainSecurity.Data;
namespaceBlockChainSecurity.Controllers
{
publicclassHomeController : Controller
{
privatereadonlyApplicationDbContext _context;

publicHomeController(ApplicationDbContext context)
{
_context = context;
}

publicIActionResult Index(GuidsearchData)
{
if (searchData == null)
{
ViewBag["Message"] = "No Results Found";
}
else
{
varsdata = _context.Block.Where(s =>s.Id == searchData);
return View(sdata.ToList());
}
return View();
}

publicIActionResult Privacy()
{
return View();
}

[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore =


true)]
publicIActionResult Error()
{
return View(newErrorViewModel { RequestId = Activity.Current?.Id ??
HttpContext.TraceIdentifier });
}
}
}

Database Connection Page:


usingMicrosoft.AspNetCore.Identity.EntityFrameworkCore;
usingMicrosoft.EntityFrameworkCore;
usingBlockChainSecurity.Models;

namespaceBlockChainSecurity.Data
{
publicclassApplicationDbContext : IdentityDbContext
{
publicApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
{
}
publicDbSet<BlockChainSecurity.Models.Block> Block { get; set; }

}
}

Home Page View Design:

<!DOCTYPEhtml>
<html>
<head>
<metacharset="utf-8"/>
<metaname="viewport"content="width=device-width, initial-scale=1.0"/>
<title>@ViewData["Title"] - BlockChainSecurity</title>

<environmentinclude="Development">
<linkrel="stylesheet"href="~/lib/bootstrap/dist/css/bootstrap.css"/>
</environment>
<environmentexclude="Development">
<linkrel="stylesheet"href="https://cdnjs.cloudflare.com/ajax/libs/twitter-
bootstrap/4.1.3/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only"asp-fallback-test-property="position"asp-fallback-test-
value="absolute"
crossorigin="anonymous"
integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE="/>
</environment>
<linkrel="stylesheet"href="~/css/site.css"/>
</head>
<body>
<header>
<navclass="navbarnavbar-expand-smnavbar-toggleable-smnavbar-dark bg-dark border-
bottom box-shadow mb-3">
<divclass="container">
<aclass="navbar-brand"asp-area=""asp-controller="Home"asp-
action="Index"><imgsrc="https://www.newsbtc.com/wp-
content/uploads/2016/09/Blockchain-Logo-White-1.png"width="170"alt="Alternate
Text"/></a>
<buttonclass="navbar-toggler"type="button"data-toggle="collapse"data-target=".navbar-
collapse"aria-controls="navbarSupportedContent"
aria-expanded="false"aria-label="Toggle navigation">
<spanclass="navbar-toggler-icon"></span>
</button>
<divclass="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<partialname="_LoginPartial"/>
<ulclass="navbar-nav flex-grow-1">
<liclass="nav-item">
<aclass="nav-link text-dark"asp-area=""asp-controller="Home"asp-
action="Index">Home</a>
</li>
<liclass="nav-item">
<aclass="nav-link text-dark"asp-area=""asp-controller="Home"asp-
action="Privacy">Privacy</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<divclass="container">
<partialname="_CookieConsentPartial"/>
<mainrole="main"class="pb-3">
@RenderBody()
</main>
</div>

<footerclass="border-top footer text-muted">


<divclass="container">
&copy;2019 BlockChainSecurity - <aasp-area=""asp-controller="Home"asp-
action="Privacy">Privacy</a>
</div>
</footer>

<environmentinclude="Development">
<scriptsrc="~/lib/jquery/dist/jquery.js"></script>
<scriptsrc="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
</environment>
<environmentexclude="Development">
<scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery"
crossorigin="anonymous"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
</script>
<scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/twitter-
bootstrap/4.1.3/js/bootstrap.bundle.min.js"
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
asp-fallback-test="window.jQuery&&window.jQuery.fn&&window.jQuery.fn.modal"
crossorigin="anonymous"
integrity="sha256-E/V4cWE4qvAeO5MOhjtGtqDzPndRO1LBk8lJ/PR7CA4=">
</script>
</environment>
<scriptsrc="~/js/site.js"asp-append-version="true"></script>

@RenderSection("Scripts", required: false)


</body>
</html>

Index Page View Design:

@modelIEnumerable<BlockChainSecurity.Models.Block>

@{
ViewData["Title"] = "Index";
Layout = null;
}
<linkhref="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css"rel="stylesheet
"id="bootstrap-css">
<scriptsrc="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<scriptsrc="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!--

This snippet shows an example of how you can generate a certificate


on your website that is readily printable. Paper CSS makes sure of
the correct paper size, while the rest is just some css.

-->

<style>
@@page {size: A4landscape;}
body {background:#fff;}

.sheet {
margin:0;
box-shadow:none;

#cert {
/*using certificate background image from code.org as an example*/
background-image:url(https://code.org/images/hour_of_code_certificate.jpg);
background-size: contain;
height:100%;
background-repeat:no-repeat;
}

#name {
margin-top:176mm;
text-align:center;
font-size:14mm;
color:#4FC3F7;
font-family:'Dancing Script';
font-weight:bold;
}
</style>
<bodyclass="A4 landscape">
<!-- Each sheet element should have the class "sheet" -->
<!-- "padding-**mm" is optional: you can set 10, 15, 20 or 25 -->
<sectionclass="sheet">
<divid="cert"class="container-fluid">
<divclass="row">
<divclass="col-md-12">
@foreach (var item in Model)
{
<h2id="name">@Html.DisplayFor(modelItem =>item.FirstName)
@Html.DisplayFor(modelItem =>item.LastName)</h2>
}
</div>
</div>
</div>
</section>
</body>
<p>
<aasp-action="Create">Create New</a>
</p>
<tableclass="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model =>model.TimeStamp)
</th>
<th>
@Html.DisplayNameFor(model =>model.Hash)
</th>
<th>
@Html.DisplayNameFor(model =>model.PreviousHash)
</th>
<th>
@Html.DisplayNameFor(model =>model.FirstName)
</th>
<th>
@Html.DisplayNameFor(model =>model.LastName)
</th>
<th>
@Html.DisplayNameFor(model =>model.Gender)
</th>
<th>
@Html.DisplayNameFor(model =>model.College)
</th>
<th>
@Html.DisplayNameFor(model =>model.Department)
</th>
<th>
@Html.DisplayNameFor(model =>model.DateOfBirth)
</th>
<th>
@Html.DisplayNameFor(model =>model.Proof)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem =>item.TimeStamp)
</td>
<td>
@Html.DisplayFor(modelItem =>item.Hash)
</td>
<td>
@Html.DisplayFor(modelItem =>item.PreviousHash)
</td>
<td>
@Html.DisplayFor(modelItem =>item.FirstName)
</td>
<td>
@Html.DisplayFor(modelItem =>item.LastName)
</td>
<td>
@Html.DisplayFor(modelItem =>item.Gender)
</td>
<td>
@Html.DisplayFor(modelItem =>item.College)
</td>
<td>
@Html.DisplayFor(modelItem =>item.Department)
</td>
<td>
@Html.DisplayFor(modelItem =>item.DateOfBirth)
</td>
<td>
@Html.DisplayFor(modelItem =>item.Proof)
</td>
<td>
<aasp-action="Edit"asp-route-id="@item.Id">Edit</a> |
<aasp-action="Details"asp-route-id="@item.Id">Details</a> |
<aasp-action="Delete"asp-route-id="@item.Id">Delete</a>
</td>
</tr>
}
</tbody>
</table>
SCREEN SHOTS:

Home Page:

Registration Page & Login Page:


Get Hash Value From Gmail Using Algorithm
Get Certificate From Block Chain Network:
Hash value Table Data:
FUTURE ENHANCEMENT IN BLOCKCHAIN:

Online Certificates
Health Care
Decentralized prediction platform
Decentralized borderless virtual nation
Electronic contracts
Anti-counterfeit Platform
Helping local economies to grow
Asset Protection
Internet of Things
Data Storage on Network

CONCLUSION

Data security is one of the major features of blockchain technology. Blockchain is a


large and open-access online ledger in which each node saves and verifies the same data.
Using the proposed blockchain-based system reduces the likelihood of certificate forgery.
The process of certificate application and automated certificate granting are open and
transparent in the system. Companies or organizations can thus inquire for information on
any certificate from the system. In conclusion, the system assures information accuracy and
security.
REFERENCE:

1. Xiuping Lin, “Semi-centralized Blockchain Smart Contracts: Centralized Verification and


Smart Computing under Chains in the EthereumBlockchain”, Department of Information
Engineering, National Taiwan University, Taiwan, R.O.C., 2017.

2. Yong Shi, “Secure storage service of electronic ballot system based on block chain
algorithm”, Department of Computer Science, Tsing Hua University, Taiwan, R.O.C., 2017.

3. ZhenzhiQiu, “Digital certificate for a painting based on blockchain technology”,


Department of Information and Finance Management, National Taipei University of
Technology, Taiwan, R.O.C., 2017.

4.Weiwen Yang, Global blockchain development status and trends

5. Benyuan He, “An Empirical Study of Online Shopping Using Blockchain Technology”,
Department of Distribution Management, Takming University of Science and Technology,
Taiwan, R.O.C., 2017

6. Weiwei He, Exempted from cumbersome auditing and issuance procedures, several
national junior diplomas will debut next year.iThome,

Das könnte Ihnen auch gefallen