You are on page 1of 84

ACKNOWLEDGEMENTS

We are glad to have this opportunity to convey our gratitude to the GLOBAL
INSTITUTE OF TECHNOLOGY, Jaipur that is helping us to present our project in 7th
Semester of B. Tech.

We wish to place on record of deep sense of gratitude to head of the GIT for her
immense help in presenting our project. Our sincere thanks to the H.O.D. Mr. A.K.
SHARMA for his guidance during the 7th Semester of B.Tech.

Our sincere Regards and Heartiest thanks to our project guide Mr. A.B. SINGH, for his
indispensable contribution, inexhaustible patience to deal with our endless queries and
deduction throughout the project without which it would not possible for us to complete
in the stipulate time.

We are greatly indebted to our Parents and all near and dear ones who are the greatest
inspiration of our life. They took a lot of interest in our work and provided us with
constant Love, Support and Encouragement.

RAHUL SAXENA

MEENA SHARMA

RAHUL SETH

1
PREFACE

We are now living in the Computer age. Now the computer is controlling all the
important works in our routine life. Man has invented many electronic devices but out of
these computers has made the greatest impact on society.

Computers are so versatile because they are indispensable to present day engineers,
scientists, businessman and students. They have strengthened man’s capability in
numerical, computations information processing etc. and there by increasing the
effectiveness of the organization.

A hostel is a budget-oriented, shared-room ("dormitory") accommodation that accepts


individual travelers (typically backpackers) or groups for short-term stays, and that
provides common areas and communal facilities.

Hostel management by manual way is tedious process, since it involves work load and
time consumption. In this system, we can easily manage the hostel details, room
details, student records, mess expenditure, mess bill calculation, easy way of room
allocation and hostel attendance.

The main feature of this project is easy to allocate for the student and also easy to
calculate mess bill.

DECLARATION
GLOBAL INSTITUTE OF

2
TEHNOLOGY

DEPARTMENT OF INFORMATION TECHNOLOGY

CERTIFICATE
This is to certify that the project titled

“HOSTEL MANAGEMENT SYSTEM”

is a bonafied work carried out by following

Information Technology students:

1. RAHUL SAXENA

2 MEENA SHARMA
3. RAHUL SETH na

Under our guidance towards the partial fulfillment of the Requirements for
the degree of the Bachelor of Technology by RTU, kota during the
academic year of 2010-2011

Mr. Dilip Gupta


(Guide)

TABLE OF CONTENTS

1. Synopsis

2. SRS

3
3. Technology overview

4. Project description

5. Snapshots of webpages

6. Snapshots of database table

7. Source code of project

8. Scope of project

9. Contribution

10. Conclusion

11.Bibliography

4
SYNOPSIS

ABSTRACT:
As the name specifies “HOSTEL MANAGEMENT SYSTEM” is a software developed for
managing various activities in the hostel. For the past few years the number of
educational institutions are increasing rapidly. Thereby the number of hostels are also
increasing for the accommodations of the students studying in the institution. And hence
there is a lot of strain on the person who are running the hostel and software’s are not
usually used in this context. This particular project deals with the problems on managing
a hostel and avoids the problem which occur when carried manually.

Identification of the drawbacksof the existing system leads to the designing of


computerized system that will be compatible to the existing system with the system
which is more user friendly and more GUI oriented. We can improve the efficiency of the
system, thus overcome the drawbacks of the existing system.

• Less human error


• Strength and strainof manual labour can be reduced
• High security
• Data redundancy can be avoided to some extent
• Data consistency
• Easy to handle
• Easy data updating
• Easy record keeping
• Backup data can be easily generated.

5
REQUIREMENT SPECIFICATION

Software Requirement :-

Operating System : Windows 2000/XP/2003/Vista/7

Web Browser : Internet Explorer 6.0, Mozilla Firefox or above

Language (Front End) : ASP.NET

Database (Back End) : SQL Server 2005

Other Softwares : Visual Studio and .Net Framework

Hardware Required:-

Processor : Pentium Processor or above

Hard Disk : 5 GB

RAM : 512 MB

Local Area Network

Communication Media

6
SRS

Introduction:
Problem definition: We have got three hostels in our college, which consist of one
boy’s hostel and two girl’s hostel. All these hostels are managed manually by the hostel
office. The Registration form verification to the different data processing are done
manually.

Thus there are a lot of repetitions which can be easily avoided. And hence there is a lot
of strain on the person who are running the hostels and software’s are not usually used
in this context. This particular project deals with the problems on managing a hostel and
avoids the problem which occur when carried manually.

Identification of the drawbacksof the existing system leads to the designing of


computerized system that will be compatible to the existing system with the system
which is more user friendly and more GUI oriented. We can improve the efficiency of the
system, thus overcome the drawbacks of the existing system.

User panel:
User login:

Home:

• This consist of the different pop-up menus showing the details of the different
hostels.
• It allows the different users to access the registration forms.
• He can view the student administration division of the different hostels.

7
Registration form:

This section provides an online form to the students which can be filled by them, and a
copy of the filled page can be taken in the printed form. This is later submitted to the
Hostel authorities which can be verified by them before allotting them to respective
hostels or rooms.

Admin panel:

Administrator login:

Home:

the administrator can:

• Allot different student to the different hostel and room.


• Vacate the students for the hostel.
• Control the status of the fee payment.
• Edit the details of the students and modify the student records.

Allotment of the hostel:

Their will be pre-defined crieterias for the admission to the hostels. He checks the
attested application forms of the students obtained from the internet and verify it with
the student database. If the student are found eligible then they are allotted to the
hostel.

Vacating the rooms:

As the student’s courses is over they will vacate their rooms. So it is required for the
administrator to remove their records from the database tables. This selection includes
the option for the room vacation and the deletion of the particular record from the
database.

SYSTEM DESIGN
8
Input Design:

The system design is divided in to two portions. The Administrator section and the User
(student’s) section.

Administrator:

1. The Administrator can allot different students to the different hostels.

2.He can vacate the students for the hostels.

3.He can control the status of the fee payement.

4.He can edit the details of the students.He can change their rooms, edit and delete the student
records.

A process of converting user originated inputs to a computer-based format. Input


design is an importantpart of development process since inaccurate input data are the
most common cause of errors in data processing.

Erroneous entries can be controlled by input design. It consists of developing specifications and
proceduresfor entering data into a system and must be in simple format.
The goal of input data design is to make data entry as easy, logical and free from errors
as possible. In input data design, we design the we design the source document that
capture the data and then select the media used to enter them into the computer.

There are two major approaches for entering data in to the computer. They are:
1.Menus
2.Dialog boxes

MENUS

9
A menu is a selection list that simplifies computer data access or entry. Instead of
remembering what to enter, the user chooses from a list of options. A menu limits a user
choice of response but reduce the chances for error in data entry.

DIALOG BOX

Dialog boxes are windows and these windows are mainly popup, which appear in
response to certain conditions that occur when a program is run. It allows the display of
bitmaps and pictures. It can have various controls like buttons, text boxes, list boxes
and combo boxes. Using these controls we can make a ‘dialog’ with the program.

PROCESS DESIGN

Process design plays an important role in project development. In order to understand


the working procedure, process design is necessary. Data Flow Diagram and System
Flow chart are the tools used for process design.
System Flow Chart is a graphical representation of the system showing the overall flow
controlling processing at the job level; specifies what activities must be done to convert
from a physical to logical model.
Data Flow Diagram is the logical representation of the data flow of the project. The DFD
is drawn using various symbols. It has a source and a destination. The process is
represented using circles and source and destination are represented using squares.
The data flow is represented using arrows. One reader can easily get the idea about the
project through Data Flow Diagram.

Data flow diagram:

10
Context level DFD:

Student module:

11
Registration process:

Admin module:

12
Allotment process:

Vacating process:

13
SYSTEM TESTING

System testing is the stage of implementation, which is aimed at ensuring that the
system works accurately and efficiently before live operation commences. Testing is the
process of executing the program with the intent of finding errors and missing
operations and also a complete verification to determine whether the objectives are met
and the user requirements are satisfied. The ultimate aim is quality assurance.Tests are
carried out and the results are compared with the expected document. In the case of
erroneous results, debugging is done. Using detailed testing strategies a test plan is
carried out on each module.

Unit Testing
The software units in a system are modules and routines that are assembled and
integrated to perform a specific function. Unit testing focuses first on modules,
independently of one another, to locate errors. This enables, to detect errors in coding
and logic that are contained within each module.
This testing includes entering data and ascertaining if the value matches to the type
and size supported by java. The various controls are tested to ensure that each
performs its action as required.

14
Integration Testing
Data can be lost across any interface, one module can have an adverse effect on
another, sub functions when combined, may not produce the desired major functions.
Integration testing is a systematic testing to discover errors associated within the
interface. The objective is to take unit tested modules and build a program structure. All
the modules are combined and tested as a whole. Here the Server module and Client
module options are integrated and tested.This testing provides the assurance that the
application is well integrated functional unit with smooth transition of data.

User Acceptance Testing

User acceptance of a system is the key factor for the success of any system. The
system under consideration is tested for user acceptance by constantly keeping in touch
with the system users at time of developing and making changes whenever required.

15
TECHNOLOGY OVERVIEW

.NET FRAMEWORK
The .NET Framework is really a cluster of several technologies.

These include the following:

The .NET languages: These include Visual Basic, C#, JScript .NET (a server-side
version of JavaScript), J# (a Java clone), and C++.

The Common Language Runtime (CLR): This is the engine that executes all .NET
programs and provides automatic services for these applications, such as security
checking, memory management, and optimization.

The .NET Framework class library: The class library collects thousands of pieces of
prebuilt functionality that we can “snap in” to our applications. These features are
sometimes organized into technology sets, such as ADO.NET (the technology for
creating database applications) and Windows Forms (the technology for creating
desktop user interfaces).

16
ASP.NET: This is the engine that hosts the web applications we create with .NET, and
supports almost any feature from the .NET class library. ASP.NET also includes a set of
web-specific services, like secure authentication and data storage.

Visual Studio: This optional development tool contains a rich set of productivity and
debugging features. The Visual Studio setup DVD includes the complete .NET
Framework, so we won’t need to download it separately.

Sometimes the division between these components isn’t clear. For example, the term
ASP.NET is sometimes used in a narrow sense to refer to the portion of the .NET class
library used to design web pages. On the other hand, ASP.NET also refers to the whole
topic of .NET web applications, which includes .NET languages and many fundamental
pieces of the classes.

The Common Language Runtime

The CLR is the engine that supports all the .NET languages. Many modern languages
use runtimes. In VB 6, the runtime logic is contained in a DLL file named msvbvm60.dll.
In C++, many applications link to a file named mscrt40.dll to gain common functionality.
These runtimes may provide libraries used by the language, or they may have the
additional responsibility of executing the code (as with Java). Runtimes are nothing
new, but the CLR is Microsoft’s most ambitious runtime to date. Not only does the CLR
execute code, it also provides a whole set of related services such as code verification,
optimization, and object management

The implications of the CLR are wide-ranging:

Deep language integration: VB and C#, like all .NET languages, compile to IL. In other
words, the CLR makes no distinction between different languages. Side-by-side
execution: The CLR also has the ability to load more than one version of a component
at a time. In other words, we can update a component many times, and the correct
version will be loaded and used for each application. .

17
Fewer errors: Whole categories of errors are impossible with the CLR. For example, the
CLR prevents many memory mistakes that are possible with lower-level languages such
as C++.

Code transparency: IL is much easier to disassemble, meaning that if we distribute a


compiled application or component, other programmers may have an easier time
determining how wer code works. .

Questionable cross-platform support: No one is entirely sure whether .NET will ever be
adopted for use on other operating systems and platforms.

Base Class Library

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.

The .NET class library is a giant repository of classes that provide prefabricated
functionality for everything from reading an XML file to sending an e-mail message. If
we’ve had any exposure to Java, we may already be familiar with the idea of a class
library. However, the .NET class library is more ambitious and comprehensive than just
about any other programming framework. Any .NET language can use the .NET class
library’s features by interacting with the right objects. This helps encourage consistency
among different .NET languages and removes the need to install numerous
components on our computer or web server.

Just-In-Time Compilation (JIT)

The MSIL is the language that all of the .NET languages compile down to. After they are
in this intermediate language, a process called Just-In-Time (JIT) compilation occurs
when resources are used from our application at runtime. JIT allows “parts” of our
application to execute when they are needed, which means that if something is never

18
needed, it will never compile down to the native code. By using the JIT, the CLR can
cache code that is used more than once and reuse it for subsequent calls, without going
through the compilation process again.

The JIT process enables a secure environment by making certain assumptions:

• Type references are compatible with the type being referenced.

• Operations are invoked on an object only if they are within the execution

parameters for that object.

• Identities within the application are accurate.

Features of .NET

Now that we know some basics of .NET, let us see what makes .NET a wonderful
platform for developing modern applications.

• Rich Functionality out of the box

.NET framework provides a rich set of functionality out of the box. It contains hundreds
of classes that provide variety of functionality ready to use in our applications. This
means that as a developer we need not go into low level details of many operations
such as file IO, network communication and so on.

• Easy development of web applications

ASP.NET is a technology available on .NET platform for developing dynamic and data
driven web applications. ASP.NET provides an event driven programming model
(similar to Visual Basic 6 that simplify development of webpages (now called as web
forms) with complex user interface. ASP.NET server controls provide advanced user
interface elements (like calendar and grids) that save lot of coding from programmer’s
side.

• OOPs Support

19
The advantages of Object Oriented programming are well known. .NET provides a fully
object oriented environment. The philosophy of .NET is – “Object is mother of all.”
Languages like Visual Basic.NET now support many of the OOPS features that were
lacking traditionally. Even primitive types like integer and characters can be treated as
objects – something not available even in OOPS languages like C++.

• Multi-Language Support

Generally enterprises have varying skill sets. For example, a company might have
people with skills in Visual Basic, C++, and Java etc. It is an experience that whenever
a new language or environment is invented existing skills are outdated. This naturally
increases cost of training and learning curve. .NET provides

something attractive in this area. It supports multiple languages. This means that if we
have skills in C++, we need not throw them but just mould them to suit .NET
environment. Currently four languages are available right out of the box namely – Visual
Basic.NET, C# (pronounced as C-sharp), Jscript.NET and Managed C++ (a dialect of
Visual C++). There are many vendors that are working on developing language
compilers for other languages (20+ language compilers are already available). The
beauty of multi language support lies in the fact that even though the syntax of each
language is different, the basic capabilities of each language remain at par with one
another.

• Multi-Device Support

Modern lift style is increasingly embracing mobile and wireless devices such as PDAs,
mobiles and handheld PCs. . . .NET provides promising platform for programming such
devices. .NET Compact Framework and Mobile Internet Toolkit are step ahead in this
direction.

• Automatic memory management

While developing applications developers had to develop an eye on system resources


like memory. Memory leaks were major reason in failure of applications. .NET takes this
worry away from developer by handling memory on its own. The garbage collector takes
care of freeing unused objects at appropriate intervals.

20
• Compatibility with COM and COM+

Before the introduction of .NET, COM was the de-facto standard for componentized
software development. Companies have invested lot of money and efforts in developing
COM components and controls. The good news is – we can still use COM components
and ActiveX controls under .NET. This allows we to use our existing investment in .NET
applications. .NET still relies on COM+ for features like transaction management and
object pooling. In fact it provides enhanced declarative support for configuring COM+
application right from our

source code. Our COM+ knowledge still remains as a valuable asset.

• No more DLL Hell

If we have worked with COM components, we probably are aware of “DLL hell”. DLL
conflicts are a common fact in COM world. The main reason behind this was the
philosophy of COM – “one version of component across machine”.

Also, COM components require registration in the system registry. .NET ends this DLL
hell by allowing applications to use their own copy of dependent DLLs. Also, .NET
components do not require any kind of registration in system registry.

• Strong XML support

Now days it is hard to find a programmer who is unaware of XML. XML has gained such
a strong industry support that almost all the vendors have released some kind of
upgrades or patches to their existing software to make it “XML compatible”.
Currently, .NET is the only platform that has built with XML right into the core
framework. .NET tries to harness power of XML in every possible way. In addition to
providing support for manipulating and transforming XML documents, .NET provides
XML web services that are based on standards like

HTTP, XML and SOAP.

• Ease of deployment and configuration

21
Deploying windows applications especially that used COM components were always
been a tedious task. Since .NET does not require any registration as such, much of the
deployment is simplified. This makes XCOPY deployment viable. Configuration is
another area where .NET – especially ASP.NET – shines over traditional languages.
The configuration is done via special files having special XML vocabulary. Since, most
of the configuration is done via configuration files, there is no need to sit in front of
actual machine and configure the application

Manually. This is more important for web applications; simply FTPing new configuration
file makes necessary changes.

Security

Windows platform was always criticized for poor security mechanisms. Microsoft has
taken great efforts to make .NET platform safe and secure for enterprise applications.
Features such as type safety, code access security and role based authentication make
overall application more robust and secure.

INTRO TO VISUAL STUDIO

In the ancient days of web programming, developers created web pages with simple
text editors such as Notepad. Other choices were available, but each suffered from its
own quirks and limitations. The standard was a gloves-off approach of raw HTML with
blocks of code inserted wherever necessary.

Visual Studio changes all that. First, it’s extensible and can even work in tandem with
other straight HTML editors such as Microsoft Expression Web or Adobe Dreamweaver.
In other words, we can do the heavy-duty coding with Visual Studio, but use another
web design tool to make everything look pretty. Second, Visual Studio includes

22
indispensable time-saving features. For example, it gives we the ability to drag and drop
web pages into existence and

troubleshoot misbehaving code. Visual Studio even includes a built-in test web server,
which allows we to create and test a complete ASP.NET website without worrying about
web server settings.

INTRODUCTION TO C#

C# is an object-oriented programming language developed by Microsoft to become a


key part of their .NET software development platform. Being object-oriented, C# is
composed of a ollection of individual programming units called classes that can interact
with each other.

C# is based on the C++ language, but there is no doubt that it was influenced by
Microsoft’s other popular language, Visual Basic. One of the biggest advantages of C#
is that its syntax (in other words, the structure of the code) is similar to that of a number
of other popular programming languages, notably C++, Visual Basic, Java, and Delphi,
which means that programmers from a variety of backgrounds can start programming
with minimal learning. It is, however, simpler than C++ and Java.

C# and CLR

C# was designed to take advantage of the Common Language Runtime that .NET
programs all rely upon. All applications written in C# require the CLR (in other words,
the Microsoft .NET framework) to run, just as Visual Basic applications needed the
appropriate runtime library to run. Information on the .NET Framework, along with
download information, can be found at the Microsoft website:
http://msdn.microsoft.com/netframework.

The main features of the CLR include:

23
❑ Managed code. Managed code outputted by Visual Studio applications and is run by
the .NET Framework.

❑ Easy/automatic application installation. This can be carried out using Global


Assembly Cache.

❑ Memory management. The CLR offers programmers an easy yet effective way to
manage memory. This means better performance with less code.

❑ Automatic garbage collection. The .NET Framework automatically frees up


memory when objects are no longer required.

❑ Excellent levels of security during execution. The .NET Framework includes an


integrated security model that grants permission to resources based on evidence found
in assemblies.

Diversions Into .NET

Just a quick diversion into .NET.

The Microsoft .NET platform has four cornerstone components:

❑ .NET Building Block Services such as Passport

❑ .NET Compact Framework which runs on devices such as mobile phones and PDAs

❑ .NET user experience through XML integration (forms and so on)

❑ .NET Infrastructure such as the .NET Framework Common Language Runtime


and .NET

Framework Class Libraries and development applications such as Microsoft Visual


Studio.NET All the .NET programming languages have the .NET Framework class
libraries integrated into them. The .NET class libraries also support functions such as
file I/O, database operations, XML (Extensible Markup Language) and SOAP (Simple
Object Access Protocol).

24
The important thing to remember about .NET programming or .NET development is that
this means leveraging the .NET Framework, which includes the runtime environment
and the class libraries.

Variables and Data Types

As with all programming languages, we keep track of data in C# using variables.


Variables can store numbers, text, dates, and times, and they can even point to full-
fledged objects. When we declare a variable, we give it a name, and we specify the type
of data it will store. To declare a local variable, we start the line with the data type,
followed by the name we want to use. A final semicolon ends the statement:

// Declare an integer variable named errorCode.

int errorCode;

// Declare a string variable named myName.

string myName;

Every .NET language uses the same variable data types. Different languages may
provide slightly different names (for example, a VB Integer is the same as a C# int), but
the CLR makes no distinction—in fact, they are just two different names for the same
base data type. This design allows for deep language integration. Because languages
share the same core data types, we can easily use objects written in one .NET
language in an application written in another .NET language. No data type conversions
are required.

To create this common data type system, Microsoft needed to iron out many of the
inconsistencies that existed between VBScript, VB 6, C++, and other languages. The
solution was to create a set of basic data types, which are provided in the .NET class
library. Table 3-1 lists the most important core data types.

We can also declare a variable by using the type name from the .NET class library. This
approach produces identical variables. It’s also a requirement when the data type

25
doesn’t have an alias built into the language. For example, we can rewrite the earlier
example that used C# data type names with this code snippet that uses the class library
names:

System.Int32 errorCode;

System.String myName;

This code snippet uses fully qualified type names that indicate that the Int32 type and
the String type are found in the System namespace (along with all the most
fundamental types).

ASP.NET Controls

The ASP.NET Framework contains over 70 controls. These controls can be divided into
eight groups:

Standard Controls—The standard controls enable you to render standard form


elements such as buttons, input fields, and labels.

Validation Controls—The validation controls enable you to validate form data before
you submit the data to the server. For example, you can use a RequiredFieldValidator
control to check whether a user entered a value for a required input field.

Rich Controls—The rich controls enable you to render things such as calendars, file
upload buttons, rotating banner advertisements, and multi-step wizards.

Data Controls—The data controls enable you to work with data such as database data.
For example, you can use these controls to submit new records to a database table or
display a list of database records.

Navigation Controls—The navigation controls enable you to display standard


navigation elements such as menus, tree views, and bread crumb trails.

26
Login Controls—The login controls enable you to display login, change password, and
registration forms.

HTML Controls—The HTML controls enable you to convert any HTML tag into a
server-side control.

ADO.NET

ADO.NET relies on the functionality in a small set of core classes. You can divide these
classes into two groups: those that are used to contain and manage data (such as
DataSet, DataTable, DataRow, and DataRelation) and those that are used to connect to
a specific data source (such as Connection, Command, and DataReader).

The data container classes are completely generic. No matter what data source you
use, once you extract the data, it’s stored using the same data container: the
specialized DataSet class. Think of the DataSet as playing the same role as a collection
or an array—it’s a package for data. The difference is that the DataSet is customized for
relational data, which means it understands concepts such as rows, columns, and table
relationships natively.

The second group of classes exists in several different flavors. Each set of data
interaction classes is called an ADO.NET data provider. Data providers are customized
so that each one uses the best-performing way of interacting with its data source. For
example, the SQL Server data provider is designed to work with SQL Server 7 or later.
Internally, it uses SQL Server’s TDS (tabular data stream) protocol for communicating,
thus guaranteeing the best possible performance. If you’re using Oracle, you’ll need to
use the Oracle provider classes instead.

It’s important to understand that you can use any data provider in almost the same way,
with almost the same code. The provider classes derive from the same base classes,
implement the same interfaces, and expose the same set of methods and properties. In
some cases, a data provider object will provide custom functionality that’s available only
with certain data sources, such as SQL Server’s ability to perform XML queries.
However, the basic members used for retrieving and modifying data are identical.

27
.NET includes the following four providers:

• SQL Server provider: Provides optimized access to a SQL Server database (version
7.0 or later)

• OLE DB provider: Provides access to any data source that has an OLE DB driver

• Oracle provider: Provides optimized access to an Oracle database (version 8i or


later)

• ODBC provider: Provides access to any data source that has an ODBC (Open
Database Connectivity) driver

In addition, third-party developers and database vendors have released their own
ADO.NET providers, which follow the same conventions and can be used in the same
way as those that are included with the .NET Framework. When choosing a provider,
you should first try to find one that’s customized for your data source. If you can’t find a
suitable provider, you can use the OLE DB provider, as long as you have an OLE DB
driver for your data source. The OLE DB technology has been around for many years
as part of ADO, so most data sources provide an OLE DB driver (including SQL Server,
Oracle, Access, MySQL, and many more). In the rare situation that you can’t find a full
provider or an OLE DB driver, you can fall back on the ODBC provider, which works in
conjunction with an ODBC driver.

Introduction to SQL Server

28
Server-side data access is critical to all real-world applications. This section introduces
you to the SQL server data access through Web Forms. Microsoft SQL Server is a
Relational Database Management System (RDBMS) that issued to store and organize
related data— the collection of related data is called a database. Microsoft SQL Server
is based on the client/server architecture, in which data is stored on a centralized
computer called a server. Other computers, called clients, can access the data stored
on the server through a network.

The client/server architecture prevents data in consistency. You can access data stored
on a SQL server through Web Forms. To do so, you can create Web applications that
have data access controls. These data access Web controls present the data in a
consistent manner irrespective of the actual source, such as Microsoft SQL Server.
Therefore, while creating a Web application, you do not need to worry about the format
of the data. However, before you can access or manipulate data from a SQL server, you
need to perform the following steps in the specified sequence:

1. Establish a connection with the SQL Server.

2. Write the actual command to access or manipulate data.

3. Create a result set of the data from the data source with which the application can
work. This result set is called the data set and is disconnected from the actual source.
The application accesses and updates data in the data set, which is later reconciled
with the actual data source.

29
To achieve this functionality, you first need to import two namespaces, System. Data
and

System.Data.SqlClient, into your Web Forms page. The syntax is given as follows:

<%@ Import Namespace="System. Data" %>

<%@ Import Namespace="System.Data.SqlClient" %>

The two namespaces are described as follows:

System. Data: A collection of classes that are based on the ADO.NET architecture. The
ADO.NET architecture allows for efficient data management and manipulation from
multiple data sources. ADO.NET provides tools to request and update data in a data
set, and reconcile data in the actual data source. Some of the classes included in this
namespace are described as follows:

Data Set: Represents the data set cached in memory with which applications work.

Data Table: Represents a table of data in a data set.

Data Row: Represents a row of data in a data table.

Data Column: Represents a column of data in a data table.

System.Data.SqlClient: A collection of classes that are used to access SQL server


data sources. Sql Connection: Represents a connection with a SQL server data
source. The first step to access data from a SQL server database is to create an object
of this class.

Sql Data Adapter: Represents a set of data commands and a database connection that
are used to access or manipulate data. After creating a Sql Connection object, you need
to create an object of the Sql Data Adapter class to populate the data set and update
the data source.

30
Sql Command: Represents the SQL command to perform data operations in a SQL
server data source.

Architecture:

Protocol layer

Protocol layer implements the external interface to SQL Server. All operations that can
be invoked on SQL Server are communicated to it via a Microsoft-defined format, called
Tabular Data Stream (TDS). TDS is an application layer protocol, used to transfer data
between a database server and a client.

Data storage:

The main unit of data storage is a database, which is a collection of tables


with typed columns.

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

31
Buffer management

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

Logging and Transaction

SQL Server ensures that any change to the data is ACID-compliant, i.e., it
uses transactions to ensure that any operation either totally completes or is undone if
fails, but never leaves the database in an intermediate state. Using transactions, a
sequence of actions can be grouped together, with the guarantee that either all actions
will succeed or none will. SQL Server implements transactions using a write-ahead log.
Any changes made to any page will update the in-memory cache of the page,
simultaneously all the operations performed will be written to a log, along with the
transaction ID which the operation was a part of. Each log entry is identified by an
increasing Log Sequence Number (LSN) which ensure that no event overwrites
another.

Concurrency and locking

SQL Server allows multiple clients to use the same database concurrently. As such, it
needs to control concurrent access to shared data, to ensure data integrity - when
multiple clients update the same data, or clients attempt to read data that is in the
process of being changed by another client.

SQL Server provides two modes of concurrency control: pessimistic concurrency and
optimistic concurrency. When pessimistic concurrency control is being used, SQL
Server controls concurrent access by using locks.

32
Locks can be either shared or exclusive. Exclusive lock grants the user exclusive
access to the data - no other user can access the data as long as the lock is held.
Shared locks are used when some data is being read - multiple users can read from
data locked with a shared lock, but not acquire an exclusive lock. The latter would have
to wait for all shared locks to be released. Locks can be applied on different levels of
granularity - on entire tables, pages, or even on a per-row basis on tables.

Data retrieval:-

The main mode of retrieving data from an SQL Server database is querying for it. The
query is expressed using a variant of SQL called T-SQL, a dialect Microsoft SQL Server
shares with Sybase SQL Server due to its legacy. The query declaratively specifies
what is to be retrieved. It is processed by the query processor, which figures out the
sequence of steps that will be necessary to retrieve the requested data. The sequence
of actions necessary to execute a query is called a query plan. There might be multiple
ways to process the same query. For example, for a query that contains a join
statement and a select statement, executing join on both the tables and then executing
select on the results would give the same result as selecting from each table and then
executing the join, but result in different execution plans. In such case, SQL Server
chooses the plan that is supposed to yield the results in the shortest possible time. This
is called query optimization and is performed by the query processor itself.

Features of Visual Basic:

⇒ Visual Basic is a flexible, high level, structured programming language.

⇒Visual Basic includes certain low level features that are normally available only in
assembly or machine language.

Visual Basic is widely available, commercial interpreter are available for most
personal computer, mini computers and main frames.

33
Visual Basic is largely machined independent. Programs written in visual basic
are easily ported from one computer to another.

Your programs interface may include the familiar controls that window users
already know how to operate-such as command buttons, option list, text boxes and
scroll bars.

⇒With just a few mouse actions, you can add any combination of these controls to a
program.

⇒As a result design tasks that used to require many hours of detailed programming
efforts can how be completed in minutes.

⇒In Visual Basic you can quickly design the visual elements of any new
programming project.

The Programming Process:


These standards steps are to be followed while creating Visual Basic Programs:

Deciding what your application is do by crating an overall design.

Creating the Visual Basic portion of the application (the serene and menus that the
users will interact with)

Adding the Visual Basic programming language code to tie the Visual Basic
elements together and to automate the program.

Testing the application to locate and remove any bugs.

Compiling the tested application and distribute the compiled application to the end
users.

Visual basic includes a special helpers system called a debugger that the
programmer can use to help locate bugs that appear during testing. The debugger is
an interactive monitoring system that you turn on and off inside Visual Basic that
helps you locate statements that may contain bugs.

34
Programming Maintenance
Apart from the bugs, the programmer has to maintain the program he /she has
created. Program Maintainance is a term used for the updating of a program after
the program after the program is put into use. This updating may be a result of the
users request or a change in the way the program needs to operate.

Project
A project is a collection of files that make up your application. A single Application
might consist of several files and the projects is the collection of those files.

Multiple Documents Interface (MDI)


It allows the application to contain multiple documents windows. In effect, this
interface lets your work with several sets of data in multiple window within the
program. Each document window is called a child window.

Single Document Interface (SDI)


It limits the application take on a window Explorer- like interface with topic
summaries in the left window an details for a selected topic in the right pane.

35
PROJECT DESCRIPTION

Objective:

The main objective of the project is to provide better graphical environment for
user,faculty,administrator,students. In this project the user can perform Hostel
Management. The interaction of the user with the project is so easy that user can easily
find the details about the hostel rooms he required and administer them using fully
secured features.

Scope:

This Web Application provides facility to manage rooms,students,library,buses.It saves


time as it allows number of people to access the website at a time and saves a lot of
time. It is automatically generated by the server.

Administrator has a privilege to create, modify and delete the database available and
their particular information .

User can register, login and get the information they needed with his specified
requirements, and can see the results of his search.

Usability:

The links are provided for each form. The user is facilitated to view and make entries in
the forms. Validations are provided in each field to avoid inconsistent or invalid entry in
the databases. Some forms consists Hyper Links, which provides further details.
Reports screen contains text boxes and drop down lists, so that reports can be
produced.

Security:

36
Application will allow only valid users to access the system. Access to any application
resource will depend upon user’s designation. There are two types of users namely
Administrator and Students. Security is based upon the individual user ID and
Password. No user would be able to access any part of the application without logging
on to the system.

Portability:

The application is developed in ASP.NET. It would be portable to other operating


system provided .NET Framework is available for the OS. As the database is made in
SQL Server, porting the database to another database server would require some
development effort.

Availability:

System will be available around the clock and user can assess and get the services as
per his requirements.

37
PROJECT MODULE DESCRIPTION

The “Hostel Management System” project is divided into two modules. In these modules
following operations are performed:

Operations:

Client Side

Interactive operations using options provided in the application, Example Data Entry
generation and viewing of reports.

Server Side

Database backup should be taken every day. In case of data base crash, last backup
should be restored.

User Characteristics:

The end user of the software can be divided into two categories

Administrator:

Access to master forms for the purpose of data entry and generation of reports.

For access a master forms Administrator must be login with unique Id and Password.

38
If Administrator has not unique Id and Password than firstly Administrator registered.

After login Administrator can perform following operation:

• Approve User
• Reject User
• Upload details
• Delete details
• Update student information and hostel information
• Generate Invoice

Student:

Access to his corresponding records and other information about hostel only.

Users of Website can be of any age. A general knowledge of basic computer skills is
required to use the website.

For using this website student must be login with unique Id and Password which provide
by the administrator.

If student has no unique Id and Password than firstly customer registered in site by
registration form.

After registration, student read term & condition of Company & gives details about his
requirements.

Rooms are divided into different sections.

Each section has separate Categories & Facilities.

After choose the Category, student can choose thefacililities he desires.

39
After Opening the home page, the student can see the information clearly, the four
options should be followed then.

The link selection by the user will include simple mouse clicks on buttons to select
product.

In the button of the page, there has to be a previous button that will send the user to the
page of the previous page, a forward button that should send the user to the next page.
The first page should have no previous; the last page should have no next.

There should be a finish button that should be seen only in the last page.

After finishing all the requirements for allocation of rooms, user will be allocated a room.

The server will save a small MS SQL database that has each user’s name, Email Id, password.
Other information can be saved like the address.

Snapshots

40
Homepage:

Top of Form
/w EPDw ULLTEw /w EWAgLhs/LTB

Login page:

41
Admin page:

42
Faculty information page:

43
reBottom of Form

Registration page:

Course B.tech

44
45
Course MBA:

Course MCA

46
Database tables
Hostel page:

Admission table:

47
48
Enquiry table:

Registration table:

49
Fee table:

Password table:

50
Source code
Master page:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MasterPage : System.Web.UI.MasterPage


{
protected void Page_Load(object sender, EventArgs e)
{

51
}
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{

}
}

Home page:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
}

52
Login page:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection cn;
SqlCommand cmd;
SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
cn = new SqlConnection(ConfigurationManager.AppSettings["cn"].ToString());
cn.Open();

}
protected void Button1_Click(object sender, EventArgs e)
{
//cn.Open();
cmd=new SqlCommand( " select * from password where username ='" +
TextBox1.Text + "' and password = '" + TextBox2.Text + "'",cn);
//cmd.Connection = cn;
dr = cmd.ExecuteReader();

53
if (dr.Read() == true)

{
Session["user"] = dr["username"];
Response.Redirect("administration.aspx", true);
}

else
{
string str;
str = "<script language='javascript'>";
str += "alert('Please Enter Correct UserName And Password')";
str += "</script>";
RegisterClientScriptBlock("s1", str);
//Response.Write(" please enter correct username and password ");
}

// Response.Redirect("administration.aspx");
}
}

Registration page:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

54
public partial class Default3 : System.Web.UI.Page
{
SqlConnection cn = new SqlConnection();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlCommandBuilder build = new SqlCommandBuilder();
//SqlDataReader dr;

protected void Page_Load(object sender, EventArgs e)


{
//cn.ConnectionString = "Data Source=.;Initial Catalog=cms;Integrated
Security=True";
cn = new SqlConnection(ConfigurationManager.AppSettings["cn"].ToString());
cn.Open();

//cn.Close();
cmd.CommandText = "select * from registration";
cmd.Connection = cn;
da.SelectCommand = cmd;
da.Fill(ds, "raeg");

build.DataAdapter = da;
da.InsertCommand = build.GetInsertCommand();
if (!IsPostBack)
{
studentdata();
}
}

55
/* public void studentdata1()
{
cn.Open();

cmd.CommandText = "select * from registration ";// where first_name like '%" +


TextBox1.Text + "%' ";
cmd.Connection = cn;
//cmd.CommandType = CommandType.StoredProcedure;
// cmd.Parameters.Add("@sname", SqlDbType.VarChar, 50);
// cmd.Parameters["@sname"].Value=Convert.ToString(TextBox1.Text);
da.SelectCommand = cmd;
da.Fill(ds, "raeg");
cn.Close();
GridView1.DataSource = ds.Tables["raeg"];
GridView1.DataBind();*/

//}
public void studentdata()
{ //cn.Open();

cmd.CommandText = "select * from registration where first_name like '%"+


TextBox1.Text +"%' " ;
cmd.Connection = cn;
//cmd.CommandType = CommandType.StoredProcedure;
//cmd.Parameters.Add("@sname", SqlDbType.VarChar, 50);
//cmd.Parameters["@sname"].Value=Convert.ToString(TextBox1.Text);
da.SelectCommand=cmd;
da.Fill(ds, "raeg");
cn.Close();
//GridView1.DataSource=ds.Tables["raeg"];
//GridView1.DataBind();

56
}

protected void Button1_Click(object sender, EventArgs e)


{
DataRow dr;
dr = ds.Tables["raeg"].NewRow();

dr[0] = TextBox1.Text;
dr[1] = TextBox2.Text;
dr[2] = TextBox3.Text;
dr[3] = TextBox4.Text;
dr[4] = TextBox5.Text;
string str,str1,str3,str4;
str = DropDownList2.SelectedItem.Text + "" + DropDownList1.SelectedItem.Text +
"," + DropDownList3.SelectedItem.Text;

dr[5] = str;

if (RadioButton1.Checked == true)
{
str1 = RadioButton1.Text;
}
else
{

57
str1 = RadioButton2.Text;
}
dr[6] = str1;

dr[7] = cat();

str3 = DropDownList4.SelectedItem.Text;

dr[8] = TextBox6.Text; ;
dr[9] = TextBox7.Text;
dr[10] = TextBox8.Text;
dr[11] = str3;
dr[12] = TextBox9.Text;
dr[13] = TextBox10.Text;
dr[14] = TextBox11.Text;
dr[15] = TextBox12.Text;
dr[16] = TextBox13.Text;
dr[17] = TextBox14.Text;

str4 = DropDownList5.SelectedItem.Text;
dr[18] = str4;
dr[19] = TextBox15.Text;
dr[20] = TextBox16.Text;

ds.Tables["raeg"].Rows.Add(dr);
//cn.Open();
da.Update(ds, "raeg");
cn.Close();
TextBox1.Text = "";
TextBox2.Text = "";

58
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
TextBox6.Text = "";
TextBox7.Text = "";
TextBox8.Text = "";
TextBox9.Text = "";
TextBox10.Text = "";
TextBox11.Text = "";
TextBox12.Text = "";
TextBox13.Text = "";
TextBox14.Text = "";
TextBox15.Text = "";
TextBox16.Text = "";
DropDownList1.SelectedItem.Text = "";
DropDownList2.SelectedItem.Text = "";
DropDownList3.SelectedItem.Text = "";
DropDownList4.SelectedItem.Text = "";
DropDownList5.SelectedItem.Text = "";
RadioButton1.Checked = false;
RadioButton2.Checked = false;
RadioButton3.Checked = false;
RadioButton4.Checked = false;
RadioButton5.Checked = false;
RadioButton6.Checked = false;

59
public string cat()
{
string str2;

if (RadioButton3.Checked == true)
{
str2 = RadioButton3.Text;

}
else if(RadioButton4.Checked == true )
{
str2 = RadioButton4.Text;
}
else if (RadioButton5.Checked == true)
{
str2 = RadioButton5.Text;
}
else

{
str2 = RadioButton6.Text;
}

return str2;
}
protected void Button2_Click(object sender, EventArgs e)
{

studentdata();
// Response.Redirect("studentinfo.aspx");
}

60
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("fee.aspx");
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
Response.Redirect("ADMINISTRATION.ASPX");
}
}

Administration
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void BulletedList1_Click(object sender, BulletedListEventArgs e)
{

61
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("home.aspx");
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
Response.Redirect("faculty.aspx");
}
protected void LinkButton3_Click(object sender, EventArgs e)
{
Response.Redirect("registration.aspx");
}
protected void LinkButton4_Click(object sender, EventArgs e)
{
Response.Redirect("change_pass.aspx");
}
protected void LinkButton5_Click(object sender, EventArgs e)
{
Response.Redirect("hostel.aspx");
}
protected void LinkButton7_Click(object sender, EventArgs e)
{
Response.Redirect("library.aspx");
}
protected void LinkButton6_Click(object sender, EventArgs e)
{
Response.Redirect("bus.aspx");
}
}

62
Admin master page:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class adminmaster : System.Web.UI.MasterPage


{
protected void Page_Load(object sender, EventArgs e)
{

}
}

Bus registration:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

63
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection cn = new SqlConnection();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlCommandBuilder build = new SqlCommandBuilder();
//SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
//cn.ConnectionString = "Data Source=.;Initial Catalog=cms;Integrated
Security=True";
cn = new SqlConnection(ConfigurationManager.AppSettings["cn"].ToString());
cn.Open();
cmd.CommandText = "select*from bus";
cmd.Connection = cn;
da.SelectCommand = cmd;
da.Fill(ds, "bus");
build.DataAdapter = da;
da.InsertCommand = build.GetInsertCommand();
cn.Close();

}
protected void Button1_Click(object sender, EventArgs e)
{
DataRow dr;
dr = ds.Tables["bus"].NewRow();

64
dr[0] = TextBox1.Text;
dr[1] = TextBox2.Text;
dr[2] = TextBox3.Text;
dr[3] = TextBox4.Text;
dr[4] = TextBox5.Text;

dr[5] = TextBox6.Text;

ds.Tables["bus"].Rows.Add(dr);
cn.Open();
da.Update(ds, "bus");
cn.Close();

TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
TextBox6.Text = "";

}
}

Password change:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
65
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection cn = new SqlConnection();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlCommandBuilder build = new SqlCommandBuilder();
protected void Page_Load(object sender, EventArgs e)
{
//cn.ConnectionString = "Data Source=.;Initial Catalog=cms;Integrated
Security=True";
cn = new SqlConnection(ConfigurationManager.AppSettings["cn"].ToString());
// cn.Open();
//cmd.CommandText = "select*from password";
// cmd.Connection = cn;
// da.SelectCommand = cmd;
// da.Fill(ds, "pass");
// build.DataAdapter = da;
// da.InsertCommand = build.GetInsertCommand();
// da.UpdateCommand = build.GetUpdateCommand();
// cn.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
cn.Open();
cmd.CommandText = "update password set password='" + TextBox3.Text + "'
where username='" + TextBox1.Text + "' and password='" + TextBox2.Text + "'";
cmd.Connection = cn;

66
cmd.ExecuteNonQuery();
cn.Close();
Response.Redirect("administration.aspx");

}
}

Enquiry :
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection cn ;
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlCommandBuilder build = new SqlCommandBuilder();
protected void Page_Load(object sender, EventArgs e)
{
//cn.ConnectionString = "Data Source=.;Initial Catalog=cms;Integrated
Security=True";
cn = new SqlConnection(ConfigurationManager.AppSettings["cn"].ToString());

67
cn.Open();
cmd.CommandText = "select * from enquiry";
cmd.Connection = cn;
da.SelectCommand = cmd;
da.Fill(ds, "enquiry");
build.DataAdapter = da;
da.InsertCommand = build.GetInsertCommand();
cn.Close();

}
protected void Button1_Click(object sender, EventArgs e)
{
DataRow dr;
dr = ds.Tables["enquiry"].NewRow();

dr[0] = TextBox2.Text;
dr[1] = TextBox1.Text;
ds.Tables["enquiry"].Rows.Add(dr);
cn.Open();
da.Update(ds, "enquiry");
cn.Close();
TextBox1.Text = "";
TextBox2.Text = "";

}
}

Faculty:

using System;
using System.Data;
using System.Configuration;

68
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection cn = new SqlConnection();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlCommandBuilder build = new SqlCommandBuilder();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["fid"] != null)
{
DataRow dr;
//cn.ConnectionString = "Data Source=.;Initial Catalog=cms;Integrated
Security=True";
cn = new SqlConnection(ConfigurationManager.AppSettings["cn"].ToString());
cn.Open();
cmd.CommandText = "select * from faculty where fid=" +
Convert.ToInt32(Request.QueryString["fid"]);
cmd.Connection = cn;
da.SelectCommand = cmd;
da.Fill(ds, "faculty");
cn.Close();

69
/*if (ds.Tables["faculty"].Rows.Count > 0)
{
TextBox1.Text = ds.Tables["faculty"].Row[0]["fid"].Tostring();
TextBox2.Text = ds.Tables["faculty"].Row[0]["name"].Tostring();
TextBox3.Text = ds.Tables["faculty"].Row[0]["qualification"].Tostring();
TextBox4.Text = ds.Tables["faculty"].Row[0]["exp."].Tostring();
TextBox5.Text = ds.Tables["faculty"].Row[0]["post"].Tostring();
TextBox6.Text = ds.Tables["faculty"].Row[0]["department"].Tostring();
}*/
}

}
//cn.ConnectionString = "Data Source=.;Initial Catalog=cms;Integrated
Security=True";
cn = new SqlConnection(ConfigurationManager.AppSettings["cn"].ToString());
cn.Open();
cmd.CommandText = " select * from faculty";
cmd.Connection = cn;
da.SelectCommand = cmd;
da.Fill(ds, "faculty");
build.DataAdapter = da;
da.InsertCommand = build.GetInsertCommand();
cn.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
DataRow dr;
dr = ds.Tables["faculty"].NewRow();
dr[0] = TextBox1.Text;
dr[1] = TextBox2.Text;
dr[2] = TextBox3.Text;
dr[3] = TextBox4.Text;

70
dr[4] = TextBox5.Text;
dr[5] = TextBox6.Text;
ds.Tables["faculty"].Rows.Add(dr);

cn.Open();
da.Update(ds, "faculty");
cn.Close();
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
TextBox6.Text = "";
}
protected void TextBox3_TextChanged(object sender, EventArgs e)
{

}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("facultyinfo.aspx");
}
}
Faculty information:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;

71
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
Response.Redirect("faculty.aspx?fid=" + e.CommandArgument);
}
}

Fee management:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;

72
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection cn = new SqlConnection();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlCommandBuilder build = new SqlCommandBuilder();

protected void Page_Load(object sender, EventArgs e)


{
//cn.ConnectionString = "Data Source=.;Initial Catalog=cms;Integrated
Security=True";
cn = new SqlConnection(ConfigurationManager.AppSettings["cn"].ToString());
cn.Open();
cmd.CommandText = " select * from fee";
cmd.Connection = cn;
da.SelectCommand = cmd;
da.Fill(ds, "fee");
build.DataAdapter = da;
da.InsertCommand = build.GetInsertCommand();
cn.Close();
DateTime dt = new DateTime();

TextBox9.Text = dt.ToString();
TextBox10.Text = dt.AddDays(15).ToString();

73
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{

DataRow dr;
dr = ds.Tables["fee"].NewRow();
dr[0] = TextBox1.Text;
dr[1] = TextBox2.Text;
dr[2] = TextBox3.Text;
dr[3] = TextBox4.Text;
dr[4] = TextBox5.Text;
dr[5] = TextBox6.Text;
dr[6] = TextBox7.Text;
dr[7] = TextBox8.Text;
ds.Tables["fee"].Rows.Add(dr);

cn.Open();
da.Update(ds, "fee");
cn.Close();
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
TextBox6.Text = "";
TextBox7.Text = "";
TextBox8.Text = "";

}
protected void LinkButton1_Click(object sender, EventArgs e)

74
{
Response.Redirect("ADMINISTRATION.ASPX");
}
}

Hostel management:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection cn = new SqlConnection();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlCommandBuilder build = new SqlCommandBuilder();
//SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
//cn.ConnectionString = "Data Source=.;Initial Catalog=cms;Integrated
Security=True";
cn = new SqlConnection(ConfigurationManager.AppSettings["cn"].ToString());
cn.Open();

75
cmd.CommandText = "select*from hostel2";
cmd.Connection = cn;
da.SelectCommand = cmd;
da.Fill(ds, "hostel2");
build.DataAdapter = da;
da.InsertCommand = build.GetInsertCommand();
cn.Close();
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
DataRow dr;
dr = ds.Tables["hostel2"].NewRow();

dr[0] = TextBox1.Text;
dr[1] = TextBox2.Text;
dr[2] = TextBox3.Text;
dr[3] = TextBox4.Text;

ds.Tables["hostel2"].Rows.Add(dr);
cn.Open();
da.Update(ds, "hostel2");
cn.Close();
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";

}
}

Library management:

76
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class LIBRARY : System.Web.UI.Page
{
SqlConnection cn = new SqlConnection();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlCommandBuilder build = new SqlCommandBuilder();
//SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
// cn.ConnectionString = "Data Source=.;Initial Catalog=cms;Integrated
Security=True";
cn = new SqlConnection(ConfigurationManager.AppSettings["cn"].ToString());
cn.Open();
cmd.CommandText = "select*from library";
cmd.Connection = cn;
da.SelectCommand = cmd;
da.Fill(ds, "library");
build.DataAdapter = da;
da.InsertCommand = build.GetInsertCommand();
cn.Close();

77
}

protected void Button1_Click(object sender, EventArgs e)


{
DataRow dr;
dr = ds.Tables["library"].NewRow();

dr[0] = TextBox1.Text;
dr[1] = TextBox2.Text;
dr[2] = TextBox3.Text;
dr[3] = TextBox4.Text;
dr[4] = TextBox5.Text;
TextBox6.Text= System.DateTime.Now.ToString();
dr[5] = TextBox6.Text;

TextBox7.Text=System.DateTime.Now.AddDays(15).ToString();
dr[6] = TextBox7.Text;

ds.Tables["library"].Rows.Add(dr);
cn.Open();
da.Update(ds, "library");
cn.Close();
TextBox1.Text="";
TextBox2.Text="";
TextBox3.Text="";
TextBox4.Text="";
TextBox5.Text="";
//TextBox6.Text="";
//TextBox7.Text="";

78
int a,i ,b,c,d=15;

// a = Convert.ToInt32(TextBox6.Text);

//b = Convert.ToInt32(TextBox7.Text);
//c=b-a;

IMPLEMENTATION

Implementation is the stage in the project where the theoretical design is turned into a
working system and is giving confidence on the new system for the users that it will
work efficiently and effectively. It involves careful planning, investigation of the current
system and it’s constraints on implementation, design of method to achieve the change
over, and evolution of change over method. Apart from planning major task of preparing
the implementation are education and training of users. The implementation process
begin with preparing a plan for the implementation of the system. According to this plan,
the activity are to be carried out, discussion made regarding the equipment and
resources and the additional equipment has to be acquired to implement the new
system. In network backup system no additional resources are needed.

Implementation are the final and the most important phase. The most critical stage is
achieving a successful new system is giving the user confidence that the system will
work and will effective. The system can be implement after through testing is done and

79
if it is found to be working according to the specification. This method also offer the
greatest security since the old system can take over if the error are found or inability to
handle certain type of transaction while using the new system.

User training:

After the system is implemented successfully, training of the user is one of the most
important subtask of the developer. For this purpose user manuals are prepared and
handled over to the user to operate the development system. Thus the user are trained
to operate the developed system. Both the hardware and software securities are made
to run the developed system successfully in future. In order to put new application
system into use, the following activities were taken care of:

Preparing of user and system documentation

Conducting user training with demo and handson

Test run for sum period to ensure smooth switching over the system.

The user are trained to use the newly development system. User manual describing
procedures for using the function listed on menu are circulated to all the user. It is
confirmed that the system is implemented up to user need and expectation.

Security and maintenance:

Maintenance involve the software industry captive, typing up system resource. It means
restoring something to it’s original condition. Maintenance follow conversion to the
extend that change are necessary to maintain satisfactory operation related to change
in the user environment. Maintain often includes minor enhancement or correction to
problem that surface in system operation. Maintenance is also done based on fixing the
problem reported, changing the interface with other software or hardware enhancing the
software.

80
Any system developed should be secured and protected against possible hazards.
Security measure are provided to prevent unauthorized access of the database at
various level. An uninterrupted power supply should be so that the power failure or
voltage fluctuations will not erase the data in the files.

Password protection and simple procedure to prevent the unauthorized access are
provided to the user. The system allow the user to enter the system only through proper
user name and password.

81
Contribution

Our project “HOSTEL MANAGEMENT SYSTEM” is develop on the ASP.NET ( with c#).

The project contains three major fields coding part, designing part and database
connectivity.

As we are three team members in our team to develop the project. We all contribute
equal parts in all fields as we work as a single team.

Pradeep have design and coding of home page and administrator page and also done
database connectivity.

Purva have design and coding of library and fee management pages.

Ayush have done faculty, enquiry and contact us pages.

But we all have knowledge of each others part.

82
CONCLUSION

To conclude the description about the project. The project, developed using ASP.NET
(with C# ) and SQLEXPRESS is based on the requirement specification of the user and
the analysis of the existing system, with flexibility for future enhancement.

The expanded functionality of today’s software required an appropriate approach toward


software approach. The hostel management software is designed for people who want
to manage various activities in the hostels. For the past few yeas the number of
educational institutions are increasingly rapidly. Thereby the number of hostels are also
increasing are accommodations of the student studying in the institution. And hence
there is a lots of strain on the person who are running the hostel and software’s are not
usually used in the context. This particular project deals with the problem on managing
a hostel avoids the problem which occur when carried manually.

Identification of the drawbacks of the existing system leads of the designing of


computerized system that will be compatible to the existing system with the system
which is more user friendly and more GUI oriented.

83
BIBILOGRAPHY
Websites
1. http:\\www.msdn.com
2. http:www.W3schools.com
3. http:\\www.wikipedia.org\itil
4. http:\\www.asp.net
5. http:\\www.dotnetspider.com
6. http:\\www.codeprojects.com

Books for References


1. Pro ASP.NET 3.5 in C# 2008, Second Edition
2. ADO.Net Complete Reference
3. ASP.NET Wrox Publications
4. IBM ITILv3 exam guide
5. I.T. Infrastructure and management – Anita senger

84

You might also like