You are on page 1of 28

Term Paper of Database Administration (CAP – 414)

Book Store Management System

SUBMITTED BY: SUBMITTED TO:

Name: Hunney Salhotra Mrs. Smita Saini

Class: BCA-MCA Dept: CSE\IT

Reg no.: 3010060019

Roll no.: 06
Acknowledgement
The term paper on ‘Book Store Management System’ prepared by me could not have been
completed without the moral support of our Teacher Mrs. Smita Saini. A Special Thanks to her
for guiding my efforts to perfection.

Finally, I would like to thank all my friends for their encouragement and good wishes.

-Hunney Salhotra

2
Table of Contents

Table of Contents....................................................................................................... 3
Aim............................................................................................................................. 4
Front End and Back End of the project.......................................................................4
SQL Server 2005..........................................................................................................................4
Visual Basic 2005........................................................................................................................4
Brief Explanation of Project........................................................................................5
Hardware and Software Requirements........................................................................................5
E-R Diagram................................................................................................................................5
Coding and Snapshots..................................................................................................................7
Coding At Back End..................................................................................................................26
Limitations................................................................................................................27
Future Use................................................................................................................27
Conclusion................................................................................................................ 27
Bibliography and References....................................................................................28

3
Aim
The project ‘Book Store Management System’ was undertaken for the partial fulfillment of
internals, as Term Paper for the subject Database Administration (CAP 414).

Front End and Back End of the project


SQL Server 2005

SQL Server 2005 (codenamed Yukon), released in October 2005, is the successor to SQL Server
2000. It included native support for managing XML data, in addition to relational data. For this
purpose, it defined an xml data type that could be used either as a data type in database columns
or as literals in queries. XML columns can be associated with XSD schemas; XML data being
stored is verified against the schema. XML is converted to an internal binary data type before
being stored in the database. Specialized indexing methods were made available for XML data.
XML data is queried using XQuery; SQL Server 2005 added some extensions to the T-SQL
language to allow embedding XQuery queries in T-SQL. In addition, it also defines a new
extension to XQuery, called XML DML that allows query-based modifications to XML data.
SQL Server 2005 also allows a database server to be exposed over web services using TDS
packets encapsulated within SOAP (protocol) requests. When the data is accessed over web
services, results are returned as XML.

For relational data, T-SQL has been augmented with error handling features and support for
recursive queries. SQL Server 2005 has also been enhanced with new indexing algorithms and
better error recovery systems. Data pages are check summed for better error resiliency, and
optimistic concurrency support has been added for better performance. Permissions and access
control have been made more granular and the query processor handles concurrent execution of
queries in a more efficient way. Partitions on tables and indexes are supported natively, so
scaling out a database onto a cluster is easier. SQL CLR was introduced with SQL Server 2005
to let it integrate with the .NET Framework.

Visual Basic 2005

Visual Basic 2005 helps you create solutions that run on the Microsoft Windows operating
system. If you are looking at this book, you might have already felt the need or the desire to
create such programs. Even if you have never written a computer program before, as you
progress through the Try It Out exercises in this book, you will become familiar with the various
aspects of the Visual Basic 2005 language, as well as its foundation in Microsoft’s .NET
Framework. You will find that it is not nearly as difficult as you have been imagining. Before
you know it, you will be feeling quite comfortable creating a variety of different types of

4
programs with Visual Basic 2005. Also (as the name .NET implies) Visual Basic 2005 can be
used to create applications for use over the Internet. You can also create mobile applications for
Pocket PCs and Smart-Phones.

Brief Explanation of Project


The project Book Store Management System is undertaken with the motive of facilitating the
work of any book store in the market. With its advanced features and enhanced functionality,
Book Store Management System will turn the work store manager to child’s play.

Features:

 Inventory Management

 Billing Mechanism

 Password Management

Hardware and Software Requirements


o Hardware Requirement:

• 512 MB RAM

• 1 GB Hard Disk for data and program

• VGA Card Adapter

• A pointing device or mouse

o Software Requirement

• Microsoft Windows XP platform

• SQL Server 2005 for database operations

E-R Diagram

id bookname author

publication source
Inventory
5

quantity bill no. price


6
Coding and Snapshots

Form1:
Public Class Form1
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim NewMDIChild As New addinven()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
End
End Sub

Private Sub AddInventoryToolStripMenuItem_Click_1(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
AddInventoryToolStripMenuItem.Click
Dim NewMDIChild As New addinven()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Dim NewMDIChild As New viewinven()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
End Sub

Private Sub ViewInventoryToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ViewInventoryToolStripMenuItem.Click
Dim NewMDIChild As New viewinven()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click

7
Dim NewMDIChild As New toorder()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
End Sub

Private Sub ToOrderToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles ToOrderToolStripMenuItem.Click
Dim NewMDIChild As New toorder()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button5.Click
Dim NewMDIChild As New search()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
End Sub

Private Sub SearchToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles SearchToolStripMenuItem.Click
Dim NewMDIChild As New search()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Dim NewMDIChild As New invoice()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
End Sub

Private Sub InvoiceToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles InvoiceToolStripMenuItem.Click
Dim NewMDIChild As New invoice()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
End Sub

Private Sub PasswordManagementToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
PasswordManagementToolStripMenuItem.Click
Dim NewMDIChild As New pass()
'Set the Parent Form of the Child window.

8
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
End Sub

Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
AboutBox1.Show()
End Sub
End Class

9
addinven Form:

Imports System.Data
Imports System.Data.SqlClient
Public Class addinven
Inherits System.Windows.Forms.Form
Dim con As New SqlConnection("Data Source=HP\SQLEXPRESS;Initial
Catalog=master;Integrated Security=True")
Dim da As SqlDataAdapter
Dim ds As DataSet
Dim dv As DataView
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
unbind()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox1.Focus()
Button2.Enabled = False
Button3.Enabled = False

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button5.Click
Me.Close()
End Sub

Private Sub addinven_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the
'MasterDataSet.inventory' table. You can move, or remove it, as needed.
'Me.InventoryTableAdapter.Fill(Me.MasterDataSet.inventory)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
unbind()
Button6.Enabled = True
Button1.Enabled = False
TextBox1.Focus()
Button2.Enabled = False
Button3.Enabled = False
End Sub
Public Sub unbind()
TextBox1.DataBindings.Clear()
TextBox2.DataBindings.Clear()
TextBox3.DataBindings.Clear()

10
TextBox4.DataBindings.Clear()
TextBox5.DataBindings.Clear()
TextBox6.DataBindings.Clear()
TextBox7.DataBindings.Clear()
TextBox8.DataBindings.Clear()
End Sub

Private Sub FillByToolStripButton_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs)
Try
Me.InventoryTableAdapter.FillBy(Me.MasterDataSet.inventory, New
System.Nullable(Of Integer)(CType(IdToolStripTextBox.Text, Integer)))
Button2.Enabled = True
Button3.Enabled = True
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button6.Click
Dim com As SqlCommand = New SqlCommand()
com.Connection = con
com.CommandType = CommandType.Text
Try
com.Parameters.Clear()
com.CommandText = "INSERT INTO inventory VALUES (@id, @name,
@auth, @pub, @quan, @source, @pri, @bill)"
com.Parameters.AddWithValue("@id", TextBox1.Text)
com.Parameters.AddWithValue("@name", TextBox2.Text)
com.Parameters.AddWithValue("@auth", TextBox3.Text)
com.Parameters.AddWithValue("@pub", TextBox4.Text)
com.Parameters.AddWithValue("@quan", TextBox5.Text)
com.Parameters.AddWithValue("@source", TextBox6.Text)
com.Parameters.AddWithValue("@pri", TextBox7.Text)
com.Parameters.AddWithValue("@bill", TextBox8.Text)
con.Open()
com.ExecuteNonQuery()
MsgBox("Item Added", MsgBoxStyle.Information, "Added...")
Button1.Enabled = True
Button6.Enabled = False
Catch SqlExceptionerr As SqlException
MsgBox(SqlExceptionerr.Message)
Finally
con.Close()
End Try

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Dim com As SqlCommand = New SqlCommand()
com.Connection = con
com.CommandType = CommandType.Text
Try
com.Parameters.Clear()

11
com.CommandText = "UPDATE inventory SET id = @id, bookname=
@name, author= @auth,pub= @pub,quan= @quan,source = @source,price=
@pri,bill= @bill WHERE id= @ide"
com.Parameters.AddWithValue("@id", TextBox1.Text)
com.Parameters.AddWithValue("@name", TextBox2.Text)
com.Parameters.AddWithValue("@auth", TextBox3.Text)
com.Parameters.AddWithValue("@pub", TextBox4.Text)
com.Parameters.AddWithValue("@quan", TextBox5.Text)
com.Parameters.AddWithValue("@source", TextBox6.Text)
com.Parameters.AddWithValue("@pri", TextBox7.Text)
com.Parameters.AddWithValue("@bill", TextBox8.Text)
com.Parameters.AddWithValue("@ide", IdToolStripTextBox.Text)
con.Open()
com.ExecuteNonQuery()
MsgBox("Item Updated", MsgBoxStyle.Information, "Updated...")
Catch SqlExceptionerr As SqlException
MsgBox(SqlExceptionerr.Message)
Finally
con.Close()
End Try
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Dim com As SqlCommand = New SqlCommand()
com.Connection = con
com.CommandType = CommandType.Text
Try
com.Parameters.Clear()
com.CommandText = "DELETE FROM inventory WHERE id= @ide"
com.Parameters.AddWithValue("@ide", IdToolStripTextBox.Text)
con.Open()
com.ExecuteNonQuery()
MsgBox("Item Deleted", MsgBoxStyle.Critical, "Deleted...")
Catch SqlExceptionerr As SqlException
MsgBox(SqlExceptionerr.Message)
Finally
con.Close()
End Try
End Sub

Private Sub FillByToolStripButton_Click_1(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles FillByToolStripButton.Click
Try
Me.InventoryTableAdapter.FillBy(Me.MasterDataSet.inventory, New
System.Nullable(Of Integer)(CType(IdToolStripTextBox.Text, Integer)))
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
Button2.Enabled = True
Button3.Enabled = True

End Sub

End Class

12
13
invoice Form:
Imports System.Data
Imports System.Data.SqlClient
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared

Public Class invoice


Inherits System.Windows.Forms.Form
Public bid As Integer

Dim con As New SqlConnection("Data Source=HP\SQLEXPRESS;Initial


Catalog=master;Integrated Security=True")
Dim da As SqlDataAdapter
Dim ds As DataSet
Dim dv As DataView
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Me.Close()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
DataGridView1.Rows.Clear()
End Sub
Private Sub invoice_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.LostFocus
Dim dt As Date
dt = Now
TextBox1.Text = Trim(dt.Day.ToString) & Trim(dt.Month.ToString) &
Trim(dt.Hour.ToString) & Trim(dt.Minute.ToString) & Trim(dt.Second.ToString)
TextBox2.Text = dt.ToLongDateString

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Dim com As SqlCommand = New SqlCommand()
Dim i As Integer
Dim j As Integer = 0
com.Connection = con
com.CommandType = CommandType.Text
For i = 0 To DataGridView1.RowCount - 1
Try
com.Parameters.Clear()
com.CommandText = "INSERT INTO invoice VALUES (@billid,
@date, @bid, @bname, @ba, @bp,@bq, @bpri, @btp, @bttp)"
com.Parameters.AddWithValue("@billid", TextBox1.Text)
com.Parameters.AddWithValue("@date", TextBox2.Text)
com.Parameters.AddWithValue("@bid",
DataGridView1.Rows.Item(i).Cells(0).Value)
com.Parameters.AddWithValue("@bname",
DataGridView1.Rows.Item(i).Cells(1).Value)

14
com.Parameters.AddWithValue("@ba",
DataGridView1.Rows.Item(i).Cells(2).Value)
com.Parameters.AddWithValue("@bp",
DataGridView1.Rows.Item(i).Cells(3).Value)
com.Parameters.AddWithValue("@bq",
DataGridView1.Rows.Item(i).Cells(4).Value)
com.Parameters.AddWithValue("@bpri",
DataGridView1.Rows.Item(i).Cells(5).Value)
com.Parameters.AddWithValue("@btp",
DataGridView1.Rows.Item(i).Cells(6).Value)
com.Parameters.AddWithValue("@bttp", TextBox3.Text)
con.Open()
com.ExecuteNonQuery()
con.Close()
j = j + 1
Catch SqlExceptionerr As SqlException
MsgBox(SqlExceptionerr.Message)
Finally
con.Close()
End Try
Next
If Not j = 0 Then
MsgBox(j & " item(s) sold", MsgBoxStyle.Information, "Sold")
End If
For i = 0 To DataGridView1.RowCount - 1
Try
com.Parameters.Clear()
com.CommandText = "UPDATE inventory SET quan = quan-@quan
WHERE id = @bid"
com.Parameters.AddWithValue("@bid",
DataGridView1.Rows.Item(i).Cells(0).Value)
com.Parameters.AddWithValue("@quan",
DataGridView1.Rows.Item(i).Cells(4).Value)
con.Open()
com.ExecuteNonQuery()
Catch SqlExceptionerr As SqlException
MsgBox(SqlExceptionerr.Message)
Finally
con.Close()
End Try
Next
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button5.Click
Dim i As Integer
Dim tot As Integer = 0
For i = 0 To DataGridView1.RowCount - 1
DataGridView1.Rows.Item(i).Cells(6).Value =
DataGridView1.Rows.Item(i).Cells(4).Value *
DataGridView1.Rows.Item(i).Cells(5).Value
Next
For i = 0 To DataGridView1.RowCount - 1
tot = tot + DataGridView1.Rows.Item(i).Cells(6).Value
TextBox3.Text = tot
Next
Label4.Text = DataGridView1.RowCount - 1 & " item(s) in the list"

15
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click

Dim NewMDIChild As New cr()


'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Form1
'Display the new form.
NewMDIChild.Show()

End Sub

End Class

16
pass Form:
Imports System.Data
Imports System.Data.SqlClient
Public Class pass
Inherits System.Windows.Forms.Form
Dim con As New SqlConnection("Data Source=HP\SQLEXPRESS;Initial
Catalog=master;Integrated Security=True")
Dim da As SqlDataAdapter
Dim ds As DataSet
Dim dv As DataView

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Dim com As SqlCommand = New SqlCommand()
com.Connection = con
com.CommandType = CommandType.Text
If TextBox1.Text = TextBox2.Text Then
Try
com.Parameters.Clear()
com.CommandText = "INSERT INTO log1 VALUES (@pass)"
com.Parameters.AddWithValue("@pass", TextBox2.Text)
con.Open()
com.ExecuteNonQuery()
MsgBox("Password Created", MsgBoxStyle.Information,
"Added...")
Button1.Enabled = True
Button3.Enabled = False
Button4.Enabled = False
TextBox4.Enabled = False
Catch SqlExceptionerr As SqlException
MsgBox(SqlExceptionerr.Message)
Finally
con.Close()
End Try
Else
MsgBox("Passwords do not match")
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Me.Close()
End Sub

Private Sub pass_Activated(ByVal sender As Object, ByVal e As


System.EventArgs) Handles Me.Activated
If Not TextBox3.Text = "" Then
Button1.Enabled = False
Else
Button1.Enabled = True
Button3.Enabled = False
Button4.Enabled = False
TextBox4.Enabled = False

17
End If
End Sub

Private Sub pass_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'MasterDataSet2.log1'
table. You can move, or remove it, as needed.
Me.Log1TableAdapter.Fill(Me.MasterDataSet2.log1)

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Dim com As SqlCommand = New SqlCommand()
com.Connection = con
com.CommandType = CommandType.Text
If TextBox4.Text = TextBox3.Text And TextBox1.Text = TextBox2.Text
Then
Try
com.Parameters.Clear()
com.CommandText = "UPDATE log1 SET pass = @pass"
com.Parameters.AddWithValue("@pass", TextBox2.Text)
con.Open()
com.ExecuteNonQuery()
MsgBox("Password Updated", MsgBoxStyle.Information,
"Updated...")
Catch SqlExceptionerr As SqlException
MsgBox(SqlExceptionerr.Message)
Finally
con.Close()
End Try
Else
MsgBox("Passwords do not match")
End If
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
Dim com As SqlCommand = New SqlCommand()
com.Connection = con
com.CommandType = CommandType.Text
If TextBox4.Text = TextBox3.Text Then
Try
com.Parameters.Clear()
com.CommandText = "DELETE FROM log1"
con.Open()
com.ExecuteNonQuery()
MsgBox("Item Deleted", MsgBoxStyle.Critical, "Deleted...")

Catch SqlExceptionerr As SqlException


MsgBox(SqlExceptionerr.Message)
Button1.Enabled = True
Button3.Enabled = False
Button4.Enabled = False
TextBox4.Enabled = False
Finally
con.Close()

18
End Try
Else
MsgBox("Passwords do not match")
End If
End Sub
End Class

19
access Form

Public Class access

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Dim i As Integer
If TextBox2.Text = TextBox3.Text Then
MsgBox("Access Allowed", MsgBoxStyle.Information, "Allowed")
Form1.Show()
Me.Visible = False
Else
i = i + 1
If i = 3 Then
MsgBox("You are not authorised. Application will close")
End
End If
MsgBox("Access Denied. Try Again", MsgBoxStyle.Critical, "Denied")
TextBox2.Clear()
TextBox2.Focus()
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
End
End Sub

Private Sub access_Activated(ByVal sender As Object, ByVal e As


System.EventArgs) Handles Me.Activated
If TextBox3.Text = "" Then
Form1.Show()
Me.Visible = False
End If
End Sub

Private Sub access_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'MasterDataSet2.log1'
table. You can move, or remove it, as needed.
Me.Log1TableAdapter1.Fill(Me.MasterDataSet2.log1)
'TODO: This line of code loads data into the 'MasterDataSet.log1'
table. You can move, or remove it, as needed.
'Me.Log1TableAdapter.Fill(Me.MasterDataSet.log1)
'TODO: This line of code loads data into the 'MasterDataSet.loginID'
table. You can move, or remove it, as needed.
Me.LoginIDTableAdapter.Fill(Me.MasterDataSet.loginID)

End Sub

End Class

20
21
Search Form

Public Class search

Private Sub search_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the
'MasterDataSet.inventory' table. You can move, or remove it, as needed.
Me.InventoryTableAdapter.Fill(Me.MasterDataSet.inventory)

End Sub

Private Sub FillBy1ToolStripButton_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles FillBy1ToolStripButton.Click
Try
Me.InventoryTableAdapter.FillBy1(Me.MasterDataSet.inventory, New
System.Nullable(Of Integer)(CType(IdToolStripTextBox.Text, Integer)))
Label1.Text = DataGridView1.RowCount & " item(s) found."
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

End Sub

Private Sub FillBy2ToolStripButton_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles FillBy2ToolStripButton.Click
Try
Me.InventoryTableAdapter.FillBy2(Me.MasterDataSet.inventory,
BooToolStripTextBox.Text)
Label1.Text = DataGridView1.RowCount & " item(s) found."
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

End Sub

Private Sub FillBy3ToolStripButton_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles FillBy3ToolStripButton.Click
Try
Me.InventoryTableAdapter.FillBy3(Me.MasterDataSet.inventory,
PuToolStripTextBox.Text)
Label1.Text = DataGridView1.RowCount & " item(s) found."
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

End Sub

Private Sub FillBy4ToolStripButton_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles FillBy4ToolStripButton.Click
Try
Me.InventoryTableAdapter.FillBy4(Me.MasterDataSet.inventory,
AuToolStripTextBox.Text)
Label1.Text = DataGridView1.RowCount & " item(s) found."

22
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Me.Close()
End Sub

End Class

23
toorder Form:

Public Class toorder

Private Sub toorder_GotFocus(ByVal sender As Object, ByVal e As


System.EventArgs) Handles Me.GotFocus
Label1.Text = "We have to order " & DataGridView1.RowCount & "
item(s) as soon as possible"
End Sub

Private Sub toorder_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'MasterDataSet.View1'
table. You can move, or remove it, as needed.
Me.View1TableAdapter.Fill(Me.MasterDataSet.View1)

End Sub

Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object,


ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Me.Close()
End Sub

End Class

24
viewinven Form:

Public Class viewinven

Private Sub viewinven_GotFocus(ByVal sender As Object, ByVal e As


System.EventArgs) Handles Me.GotFocus
Label1.Text = "We have " & DataGridView1.RowCount & " item(s) in
Inventory"
End Sub

Private Sub viewinven_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the
'MasterDataSet.inventory' table. You can move, or remove it, as needed.
Me.InventoryTableAdapter.Fill(Me.MasterDataSet.inventory)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Me.Close()
End Sub

End Class

25
Coding At Back End

create table inventory


(id int primary key,
bookname varchar(60),
author varchar(60),
pub varchar(60),
quan int,
source varchar(60),
price int,
bill varchar(20))
select * from inventory

create view View1


as select * from inventory where quan<3

create table invoice


(id bigint,
date varchar(40),
bookid int foreign key references inventory(id),
bookname varchar(60),
author varchar(60),
pub varchar(60),
quan int,
pri int,
tpri int,
billtot int)

create table log1


(
pass varchar(30))

26
Limitations

Limitations of project are as follows:

o The project is designed to be single user software.

o The project doesn’t undertake the staff management as its part.

Future Use

In future the software will be able to connect to internet and will gain client server architecture. It
will be very useful for the multi city book stores with centralized database. It will be helpful in
online selling and purchasing of book.

Conclusion

So, to conclude, the project is working fine in many areas and despite of some limitations, it is
fulfilling its aim and goal.

27
Bibliography and References

• Visual Basic.Net Black Book

• google.com

• SQL Server 2005 The Complete Guide

28