Jewel
Jewel
Jewel
The project is user friendly that is, it will help the customer in online shopping
for the purchase of solid jewels from Automated System for Jewellery System purchasing
through online . Basically online purchases is based on time consuming to the customer for
shopping of jewels and search for designs which is available in the web and it is easy for the
customer to purchase who have little knowledge of browsing.
PROBLEM DEFINITION
Automated System for Jewellery Shop is aimed to provide an excellent Management
of resource. The main goal of this project is to increase the efficiency and decrease the manual
entries. It allows the customers to know the status of their resume/application instantly.
This Project helps in saving time, human power and any one can know information
about the jobs. This system will help to reduce the mistakes and also allows any future
updation.
PROBLEM DOMAIN
The activities are to be done to do this system is to analyze the system and to
known about the existing and proposed systems. System models are used to gain
precision and to avoid the ambiguities often found in the natural languages system
description modeling technique used in system analyze is avoids ambiguity by using
precise modeling constructors and process description. It describes the requirements of
the system. This includes finding how the system works and what is does. It also
includes systems problems and what the end-users require of any new or change
system.
2. SYSTEM ANALYSIS
A series of discussion was held among the authorities concerned with the existing
system. Periodic reviews with duty offers were held to monitor the progress, give proper
guidance and direction whenever necessary.
1. Existing System
The existing system carried out manually.
Lot of registers and paper files are maintained to store the information.
Due to lot of paper work, retrieval of information is very difficult.
This process is very time consuming and monotonous which leads to human errors.
Due to paper work storage overheads increases.
2. Proposed System
ASP.Net with VB .Net (Access) with operating system windows XP is used on proposed
system. We convert the existing system into computerized system as accurate and the data
can be stored sequentially. The time consuming is low and processing is speedily.
Proper updating modifications can be easily done by issuing the proposed system.
Reports in Automated System for Jewellery Shop can be verified easily whenever
necessary computerized reports are better than manually prepared reports. Using the menuselected information can be selected easily.
3. REQUIREMENT ANALYSIS
Requirement Analysis is done in order to understand the problem the software system is
to solve. The problem could be automating an existing manual process, developing a new
automated system, or a combination of the two. For large systems that have many features,
and that need to perform may different tasks, understanding the requirement of the system is
a major task. The emphasis in requirements analysis is on identifying what is needed from the
system, not how the system will achieve its goals.
(2) Monitor
80 GB
(4) Ram
512 MB
104 Keys
(6) Mouse
Any
(7) Printer
Any
(b)Software:
(1) Operating system
Windows XP.
SQL Server 2005
mplementation
Feasibility Study
Feasibility Study
Feasibility Study
Analysis
The architectural design-creates a blueprint for the design with the necessary
specifications for the hardware, software, people and data resources.
Coding and debugging creates and programs the final system
System testing evaluates the systems actual functionality in relation to
expected or intended functionality.
Testing
Analysis
Analysis
Analysis
Design
Design
Development
Implementati
Implementation
Development
on
Maintenance
Testing
Maintenance
or
or
Implementation
or
or
Mainte
nance
Design
Including
Feasibility Study)
Feasibility Study
Evaluation
Design
Developme
Implementation
Evaluation
Implementation
Testing
or
nt
Analysis
Design
Evaluation
Mainte
nance
Requirement
Analysis
System Design
Testing
Maintenance
Implementation
4. SYSTEM DESIGN
Introduction
In developing a design a system, it is advisable for all proposals to be bill from top to
bottom that are most beneficial to the college. The purpose of the preliminary design is to
evaluate project requests. In detailed study, the collection of details to complexity, describe
the system initial and internal issues involved in the design process.
The data that analysts collect during preliminary design through two primary
methods, they are submitting titles and selecting titles. The technical issues usually raised
during the feasibility design like does that necessary technology exists to do what better
analysis to design transition, design of data base interaction design for data communications.
The design of an information system produces the details that state how a system will
meet the requirements identifiers during systems analysis. Systems design process by
identifying reports and other outputs the system will produce the system design, which also
describes the data be entered or input, calculated values or storage of required data into files
or database.
Although the review of a user developed application may not take long, this process
allows a project selection to keep abreast of the applications that are under development and
see how project requests, regardless of their origin, must be evaluated for their operations,
technical and economical factors will influence the preliminary design.
The documents containing the design specifications portray the design in different
ways. The preliminary design is responsible for providing programmers with complete and
clearly outlined software specifications.
Design Process
Software design is an interactive process through which the requirements are
translated into a blue print for constructing the software.
The three characteristics that serve as a guide for the evolution of good design of a
software design are as follows.
The design must implement all of the explicit requirements contained in the analysis
model and it must accommodate all of the implicit requirements of customer.
The design must be readable, understandable guide for those who generates code and
for those who test and subsequently maintain the software.
The design should provide a complete picture of the software addressing the data
functional and behavioral domains from an implementation perspective.
The guidance for the evolutions of the quality of the design representations are:
A design should exhibit a hierarchical organization that makes intelligent
Use of control among elements of software.
A design should be modular that is software should be logically partitioned into
elements that perform specific functions and sub functions.
A design should contain both data and procedural abstractions.
A design should lead modules that exhibit independent functional Characteristics.
Design Principles
Software design is both a process and a model. The design process set of steps that
enable the designer to describe all aspects of the software to be built.
The design model is the equivalent of an architects plan for a house. It begins by
representing the totally of the thing to be built, and slowly refines the thing that guide for
consulting each design.
Basic design principles that enable the software engineer to navigate the design
processes are:
The design process should not suffer from Tunnel Vision
The design should be traceable to the analysis model.
4.1.1. Normalization
Normalization is the process of simplifying the relationship between data elements in
a record. Through this technique, a collection of data in a record structure is replaced by
successive record structures that are simples and more predictable and therefore more
manageable.
Normalization is the formal approach, which examines data and group data item.
Together in a form that is better able to accommodate future changes and to minimize the
impact of that change on that application.
Normalization is carried out of the following reasons:
To structure the Mobile Showroom details data so that any persistent relationship
between entities can be represented.
To permit simple retrieval of Mobile Showroom Maintenance System data in
response to query and report requests.
Methods:
Identify suitable primary key from a pool of un normalized data. Remove any item
that repeats within a single value of this key to another relation bringing within them. The
Primary key to form part of a new composite key in the new relation.
Methods:
For every relation within a single data item making up the primary key, this rule
should always be true. For those with a compound key examines every column and
determines whether its value depends upon the whole of the compound key or just some of
the part it. Remove those that depends only a part of the key to new relation with that part as
the primary key.
Methods:
Examine every non-key column and question its relationship with every other nonkey column. It for a value for column there is only on value for column B, remove both
columns to a separate relation and mark the question unique as a primary key.
A Mobile Showroom Maintenance System databases tables involved here needs
normalization technique so that it should be flexible to Oracle and store the value in it. So the
third normal form is applied and all the tables are normalized according to that. This system
supports 3 normal forms.
Data Modeling
The information flow defined as a process of the business modeling is refined into set
of data objects that are needed to support the business. The characteristics(called attributes)
of each object are identified and relationships between these objects are defined.
Process Modeling
The data objects defined in the data-modeling phase are transformed to achieve the
information flow necessary to implement a business function. Processing description are
created for addition, modifying, deleting or retrieving a data project.
Easy Programming Model. VB.NET makes building real world Web applications
dramatically easier. VB.NET server controls enable an HTML-like style of declarative
programming that let you build great pages with far less code than with classic ASP.
Displaying data, validating user input, and uploading files are all amazingly easy. Best
of all VB.NET pages work in all browsers -- including Netscape, Opera, AOL, and
Internet Explorer.
Flexible Language Options. ASP.NET lets you leverage your current programming
language skills. Unlike classic ASP, which supports only interpreted VBScript and
JScript, ASP.NET now supports more than 25 .NET languages (including built-in
support for VB.NET, C#, and JScript.NET -- no tool required), giving you
unprecedented flexibility in your choice of language.
Great Tool Support. You can harness the full power of ASP.NET using any text editor
-- even Notepad! But Visual Studio 2005 adds the productivity of Visual Basic-style
development to the Web. Now you can visually design ASP.NET Web Forms using
familiar
drag-drop-double-click
techniques,
and
enjoy
full-fledged
code
Compiled execution. ASP.NET is much faster than classic ASP, while preserving the
"just hit save" update model of ASP. However, no explicit compile step is required!
VB.NET will automatically detect any changes, dynamically compile the files if
needed, and store the compiled results to reuse for subsequent requests. Dynamic
compilation ensures that your application is always up to date, and compiled execution
makes it fast. Most applications migrated from classic ASP see a 3x to 5x increase in
pages served.
Rich output caching VB.NET output caching can dramatically improve the
performance and scalability of your application. When output caching is enabled on a
page, ASP.NET executes the page just once, and saves the result in memory in addition
to sending it to the user. When another user requests the same page, VB.NET serves
the cached result from memory without re-executing the page. Output caching is
configurable, and can be used to cache individual regions or an entire page. Output
caching can dramatically improve the performance of data-driven pages by eliminating
the need to query the database on every request.
Web-Farm Session State. VB.NET session state lets you share session data userspecific state values across all machines in your Web farm. Now a user can hit
different servers in the web farm over multiple requests and still have full access to her
session. And since business components created with the .NET Framework are freethreaded, you no longer need to worry about thread affinity.
Enhanced Reliability:
VB .NET ensures that your application is always available to your users.
Memory Leak, DeadLock and Crash Protection. ASP.NET automatically detects and
recovers from errors like deadlocks and memory leaks to ensure your application is
always
available
to
your
users.
For example, say that your application has a small memory leak, and that after a week
the leak has tied up a significant percentage of your server's virtual memory.
ASP.NET will detect this condition, automatically start up another copy of the
ASP.NET worker process, and direct all new requests to the new process. Once the
old process has finished processing its pending requests, it is gracefully disposed and
the leaked memory is released. Automatically, without administrator intervention or
any interruption of service, ASP.NET has recovered from the error.
Easy Deployment:
Dynamic update of running application. VB.NET now lets you update compiled
components without restarting the web server. In the past with classic COM
components, the developer would have to restart the web server each time he deployed
an update. With ASP.NET, you simply copy the component over the existing DLL -ASP.NET will automatically detect the change and start using the new code.
Easy Migration Path. You don't have to migrate your existing applications to start
using ASP.NET. VB.NET runs on IIS side-by-side with classic ASP on Windows 2000
and Windows XP platforms. Your existing ASP applications continue to be processed
by ASP.DLL, while new ASP.NET pages are processed by the new ASP.NET engine.
You can migrate application by application, or single pages. And ASP.NET even lets
you continue to use your existing classic COM business components.
System Design
4.1. Data Flow Diagram:
Basic DFD Symbols data flow is a route, which enables packets of data to travel from the
point to another. Data may flow from a source to a processor and from a data store.
It is used to store the data in
that database.
represents
incoming
transformation
data
flows
are
Context Level
Login
Customers
Administrator
Level 1:
Registration
Password
Customers
Collection
Credit card
Level 4.1:
Admin Login
Product Add
Item Report
Transaction
Report
Customer
Report
Level 4.1.1
Collections
Bangles
Rings
Bracelets
Nose pins
Watches
Earrings
Necklac
es
Data Type
Varchar(50)
Varchar(50)
Varchar(50)
Varchar(50)
Number(10)
Varchar(50
Number
Varchar(25)
Varchar(25)
Varchar(25)
Varchar(25)
Number(10
Varchar(25)
Varchar(25)
Number(25)
Date
Varchar(25)
Data Type
Number(10)
Varchar(50)
Number(10)
Number(10)
Number(20)
Varchar(25)
Varchar(25)
Data Type
Number(10)
Varchar(50)
Number(10)
Number(10)
Number(20)
Varchar(25)
Data Type
Number(10)
Varchar(50)
Number(10)
Number(10)
Number(20)
Varchar(25)
User
Admin
Registration
Customer
Creditcard Details
Product Items
Transactions
Sales
Reports
Jewel Selection
Bill Reports
4.6 ER-DIAGRAMS
The set of primary components that are identified by the ERD are
o Data Object
o Relationships
o Attributes
o Various types of indicators.
The primary purpose of the ERD is to represent data objects and their relationships.
Notations:
Represents Entity
Represents Attributes
Represents Relationships
Represents Links
Represents Aggregation
ER-Diagram
C NAME
CADDR
ESS
ADDRE
SS
CSELECTE
D ITEMS
PID
PRODUC
T PRICE
CID
JEWEL
LARY
CUSTOMER
ADMIN
PRODU
CT
DETAIL
S
SALE
S
SALES DETAILS
PRODUCT
Tran
sacti
ons
PRICE
PID
NO.OF
CUSTOM
ERS
PID
PITEM
NO.OF
PRODUCT
S
STOCK
Total
Price
PID
No. of
Items
PITEM
NOOF
ITEMS
Login
HOME PAGE
REGISTRATION
CREDIT CARD
COLLECTIONS
BILLING
PAYMENT
Admin Side:
Item Add:
Item Report:
Customer Report:
Transaction Report:
SYSTEM TESTING
Testing is the process of exercising or evaluating a system or system component by
manual or automated means to verify that it satisfies specified requirements. Testing is a
process of executing program with the intent of finding errors. A good test case is one that has
highly probability of finding an error. A successful test case is one that detects an as yet
undiscovered error.
Testing involves operation of a system or application under controlled conditions and
evaluating the results. The controlled conditions should include both normal and abnormal
conditions. Testing should d intentionally attempt to make things go wrong to determine if
things happen when they shouldnt or things dont happen when they should.
Testing Objective:
1. Testing is a process of executing a program with the intent of finding an error.
2. A good test case is one that has a high probability of finding an as yet undiscovered error.
3. A successful test is one that uncovers an as yet undercover error
Secondary benefits includes
Levels of Testing
In order to uncover the errors present in different phases we have the concept of
levels of testing. The basic levels of testing are as shown below
Client Needs
Acceptance
Testing
System Testing
Requirements
Integration Testing
Design
Code
Unit Testing
7.2.3System Testing
The following testing strategies have to be followed by the programmers during the
development and the coding phase of the project. Develop each unit separately and then
perform Unit Test for proper functioning. During this check whether the unit is properly
functional using some of the following methods.
Condition Testing
Properly exercise the logical conditions in a program module. Avoid Boolean operator
errors, variable error, parenthesis errors, relational operators errors and arithmetic errors as
far as possible.
Data Flow Testing
This test is to be carried out as follows. Select test paths of program according to
locations of definitions and uses of variable in the program. Now, consider the selected flow
one by one and test it to proper functioning.
Loop Testing
Loop testing is to be performed on all types of the loops, nested loops, concatenated
loops and unconditional loops. Simple loops may not have errors but even then they dont
leave them untested. Properly dry run and examine the nested loops, concatenated and
unstructured ones.
Once you complete development of the units, the next step is to integrate these units as
a package. During integration of these units, perform integration testing and regression testing
so that integration of these units may not create any problems. Repeat this entire test as
recursive activity so that there is minimum possibility of error.
These tests are to be carried out by the programmer of the project.
Any engineering product can be tested in one of two ways:
White Box Testing: This testing is also called as glass box testing. In this testing, by
knowing the specified function that a product has been designed to perform test can be
conducted that demonstrates each function is fully operation at the same time searching for
errors in each function. It is a test case design method that uses the control structure of the
procedural design to derive test cases. Basis path testing is a white box testing.
ii.
Cyclomatic Complexity
iii.
iv.
Graph matrices
Condition testing
ii.
iii.
Loop testing
Black Box Testing: In this testing by knowing the internal operation of a product, tests
can be conducted to ensure that all gears mesh, that is the internal operation performs
according to specification and all internal components have been adequately exercised. It
fundamentally focuses on the functional requirements of the software.
The steps involved in black box test case design are:
i.
ii.
Equivalence partitioning
iii.
iv.
Comparison testing
It is virtually impossible for a software developer to foresee how the customer will
really use a program. Instructions for use may be misinterpreted; strange combination of data
may be regularly used; and output that seemed clear to the tester may be unintelligible to a
user in the field.
When custom software is built for one customer, a series of acceptance tests are
conducted to enable the customer to validate all requirements. Conducted by the end user
rather than the system developer, an acceptance test can range from an informal test drive to
a planned and systematically executed series of tests.
8. SYSTEM IMPLEMENTATION
Implementation is the process of having systems personnel check out and put new equipment
into use, train users, install the new application depending on the size of the organization that
will be involved in using the application and the risk associated with its use, systems
developers may choose to test the operation in only one area of the firm, say in one
department or with only one or two persons. Sometimes they will run the old and new systems
together to compare the results. In still other situation, developers will stop using the old
system one-day and begin using the new one the next.
Once installed, applications are often used for many years. However, both the
organization and the users will change, and the environment will be different over weeks and
months. Therefore, the application will undoubtedly have to be maintained; modifications and
changes will be made to the software, files, or procedures to meet emerging user
requirements. Since organization systems and the business environment undergo continual
change, the information systems should keep pace. In this sense, implementation is ongoing
process.
Evaluation of the system is performed to identify its strengths and weakness. The
actual evaluation can occur along any of the following dimensions.
Operational Evaluation: assessment of the manner in which the system functions,
including ease of use, response time, suitability of information formats, overall reliability, and
level of utilization.
Organization Impact: Identification and measurement of benefits to the organization
in such areas as financial concerns operational efficiency, and competitive impact. Includes
impact on internal and external information flows.
User Manager Assessment: Evaluation of the attitudes of senior and user mangers
within the organization, as well as end-users.
Development Performance: Evaluation of the development process in accordance
with such yardsticks as overall development time and effort, conformance to budgets and
standards, and other project management criteria. Includes assessment of development
methods and tools.
You can invoke the first action, the Index() action, by typing the following URL into your
browser address bar:
/Home/Index
You can invoke the second action, the Details() action, by typing this address into your
browser:
/Home/Details
The Index() action returns a view. Most actions that you create will return views. However, an
action can return other types of action results. For example, the Details() action returns a
RedirectToActionResult that redirects incoming request to the Index() action.
The Index() action contains the following single line of code:
View();
This line of code returns a view that must be located at the following path on your web server:
\Views\Home\Index.aspx
The path to the view is inferred from the name of the controller and the name of the controller
action.
If you prefer, you can be explicit about the view. The following line of code returns a view
named Fred:
View(Fred);
When this line of code is executed, a view is returned from the following path:
\Views\Home\Fred.aspx
If you plan to create unit tests for your ASP.NET MVC application then it is a good idea to be
explicit about view names. That way, you can create a unit test to verify that the expected
view was returned by a controller action.
Adding Content to a View
A view is a standard (X)HTML document that can contain scripts. You use scripts to
add dynamic content to a view.
For example, the view in Listing 2 displays the current date and time.
Listing 2 \Views\Home\Index.aspx
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<!DOCTYPE
html
PUBLIC
"-//W3C//DTD
XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1.0
Transitional//EN"
1.0
Transitional//EN"
namespace.
MVC is a standard design pattern that many developers are familiar with. Some types of Web
applications will benefit from the MVC framework. Others will continue to use the traditional
ASP.NET application pattern that is based on Web Forms and postbacks. Other types of Web
applications will combine the two approaches; neither approach excludes the other.
The MVC framework includes the following components:
Models. Model objects are the parts of the application that implement the logic for the
application's data domain. Often, model objects retrieve and store model state in a
database. For example, a Product object might retrieve information from a database,
operate on it, and then write updated information back to a Products table in SQL
Server.
In small applications, the model is often a conceptual separation instead of a physical one. For
example, if the application only reads a data set and sends it to the view, the application does
not have a physical model layer and associated classes. In that case, the data set takes on the
role of a model object.
Views. Views are the components that display the application's user interface (UI).
Typically, this UI is created from the model data. An example would be an edit view of
a Products table that displays text boxes, drop-down lists, and check boxes based on
the current state of a Products object.
Controllers. Controllers are the components that handle user interaction, work with
the model, and ultimately select a view to render that displays UI. In an MVC
application, the view only displays information; the controller handles and responds to
user input and interaction. For example, the controller handles query-string values, and
passes these values to the model, which in turn queries the database by using the
values.
The MVC pattern helps you create applications that separate the different aspects of the
application (input logic, business logic, and UI logic), while providing a loose coupling
between these elements. The pattern specifies where each kind of logic should be located in
the application. The UI logic belongs in the view. Input logic belongs in the controller.
Business logic belongs in the model. This separation helps you manage complexity when you
build an application, because it enables you to focus on one aspect of the implementation at a
time. For example, you can focus on the view without depending on the business logic.
In addition to managing complexity, the MVC pattern makes it easier to test applications than
it is to test a Web Forms-based ASP.NET Web application. For example, in a Web Formsbased ASP.NET Web application, a single class is used both to display output and to respond
to user input. Writing automated tests for Web Forms-based ASP.NET applications can be
complex, because to test an individual page, you must instantiate the page class, all its child
controls, and additional dependent classes in the application. Because so many classes are
instantiated to run the page, it can be hard to write tests that focus exclusively on individual
parts of the application. Tests for Web Forms-based ASP.NET applications can therefore be
more difficult to implement than tests in an MVC application. Moreover, tests in a Web
Forms-based ASP.NET application require a Web server. The MVC framework decouples the
components and makes heavy use of interfaces, which makes it possible to test individual
components
in
isolation
from
the
rest
of
the
framework.
The loose coupling between the three main components of an MVC application also promotes
parallel development. For instance, one developer can work on the view, a second developer
can work on the controller logic, and a third developer can focus on the business logic in the
model.
Deciding When to Create an MVC Application
You must consider carefully whether to implement a Web application by using either the
ASP.NET MVC framework or the ASP.NET Web Forms model. The MVC framework does
not replace the Web Forms model; you can use either framework for Web applications. (If you
have existing Web Forms-based applications, these continue to work exactly as they always
have.)
Before you decide to use the MVC framework or the Web Forms model for a specific Web
site, weigh the advantages of each approach.
Advantages of an MVC-Based Web Application
The ASP.NET MVC framework offers the following advantages:
It makes it easier to manage complexity by dividing an application into the model, the
view, and the controller.
It does not use view state or server-based forms. This makes the MVC framework
ideal for developers who want full control over the behavior of an application.
It uses a Front Controller pattern that processes Web application requests through a
single controller. This enables you to design an application that supports a rich routing
infrastructure. For more information on the MSDN Web site.
It works well for Web applications that are supported by large teams of developers and
Web designers who need a high degree of control over the application behavior.
It supports an event model that preserves state over HTTP, which benefits line-ofbusiness Web application development. The Web Forms-based application provides
dozens of events that are supported in hundreds of server controls.
It uses a Page Controller pattern that adds functionality to individual pages. For more
information on the MSDN Web site.
It uses view state or server-based forms, which can make managing state information
easier.
It works well for small teams of Web developers and designers who want to take
advantage of the large number of components available for rapid application
development.
System.Data.SqlClient;
using
System.Data.Odbc;
using
System.Data.OleDb;
using
System.Data.Oracle;
Different
classes
are
used
for
different
purpose.
System.Data.SqlClient: This class is used to communicate with the Sql Server database. The
database
can
be
version
7.0
or
version
2005.
System.Data.SqlClient: This class is used to perform operations on the MySQL databases.
System.Data.OleDb: This class is used to perform operations on the Access Database.
System.Data.Oracle: This class is used to perform operations on the Oracle database.
In this article we will focus on the Sql Server 2000 database and hence we will be using
System.Data.SqlClient namespace to perform different operations on the Sql Server 2000
Database.
Making
the
Database
Connection
Let's see how we can make a database connection. There are several ways of making a
database connection. You can simple drag and drop the database connection on the asp.net
web form and the connection will be made. Let's see how we can do that:
Open you Visual Studio.NET and start a new asp.net web application. In the toolbox you will
see a tab called data. Click on the tab and it will dropdown showing various ADO objects.
Drag and Drop the SqlConnection object on the screen. As soon as you drop the connection
object
you
will
see
it
at
the
bottom
of
the
screen.
Right click on the connection object and select properties. In the properties you can see the
property named "ConnectionString". When you click on it will take you to a wizard where
you can select your database. In this article I will be using Northwind database which can be
found
in
every
Sql
Server
2005
database.
Once you select the database, test your connection by clicking on the Test connection button.
If the connection is correct a message box will pop saying that the connection has been tested
and connection is right.
Problems
using
this
approach
of
making
the
connection
String:
As you have just seen that we just dragged and dropped the connection string on the screen
and the new connection to the database was made in seconds. This approach should never be
used since if in the future you change your connection string you will have to change every
where in the application.
Using Web.config to store the connection String:
As you can see above that you can make your connection string with just one line. Take a look
at the "key" represents the keyword that we will use to refer to it in our application.
"value"
contains
the
connection
string.
"database" contains the name of the database which in this case is Northwind.
I have to point out that saving the connection string like this is not secure. Usually you store
the connection string after encrypting it. I will not perform encryption in this article and keep
the article simple enough.
private
void
Page_Load(object
sender,
System.EventArgs
e)
{
if(!Page.IsPostBack)
{
string connectionString = (string) ConfigurationSettings.AppSettings["ConnectionString"]
SqlConnection
myConnection
new
SqlConnection(connectionString)
ds
new
DataSet()
ad.Fill(ds,"Categories")
myDataGrid.DataSource
myDataGrid.DataBind()
}
}
ds
First, we check that if it's not a postback we load data. For this example to work you need to
add the namespace:
using System.Configuration;
Let's
see
what
is
going
on
here:
1) string connectionString receives the string from the web.config file which is referred by the
"ConnectionString"
key
we
set
in
the
web.config
file.
2) We make the object of the SqlConnection class which deals with SQL Server databases.
3) We made the data adapter object. Data adapter is a kind of connection to the database. In
the data adapter object we specify that what we want from the database. In this case we want
all the rows of the Categories table.
NOTE:
Always use stored procedures for accessing the data. Accessing or running Ad-hoc queries are
dangerous
as
they
are
open
for
SQL
Injections.
4) Next we made an instance of the DataSet class. DataSet will contain the result of the
SqlDataAdapter
5)
Later,
we
even
filled
if
the
the
database
dataset
with
connection
the
data
is
using
not
made.
dataadapter.
6) And finally we assigns the datagrid to the dataset and binds it on the screen.
Pretty
simple
right?
void
Page_Load(object
sender,
System.EventArgs
e)
{
if(!Page.IsPostBack)
{
string connectionString = (string) ConfigurationSettings.AppSettings["ConnectionString"];
SqlConnection
myConnection
SqlDataReader
SqlCommand
new
reader
myCommand
myCommand.CommandType
SqlConnection(connectionString);
=
new
null;
SqlCommand("GetData",myConnection);
CommandType.StoredProcedure;
try
{
myConnection.Open();
reader
myDataGrid.DataSource
myDataGrid.DataBind();
}
myCommand.ExecuteReader();
=
reader;
catch(Exception
ex)
{
//
Catches
and
logs
the
exception
}
finally
{
reader.Close();
myConnection.Close();
}
}
}
In the code above we are using the SqlCommand object and stored procedure. You might have
noted SqlDataReader, if you want to merely iterate through the database rows and select them
its best to use SqlDataReader since its much faster than DataSet
Login page
Imports ADODB
Partial Class _login
Inherits System.Web.UI.Page
Dim cn As New ADODB.Connection
Dim reg As New ADODB.Recordset
Dim bill As New ADODB.Recordset
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
If T1.Text = "administrator" And T2.Text = "admin" Then
Response.Redirect("itemadd.aspx")
Else
cn.Open("nisha")
reg.Open("select * from register where cid='" + T1.Text + "' and pword='" + T2.Text +
"'", cn, 1, 2)
If reg.EOF Then
reg.Close()
cn.Close()
MsgBox("user name or Password wrong", 16, "Password")
T1.Text = ""
T2.Text = ""
T1.Focus()
Else
Session("cid") = T1.Text
Session("cname") = reg.Fields("nam").Value
T1.Text = ""
T2.Text = ""
reg.Close()
bill.Open("select * from billing", cn, 1, 2)
If Not bill.EOF Then
bill.MoveFirst()
While Not bill.EOF
bill.Delete()
bill.MoveNext()
End While
End If
bill.Close()
cn.Close()
Response.Redirect("usermenu.aspx")
End If
End If
End Sub
Registation Form:
Imports ADODB
Partial Class register
Inherits System.Web.UI.Page
Dim cn As New ADODB.Connection
Dim reg As New ADODB.Recordset
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
cn.Open("nisha")
reg.Open("select * from register where cid='" + cid.Text + "'", cn, 1, 2)
reg.Fields("cid").Value = cid.Text
reg.Fields("nam").Value = nam.Text
Dim nish As Date
nish = DateValue(Trim(D2.Text) + "/" + Trim(D1.Text) + "/" + Trim(D3.Text))
reg.Fields("dob").Value = nish
reg.Fields("mblno").Value = Val(mbl.Text)
reg.Fields("address").Value = adrs.Text
reg.Fields("city").Value = city.Text
reg.Fields("state").Value = state.Text
reg.Fields("country").Value = contry.Text
reg.Fields("pincode").Value = Val(pin.Text)
reg.Update()
MsgBox("Saved ur account", 64, "Registration")
reg.Close()
cn.Close()
Call clear()
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
contry.Text = "India"
If Not Page.IsPostBack = True Then
cid.Text = Session("cid").ToString
cn.Open("nisha")
reg.Open("select * from register where cid='" + cid.Text + "'", cn, 1, 2)
nam.Text = reg.Fields("nam").Value
Dim nish As Date
nish = IIf(IsDBNull(reg.Fields("dob").Value), Today.Date, reg.Fields("dob").Value)
D1.Text = nish.Day
D2.Text = nish.Month
D3.Text = nish.Year
mbl.Text = IIf(IsDBNull(reg.Fields("mblno").Value), "", reg.Fields("mblno").Value)
adrs.Text = IIf(IsDBNull(reg.Fields("address").Value), "", reg.Fields("address").Value)
city.Text = IIf(IsDBNull(reg.Fields("city").Value), "", reg.Fields("city").Value)
state.Text = IIf(IsDBNull(reg.Fields("state").Value), "", reg.Fields("state").Value)
contry.Text = IIf(IsDBNull(reg.Fields("country").Value), "",
reg.Fields("country").Value)
pin.Text = IIf(IsDBNull(reg.Fields("pincode").Value), "", reg.Fields("pincode").Value)
reg.Close()
cn.Close()
Button1.Text = "Update"
End If
End Sub
Protected Sub clear()
cid.Text = ""
nam.Text = ""
D1.Text = ""
D2.Text = ""
D3.Text = ""
mbl.Text = ""
adrs.Text = ""
city.Text = ""
state.Text = ""
contry.Text = ""
pin.Text = ""
End Sub
Protected Sub R1_Checked(ByVal sender As Object, ByVal e As System.EventArgs)
Handles R1.CheckedChanged
If R1.Checked = True Then
R2.Checked = False
End If
End Sub
Protected Sub R2_Checked(ByVal sender As Object, ByVal e As System.EventArgs)
Handles R2.CheckedChanged
If R2.Checked = True Then
R1.Checked = False
End If
End Sub
End Class
Credit Card Form:
Imports ADODB
Partial Class creadircard
Inherits System.Web.UI.Page
Dim cn As New ADODB.Connection
D2.Text = nish.Month
D3.Text = nish.Year
T4.Text = IIf(IsDBNull(rs.Fields("cno").Value), "", rs.Fields("cno").Value)
T5.Text = IIf(IsDBNull(rs.Fields("chnam").Value), "", rs.Fields("chnam").Value)
cn.Close()
End If
End Sub
End Class
Change Password:
Imports ADODB
Partial Class changepassword
Inherits System.Web.UI.Page
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
cn.Open("nisha")
rs.Open("select * from register where cid='" + T1.Text + "' and pword='" + T2.Text + "'",
cn, 1, 2)
If rs.EOF Then
rs.Close()
cn.Close()
MsgBox("Your old password is wrong", 64)
Else
rs.Fields("pword").Value = T3.Text
rs.Update()
rs.Close()
cn.Close()
MsgBox("Your password successfully changed", 64)
End If
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
T1.Text = Session("cid").ToString
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button2.Click
Response.Redirect("login.aspx")
End Sub
End Class
Collections:
Imports ADODB
Partial Class jewsel
Inherits System.Web.UI.Page
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
End Sub
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles GridView1.SelectedIndexChanged
Dim row As GridViewRow = GridView1.SelectedRow
cn.Open("nisha", "scott", "tiger")
rs.Open("select * from billing", cn, 1, 2)
rs.AddNew()
rs.Fields("pid").Value = row.Cells(1).Text
rs.Fields("pnam").Value = row.Cells(2).Text
rs.Fields("wht").Value = row.Cells(3).Text
rs.Fields("qty").Value = row.Cells(4).Text
rs.Fields("rate").Value = row.Cells(5).Text
rs.Update()
rs.Close()
cn.Close()
End Sub
End Class
Billing:
Imports ADODB
Partial Class trans
Inherits System.Web.UI.Page
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles GridView1.SelectedIndexChanged
Dim row As GridViewRow = GridView1.SelectedRow
cn.Open("nisha", "scott", "tiger")
Dim raj As Integer
raj = Val(row.Cells(0).Text)
MsgBox(raj)
rs.Open("select * from billing where pid=" & raj, cn, 1, 2)
If Not rs.EOF Then
rs.Delete()
End If
rs.Close()
cn.Close()
Response.Redirect("trans.aspx")
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
Response.Redirect("billing.aspx")
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
End Sub
End Class
Conform Billing:
Imports ADODB
Partial Class billing
Inherits System.Web.UI.Page
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim tra As New ADODB.Recordset
Dim sum As Long = 0
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
cn.Open("nisha")
rs.Open("select * from billing", cn, 1, 2)
If rs.EOF Then
sum = 0
MsgBox("select Item and click it", 64, "Not Selected")
Else
rs.MoveFirst()
While Not rs.EOF
sum = sum + rs.Fields("rate").Value
rs.MoveNext()
End While
GridView1.ShowFooter = True
GridView1.FooterRow.Cells(1).Text = "Total Amount"
GridView1.FooterRow.Cells(4).Text = sum
rs.Close()
cn.Close()
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
cn.Open("nisha")
rs.Open("select * from billing", cn, 1, 2)
tra.Open("select * from transaction", cn, 1, 2)
rs.MoveFirst()
While Not rs.EOF
tra.AddNew()
tra.Fields("pid").Value = rs.Fields("pid").Value
tra.Fields("pnam").Value = rs.Fields("pnam").Value
tra.Fields("wht").Value = rs.Fields("wht").Value
tra.Fields("qty").Value = rs.Fields("qty").Value
tra.Fields("rate").Value = rs.Fields("rate").Value
tra.Fields("cid").Value = Session("cid").ToString
tra.Update()
rs.MoveNext()
End While
tra.Close()
rs.Close()
cn.Close()
MsgBox("Your Purchased Item will be delivered within a week", 64, "Delivery Report")
End Sub
End Class
ADMIN PAGE
Item Add:
Imports ADODB
Partial Class itemadd
Inherits System.Web.UI.Page
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
8. Conclusion
The project entitled Rajendra Jewellery has been successfully developed and
implemented. The testing was carried out by dividing the project into different modules. This
project is successful in replacing the existing system and reduces the workload.
BIBLIOGRAPHY
BOOKS:
Alex Homer, Dave Sussman, Rob Howard, Brain francis, Karli Watson,
Richard Anderson
WEBSITE:
www.google.com