Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Practical File Contents

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 59

Practical File

Of
DBMS and VB.NET
(Paper - PCA09 and PCA10)

Submitted To: Submitted By:

Ms.Gurjot Kaur Srishti


sethi(3540),Isha

Gupta(3487),Rinki (3542)

Assistant Professor

Department of Computer Science

KHALSA COLLEGE FOR WOMEN


CIVIL LINES , LUDHIANA
1
ACKNOWLEDGEMENT

We take immense pleasure in thanking everyone who has helped us to conceive


and develop the project. We express our heartfelt gratitude to the Principal,Dr.
Mrs.Mukti Gill, Khalsa College For Women,Ludhiana and The
Management for providing the needed infrastructure. We wish to express our
deep sense of gratitude to Our Internal Guide and Project Leader, Ms. Gurjot
kaur for their able guidance and useful suggestions, which helped us in
completing the project work, in time. Without them the project could not have
been materialized. We also thank our Labs In-Charge Mr. Anil and Head of
Department Mrs.Parminder Kaur who have unconditionally helped us
whenever we need their assistant and without whom this project could not have
taken shape. Finally, yet importantly, we would like to express our heartfelt
thanks to our Beloved friends/classmates for their help and wishes for the
successful completion of this project. We thank all these people fervently as
they were the leaders and we simply followed them. At last, but definitely not
least, we would like to thank God for being with us all the time.

2
INDEX
Sr.No Content Page No.

1 DBMS 4-6

2 RDBMS 7-10

3 Oracle 11-12

4 SQL 13-15

5 PL/SQL 16-18

6 Introduction to VB.NET 19-20

7 Introduction to Visual Studio 21-22

8 Features of Visual Studio 23

9 Introduction to ADO.NET 24-26

10 Introduction to MS-Access 27-28

11 Hardware & Software Requirements 29-30

12 Introduction to the Project 31

13 Objectives 32

14 Splash Screen 33

1p5 Login Form 34

16 MDI Form 35

17 Calculator 36

18 Text Editor 37-38

19 Registration Form 39-42

20 Coding for splash screen 43

21 Coding for login form 44

22 Coding for MDI form 45

23 Coding for calculator 46-49

24 Coding for text editor 50-53

3
25 Coding for data grid 54

26 Coding for Registration Form 55-58

4
DBMS

Database Management System (DBMS) is a software for storing and retrieving users' data
while considering appropriate security measures. It consists of a group of programs which
manipulate the database. The DBMS accepts the request for data from an application and
instructs the operating system to provide the specific data. In large systems, a DBMS helps
users and other third-party software to store and retrieve data.

DBMS allows users to create their own databases as per their requirement. The term
“DBMS” includes the user of the database and other application programs. It provides an
interface between the data and the software application.

Characteristics of Database Management System

 Provides security and removes redundancy


 Self-describing nature of a database system
 Insulation between programs and data abstraction
 Support of multiple views of the data
 Sharing of data and multiuser transaction processing
 DBMS allows entities and relations among them to form tables.
 It follows the ACID concept ( Atomicity, Consistency, Isolation, and Durability).
 DBMS supports multi-user environment that allows users to access and manipulate
data in parallel.

Advantages of DBMS

 DBMS offers a variety of techniques to store & retrieve data


 DBMS serves as an efficient handler to balance the needs of multiple applications
using the same data
 Uniform administration procedures for data
 Application programmers never exposed to details of data representation and storage.
 A DBMS uses various powerful functions to store and retrieve data efficiently.
 Offers Data Integrity and Security
 The DBMS implies integrity constraints to get a high level of protection against
prohibited access to data.
 A DBMS schedules concurrent access to the data in such a manner that only one user
can access the same data at a time
 Reduced Application Development Time

Disadvantage of DBMS

DBMS may offer plenty of advantages but, it has certain flaws-

 Cost of Hardware and Software of a DBMS is quite high which increases the budget
of your organization.
 Most database management systems are often complex systems, so the training for
users to use the DBMS is required.

5
 In some organizations, all data is integrated into a single database which can be
damaged because of electric failure or database is corrupted on the storage media
 Use of the same program at a time by many users sometimes lead to the loss of some
data.
 DBMS can't perform sophisticated calculations

Application of DBMS

Sector Use of DBMS

Banking For customer information, account activities,


payments, deposits, loans, etc.

Airlines For reservations and schedule information.

Universities For student information, course registrations,


colleges and grades.

Telecommunication It helps to keep call records, monthly bills,


maintaining balances, etc.

Finance For storing information about stock, sales, and


purchases of financial instruments like stocks and
bonds.

Sales Use for storing customer, product & sales


information.

Manufacturing It is used for the management of supply chain and for


tracking production of items. Inventories status in
warehouses.

HR Management For information about employees, salaries, payroll,


deduction, generation of paychecks, etc.

6
The functionality provided by a DBMS can vary enormously. The core functionality is the
storage, retrieval and update of data. Codd proposed the following functions and services a
fully-fledged general purpose DBMS should provide

 Data storage, retrieval and update


 User accessible catalog or data dictionary describing the metadata
 Support for transactions and concurrency
 Facilities for recovering the database should it become damaged
 Support for authorization of access and update of data
 Access support from remote locations
 Enforcing constraints to ensure data in the database abides by certain rules
It is also generally to be expected the DBMS will provide a set of utilities for such purposes
as may be necessary to administer the database effectively, including import, export,
monitoring, defragmentation and analysis utilities. The core part of the DBMS interacting
between the database and the application interface sometimes referred to as the database
engine.
Often DBMSs will have configuration parameters that can be statically and dynamically
tuned, for example the maximum amount of main memory on a server the database can use.
The trend is to minimise the amount of manual configuration, and for cases such
as embedded databases the need to target zero-administration is paramount.

7
RDBMS
A relational database is a type of database. It uses a structure that allows us to identify and
access data in relation to another piece of data in the database. Often, data in a relational
database is organized into tables.

Key factors to consider when selecting a relational database

Initial Setup

Setting up a DBMS, optimizing it for ideal operations, and future-proofing it for growth
requires adequate flexibility for integration into the current data infrastructure.
Synchronization with other platforms is also essential for uninterrupted workflow.

security
Every DBMS will provide different security methods, like encryption, customizable routines,
and access rights, to protect your data. These should all be carefully considered during the
evaluation process. You probably want access controls like authorization and authentication
to be default features, meaning data in tables within a RDBMS is limited to access by specific
users.

model
How will you tell which model is right for your data? If you need to work with unstructured
data, then a relational model won’t work. NoSQL databases are often available as open
source, whereas a RBDMS is usually a commercial purchase.

accuracy/reliability
Some of the questions you will be asking yourself here are your accuracy requirements, and
whether to rely on business logic. Financial data and government reports, for example, will
have more stringent requirements.

Benefits of relational databases

If you want to design a data storage system that makes it easy to manage lots of information,
and is scalable and flexible, a relational database is a good bet.

 Manageability: For starters, an RDB is easy to manipulate. Each table of data can be
updated without disrupting the others.
You can also share certain sets of data with one group, but limit their access to other
groups – for example, allowing only the HR department to see confidential
information about employees.
 Flexibility: If you need to update your data, you only have to do it once – no more
having to change multiple files one at a time. And it’s pretty simple to extend your

8
database. If your records are growing, a relational database is easily scalable to grow
with your data.
 Avoid Errors: There’s no room for mistakes in a relational database because it’s easy
to check for mistakes against data in other parts of the records. And since each piece
of information is stored at a single point, you don’t have the problem of old versions
clouding the picture.

Challenges of relational databases

 Scalability: Relational databases are built on a single server. This means in order to
scale, you’ll need to purchase more expensive hardware with more power, storage,
and memory.
 Performance: Rapid growth in volume, velocity, variety, and complexity of data
creates even more complicated relationships. Relational databases tend to have a hard
time keeping up, which can slow down performance.
 Relationships: Relational databases don’t actually store relationships between
elements, which makes understanding connections between your data reliant on other
joins.

The primary benefit of the relational database approach is the ability to create meaningful


information by joining the tables. Joining tables allows you to understand the relationships
between the data, or how the tables connect. SQL includes the ability to count, add, group,
and also combine queries  RDBMS is the software system that allows storing data in the form
of tables. As we discussed, data stored within RDBMS is in the form of rows and columns
and this kind of a setup is often referred to as tuples and attributes

Advantages:

Data structure:

As discussed, the table format can be easily understood by the users, which makes it simpler
for them to use it. The data access and data organization are arranged using a natural
structure. Matching entries can be located with ease using database queries.

Accessing the Network:

An RDBMS comprises a software program, server daemon, which has been specifically
designed to capture requests sent over a network, facilitating the communication between
database clients and the database. Here the users are not required to log in to the computer

9
system to access or use the database. This facilitates the users with a convenience and a
security layer for your database. Developers utilize this network access facility to create
desktop tools and web apps to interact with databases.

Language:

As discussed previously, an RDBMS supports a standard language that most of us are


familiar with – SQL. This is mainly because the syntax of SQL is simple. It implements
keywords and phrasing in the English language. This further makes it easier to learn and
interpret. Sometimes, an RDBMS is known to add non-SQL database-specific keywords,
functions, and features to this SQL awesomeness.

Though RDBMS does not account as the fastest known database management system
structure, since it offers a number of features, such as ease and simplicity, speed is
automatically overridden. There are a variety of optimizations that have been planted into the
RDBMS along with the database design that further helps in performance enhancement,
thereby facilitating the RDBMS to perform faster for all applications and data sets.
Technological enhancements, decrease in memory and storage costs, and increase in
processor speeds are some of the factors that contribute to helping the technicians build faster
systems for covering up deficiencies in the performance of the database systems.

Maintenance

With RDBMS, maintenance is easier as it helps the database admins or technicians to


maintain, repair, control, test and even back up the databases that reside within their main
system. A built-in automation system or automation tools within the RDBMS on the
operating system helps in automating these functions.

User Access to More Than One Person

As already discussed, the user access is multiple. So, more than one user can access one
database at the same time. As the data is being updated or changed, users can utilize the built-
in locking and transactions management functionality to access the data . This mainly helps in

10
overcoming any possible crashes between more than one users working on the data and
prevents users from accessing or using data that has been partially updated.

Privileges

With the authorization and privilege control features in an RDBMS, it is possible for the
database administrator to stop any access requested by authorized users. But permissions can
be assigned to individual users taking into account the database activities they are intended to
handle or undertake. This authorization is determined depending on the remote client IP
address, which is combined with user authorization, which restricts access to selected
computer systems.

Disadvantages

Cost

The expense of maintaining and even setting up a database system is relatively high and one
of the drawbacks of relational databases. A special software is required for setting up a
relational database and this could cost a fortune. For non-programmers, they would need to
implement a number of products to set up this database. It might not be an easy task to update
all the information and finally get the program running. For large firms with a need for a
more vigorous database, it would be imperative that you get external help from an
experienced programmer to build a relational database implementing SQL. Also, you would
need to get a proficient and experienced relational database administrator to manage and
control this database. No matter what data you use, it is required that you ingress it from
other databases, including Excel spreadsheets or text files. But you can also enter the data via
the keyboard. If you intend to store highly confidential information, 2  it is required that you
secure your data against any kind of unauthorized access.

11
ORACLE

Oracle Database allows you to quickly and safely store and retrieve data. Here are the
integration benefits of the Oracle Database:

 Oracle Database is cross-platform. It can run on various hardware across operating


systems including Windows Server, Unix, and various distributions of GNU/Linux.
 Oracle Database has its networking stack that allows application from a different
platform to communicate with the Oracle Database smoothly. For example, applications
running on Windows can connect to the Oracle Database running on Unix.
 ACID-compliant – Oracle is ACID-compliant Database that helps maintain data
integrity and reliability.
 Commitment to open technologies – Oracle is one of the first Database that supported
GNU/Linux in the late 1990s before GNU/Linux become a commerce product. It has
been supporting this open platform since then.

Oracle Database has several structural features that make it popular:

 Logical data structure – Oracle uses the logical data structure to store data so that you
can interact with the database without knowing where the data is stored physically.
 Partitioning – is a high-performance feature that allows you to divide a large table into
different pieces and store each piece across storage devices.
 Memory caching – the memory caching architecture allows you to scale up a very large
database that still can perform at a high speed.
 Data Dictionary is a set of internal tables and views that support administer Oracle
Database more effectively.
 Backup and recovery – ensure the integrity of the data in case of system failure. Oracle
includes a powerful tool called Recovery Manager (RMAN) – allows DBA to perform
cold, hot, and incremental database backups and point-in-time recoveries.
 Clustering – Oracle Real Application Clusters (RAC) – Oracle enables high availability
that enables the system is up and running without interruption of services in case one or
more server in a cluster fails.

Oracle Database Editions


Oracle provides three main editions of Oracle Databases as follows:

1) Enterprise Edition (EE) is the common and expensive edition of the Oracle Database. It
has the following characteristics:

 No maximum number of CPUs


 No limits on memory or database size
 Include premium features that are not available in other editions.

2) Standard Edition (SE) is a limited edition of the Enterprise Edition that has the following
characteristics:

12
 Limited to four or fewer CPUs
 No limit on memory or database size
 Include many features, but no as many as EE

3) Expression Edition (XE) is a free-to-use version of the Oracle Database that available on
both Windows and GNU/Linux platforms. These are the features of Oracle Database XE 18c:

 Limited to 2 CPUs
 Can use the maximum of 2GB of RAM, and has 12GB of user data.
 Very limited features

Oracle Database (Oracle DB) is a relational database management system (RDBMS) from

Oracle Corporation.

Businesses require scalable, high-performance databases now more than ever. Many leverage

Oracle DB  to drive business applications for online transaction processing (OLTP), data

warehousing, and business analytics. IT teams also need on-demand performance from these

databases to serve development, testing, analytics, and business-continuity needs.

13
SQL
SQL stands for Structured Query Language. It is designed for managing data in a relational
database management system (RDBMS). It is pronounced as S-Q-L or sometime See-
Qwell. SQL is a database language, it is used for database creation, deletion, fetching rows,
and modifying rows, etc. SQL can be used to share and manage data, particularly data that is
found in relational database management systems, which include data organized into tables.
Multiple files, each containing tables of data, also may be related together by a common field.
Using SQL, you can query, update, and reorganize data, as well as create and modify the
schema (structure) of a database system and control access to its data.

A lot of nformation can be compiled in a spreadsheet such as Microsoft Excel, but SQL is
intended to compile and manage data in much greater volumes. While spreadsheets can
become cumbersome with too much information, SQL databases can handle millions, or even
billions, of cells of data.

Common software used for SQL servers includes Oracle's MySQL, perhaps the most popular
program for managing SQL databases. MySQL is open-source software, which means it is
free to use and is important for web developers because so much of the web and so many
applications are built on databases.

SQL is widely popular because it offers the following advantages −


 Allows users to access data in the relational database management systems.
 Allows users to describe the data.
 Allows users to define the data in a database and manipulate that data.
 Allows to embed within other languages using SQL modules, libraries & pre-
compilers.
 Allows users to create and drop databases and tables.
 Allows users to create view, stored procedure, functions in a database.
 Allows users to set permissions on tables, procedures and views.

SQL Process
When you are executing an SQL command for any RDBMS, the system determines the best
way to carry out your request and SQL engine figures out how to interpret the task.
There are various components included in this process.
These components are −

 Query Dispatcher
 Optimization Engines
 Classic Query Engine
 SQL Query Engine, etc.
A classic query engine handles all the non-SQL queries, but a SQL query engine won't
handle logical files.
Following is a simple diagram showing the SQL Architecture −

14
SQL Commands
The standard SQL commands to interact with relational databases are CREATE, SELECT,
INSERT, UPDATE, DELETE and DROP. These commands can be classified into the
following groups based on their nature −

DDL - Data Definition Language

Sr.No. Command & Description

1 CREATE
Creates a new table, a view of a table, or other object in the database.

2 ALTER
Modifies an existing database object, such as a table.

3 DROP
Deletes an entire table, a view of a table or other objects in the database.

15
DML - Data Manipulation Language

Sr.No Command & Description


.

1 SELECT
Retrieves certain records from one or more tables.

2 INSERT
Creates a record.

3 UPDATE
Modifies records.

4 DELETE
Deletes records.

DCL - Data Control Language

Sr. Command & Description


No.

1 GRANT
Gives a privilege to user.

2 REVOKE
Takes back privileges granted from user.

16
PL\SQL
PL/SQL Developer is an Integrated Development Environment that is specifically targeted at
the development of stored program units for Oracle Databases. Over time we have seen more
and more business logic and application logic move into the Oracle Server, so that PL/SQL
programming has become a significant part of the total development process. PL/SQL
Developer focuses on ease of use, code quality and productivity, key advantages during
Oracle application development.

Powerful PL/SQL Editor


With its Syntax Highlighting, SQL and PL/SQL help, Object Descriptions, Code Assistant,
Compiler Hints, Refactoring, PL/SQL Beautifier, Code Contents, Code Hierarchy, Code
Folding, Hyperlink Navigation, Macro Library and many other sophisticated features, the
Unicode compliant editor will even appeal to the most demanding user.

Integrated Debugger
The integrated debugger offers all features you could wish for: Step In, Step Over, Step Out,
Run Until Exception, Breakpoints, View & Set Variables, View Call Stack, and so on. You
can debug any program unit without making any modification to it, including triggers and
object types.

PL/SQL Beautifier
The PL/SQL Beautifier allows you to format your SQL and PL/SQL code through a user-
defined set of rules. Your code can automatically be beautified when you compile, save, or
open a file. This feature will increase your coding productivity and will improve the
readability of your PL/SQL code if you are working in large project teams.

SQL Window
The SQL Window allows you to enter any SQL statement or multiple statements and view or
edit the results in a grid. The result grid supports a Query By Example mode to search
specific records in a result set. You can easily recall previously executed SQL statements
from a history buffer. The SQL editor provides the same powerful features as the PL/SQL
Editor.

Command Window
To develop and execute SQL scripts you can use PL/SQL Developer’s Command Window.
This window has the same look and feel as SQL*Plus, and additionally has a built-in script
editor with corresponding syntax highlighting. Now you can develop your scripts without the
“edit script / save it / switch to SQL*Plus / run script” cycle, and without leaving the
comfortable PL/SQL Developer IDE.

17
Regression Testing
For regression testing you can use PL/SQL Developer’s built-in Test Manager. You can
define and run a Test Set, and quickly determine if all tests run correctly. In case of an error,
the Test Manager can launch the Debugger to investigate the cause of the error. You can run
Test Sets from the Command Window for automated regression testing

To-Do Items
You can use To-Do Items in any SQL or PL/SQL source file to make a quick note that
something needs to be done in this source file. You can access this information later from the
To-Do List, either at the object level or at the project level.

Object Browser
This configurable tree-view displays all information that is relevant to PL/SQL development.
Use it to get object descriptions, to view object definitions, to create test scripts for the
debugger, to enable and disable triggers and constraints, to recompile invalid objects, to
query or edit tables or view data, to search for text in object sources, to drag and drop object
names into an editor, and so on.
The Object Browser additionally displays dependencies among objects, and lets you
recursively expand these dependant objects (e.g. package references view, view references
table, super/subtypes, and son on).

Architecture of PL/SQL

The Below PL/SQL Example is a pictorial representation of PL/SQL Architecture.

PL/SQL Architecture Diagram

The PL/SQL architecture mainly consists of following three components:

1. PL/SQL Block
2. PL/SQL Engine
3. Database Server

PL/SQL block:

 This is the component which has the actual PL/SQL code.


 This consists of different sections to divide the code logically (declarative section for
declaring purpose, execution section for processing statements, exception handling
section for handling errors)
 It also contains the SQL instruction that used to interact with the database server.
 All the PL/SQL units are treated as PL/SQL blocks, and this is the starting stage of
the architecture which serves as the primary input.
 Following are the different type of PL/SQL units.

18
o Anonymous Block
o Function
o Library
o Procedure
o Package Body
o Package Specification
o Trigger
o Type
o Type Body

Disadvantages of PL/SQL

1. Stored Procedures in PL/SQL uses high memory


2. Lacks functionality debugging in stored procedures
3. Any change in underlying database requires change in the presentation layer also
4. Does not completely separate roles of back-end developer and fron-end developer
5. Difficult to separate HTML development with PL/SQL development

PL/SQL Engine

 PL/SQL engine is the component where the actual processing of the codes takes
place.
 PL/SQL engine separates PL/SQL units and SQL part in the input (as shown in the
image below).
 The separated PL/SQL units will be handled by the PL/SQL engine itself.
 The SQL part will be sent to database server where the actual interaction with
database takes place.
 It can be installed in both database server and in the application server.

Database Server:

 This is the most important component of Pl/SQL unit which stores the data.
 The PL/SQL engine uses the SQL from PL/SQL units to interact with the database
server.
 It consists of SQL executor which parses the input SQL statements and execute the
same.

19
INTRODUCTION TO VB.NET

VB.NET stands for Visual Basic.NET, and it is a computer programming language


developed by Microsoft. It was first released in 2002 to replace Visual Basic 6. VB.NET is
an object-oriented programming language. ... The language was designed in such a way that it
is easy to understand to both novice and advanced programmers.

This means that it supports the features of object-oriented programming which include
encapsulation, polymorphism, abstraction, and inheritance.

Visual Basic .ASP NET runs on the .NET framework, which means that it has full access to
the .NET libraries. It is a very productive tool for rapid creation of a wide range of Web,
Windows, Office, and Mobile applications that have been built on the .NET framework.

The language was designed in such a way that it is easy to understand to both novice and
advanced programmers. Since VB.NET relies on the .NET framework, programs written in
the language run with much reliability and scalability. With VB.NET, you can create
applications that are fully object-oriented, similar to the ones created in other languages like
C++, Java, or C#. Programs written in VB.NET can also interoperate well with programs
written in Visual C++, Visual C#, and Visual J#. VB.NET treats everything as an object.

VB.NET Features

VB.NET comes loaded with numerous features that have made it a popular programming
language amongst programmers worldwide. These features include the following:

 VB.NET is not case sensitive like other languages such as C++ and Java.
 It is an object-oriented programming language. It treats everything as an object.
 Automatic code formatting, XML designer, improved object browser etc.
 Garbage collection is automated.
 Support for Boolean conditions for decision making.
 Simple multithreading, allowing your apps to deal with multiple tasks simultaneously.
 Simple generics.
 A standard library.
 Events management.
 References. You should reference an external object that is to be used in a VB.NET
application.
 Attributes, which are tags for providing additional information regarding elements
that have been defined within a program.
 Windows Forms- you can inherit your form from an already existing form.

Advantages of VB.NET

The following are the pros/benefits you will enjoy for coding in VB.NET:

 Your code will be formatted automatically.


 You will use object-oriented constructs to create an enterprise-class code.

20
 You can create web applications with modern features like performance counters,
event logs, and file system.
 You can create your web forms with much ease through the visual forms designer.
You will also enjoy drag and drop capability to replace any elements that you may
need.
 You can connect your applications to other applications created in languages that run
on the .NET framework.
 You will enjoy features like docking, automatic control anchoring, and in-place menu
editor all good for developing web applications.

Disadvantages of VB.NET

Below are some of the drawbacks/cons associated with VB.NET:

 VB.NET cannot handle pointers directly. This is a significant disadvantage since


pointers are much necessary for programming. Any additional coding will lead to
many CPU cycles, requiring more processing time. Your application will become
slow.
 VB.NET is easy to learn. This has led to a large talent pool. Hence, it may be
challenging to secure a job as a VB.NET programmer.

VB is the predecessor of VB.NET and was not an object-oriented language. ...


A VB.NET uses the Common Language Runtime (CLR) component of . Net Framework at
runtime. It has better features and design implementation as compared to VB-Runtime.

A VB.NET program consists of the following:


 Namespace declaration.
 One or more procedures.
 A class or module.
 Variables.
 The Main procedure.
 Comments.
 Statements & Expressions.

21
INTRODUCTION TO VISUAL STUDIO

Visual Basic is a third-generation event-driven programming language from Microsoft


known for its Component Object Model (COM) programming model first released in 1991
and declared legacy during 2008. Microsoft intended Visual Basic to be relatively easy to
learn and use.

In VB 6, you can create any program depending on your objective. For math teachers, you
can create mathematical programs such as Geometric Progression, Quadratic Equation
Solver, Simultaneous Equation Solver ,Prime Number Tester, Factors Finder, Quadratic
Function Graph Plotter and so on. For science teachers, you can create simulation programs
such as Projectile, Simple Harmonic Motion, Star War  etc. If you are in business, you can
also create business applications such as inventory management system , Amortization
Calculator , investments calculator, point-of-sale system, payroll system, accounting program
and more to help manage your business and increase productivity. For those of you who like
games , you can create programs such as slot machine, reversi, tic tac toe and more. Besides,
you can create multimedia programs such as Smart Audio Player, Multimedia Player  and
more. Indeed, there is no limit to what program you can create ! We offer many sample
codes in our tutorial.

Before you can write programs in VB 6, you need to install Visual Basic 6 compiler on your
computer. You can purchase a copy of Microsoft Visual Basic 6.0 Learning Edition  
or Microsoft Visual Basic Professional Edition  from Amazon.com, both are vb6
compilers. Besides, you can also buy it from eBay at Microsoft Visual Basic 6.0 6
Professional PRO MSDN Library Manual Service Pack. If you have already installed
Microsoft Office in your PC or laptop, you can also use the built-in Visual Basic Application
in Excel to start creating Visual Basic programs without having to spend extra cash to buy the
VB6 compiler.

You can also install VB6 on Windows 10 but you need to follow certain steps otherwise the
installation will fail. First, you need to run setup as administrator. Next, you need to use
custom installation. Clear the checkbox for Data Access. If you don't, set up will hang at the
end of the installation. Finally, click next and wait for the installation to complete. For
complete instructions, please follow this link Install VB6 on Windows 10

After installing the vb6 compiler, the icon will appear on your desktop or in your programs
menu. Click on the icon to launch the VB6 compiler. On start up, Visual Basic 6.0  will
display the following dialog box .

22
You can choose to either start a new project, open an existing project or select a list of
recently opened programs. A project is a collection of files that make up your application.
There are various types of applications that we could create, however, we shall concentrate
on creating Standard EXE programs (EXE means executable). Before you begin, you must
think of an application that preferably have commercial ,educational or recreational value.
Next, click on the Standard EXE icon to go into the actual Visual Basic 6 programming
environment.

When you start a new Visual Basic 6 Standard EXE project, you will be presented  with the
Visual Basic 6 Integrated Development Environment (IDE). The Visual Basic 6 Integrated
Programming Environment is shown in Figure 1.2. It consists of the toolbox, the form, the
project explorer and the properties window.

The Form is the primary building block of a Visual Basic 6 application. A Visual Basic 6
application can actually comprise many forms, but we shall focus on developing an
application with one form first. We will learn how to develop applications with multiple
forms later. Before you proceed to build the application, it is a good practice to save the
project first. You can save the project by selecting Save Project from the File menu, assign a
name to your project and save it in a certain folder.

23
FEATURES OF VISUAL STUDIO
 Code editor. Microsoft Visual Studio, like any other IDE, includes a code editor that
supports syntax highlighting and code completion using IntelliSense for variables, functions,
methods, loops, and LINQ queries. ...
 Debugger. ...
 Designer. ...
 Other tools. ...
 Extensibility. ...
 Previous products. ...
 Community. ...
 Professional.
Visual Studio IDE is a comprehensive development platform for cloud, web and multiple
operating systems. It provides users with a smooth interface that is easy to navigate, allowing
for faster and more accurate coding. Developers will have access to a range of debugging
tools which facilitates in diagnosing and profiling bugs. This would give programmers the
confidence of deploying their applications because they know that they’ve got a set of tools
which monitors any troubles that might cause performance errors. Furthermore, Visual Studio
IDE functions as a testing platform too. The IDE can be used to simulate how applications
will run in their selected environments. This is for ensuring that once the application is
deployed, it will run smoothly as tested.

Microsoft visual studio provides with Integrated Development Environment (IDE) to develop
windows form applications with ease. It consists of various tools and windows, which
provides the user friendly environment, and make development easy, fast and efficient.

Windows forms is a powerful and high performance functionality (or framework) offered by
the Microsoft Windows application development, based on .NET framework. This
framework provides a clear, object-oriented, extensible set of classes that enable you to
develop rich windows applications. Windows forms applications can take advantage of
controls, menus, mouse and keyboard events, and can talk directly to the underlying
operating system. These applications are easy to use and understand.

In Windows Forms namespace which are used to create windows forms applications. These
classes are collectively known as the Windows Forms classes There is a Form class provided
by this namespace, is used as a base class for all dialog boxes and top-level windows in
a .NET windows application. System.Windows.Forns namespace also includes classes that
manage controls, menus, toolbars, data, components, printing and reporting etc.

Microsoft .net was formerly (in earlier times) known as Next Generation Windows Services
(NGWS). This is a platform for developing the next generation of windows/web applications.
These applications would transcend device boundaries and fully harness the power of the
interest.

24
INTRODUCTION TO ADO.NET

It is a module of .Net Framework which is used to establish connection between application


and data sources. Data sources can be such as SQL Server and XML. ADO.NET consists of
classes that can be used to connect, retrieve, insert and delete data.

All the ADO.NET classes are located into System.Data.dll and integrated with XML classes
located into System.Xml.dll.

ADO.NET has two main components that are used for accessing and manipulating data are
the .NET Framework data provider and the DataSet.

The DataSet Class


The dataset represents a subset of the database. It does not have a continuous connection to
the database. To update the database a reconnection is required. The DataSet contains
DataTable objects and DataRelation objects. The DataRelation objects represent the
relationship between two tables.
Following table shows some important properties of the DataSet class:

Properties Description

CaseSensitive Indicates whether string comparisons within the data tables are case-
sensitive.

Container Gets the container for the component.

DataSetName Gets or sets the name of the current data set.

DefaultViewManager Returns a view of data in the data set.

DesignMode Indicates whether the component is currently in design mode.

EnforceConstraints Indicates whether constraint rules are followed when attempting any
update operation.

Events Gets the list of event handlers that are attached to this component.

25
ExtendedProperties Gets the collection of customized user information associated with the
DataSet.

HasErrors Indicates if there are any errors.

IsInitialized Indicates whether the DataSet is initialized.

Locale Gets or sets the locale information used to compare strings within the
table.

Namespace Gets or sets the namespace of the DataSet.

Prefix Gets or sets an XML prefix that aliases the namespace of the DataSet.

Relations Returns the collection of DataRelation objects.

Tables Returns the collection of DataTable objects.

The DataAdapter Object


The DataAdapter object acts as a mediator between the DataSet object and the database.
This helps the Dataset to contain data from multiple databases or other data source.

The DataReader Object


The DataReader object is an alternative to the DataSet and DataAdapter combination. This
object provides a connection oriented access to the data records in the database. These
objects are suitable for read-only access, such as populating a list and then breaking the
connection.

DbCommand and DbConnection Objects


The DbConnection object represents a connection to the data source. The connection could
be shared among different command objects.
The DbCommand object represents the command or a stored procedure sent to the database
from retrieving or manipulating data.

26
ADO.NET provides a bridge between the front end controls and the back end database. The
ADO.NET objects encapsulate all the data access operations and the controls interact with
these objects to display data, thus hiding the details of movement of data.
The following figure shows the ADO.NET objects at a glance:

27
INTRODUCTION TO MS-ACCESS
Microsoft Access is a type of database software that is used to store information for reporting,
referencing and analysis. With Microsoft Access, you can analyze large amounts of data
faster and more efficiently than with Excel or other types of spreadsheets.
If you’ve been considering a database application for your business, or you’re finding that
traditional spreadsheets just aren’t cutting it anymore, Microsoft Access may be just what
you’re looking for.
Let’s explore some of the basic functions of Access and how they can help your business be
more productive.

Microsoft Access (MS Access) enables one to manage all important information from a
single database file. Within the file, one can use:

• Tables to store your data.

• Queries to find and retrieve specific data of interest.

• Forms to view, add, and update data in tables.

• Reports to analyze or print data in a specific layout.

• Data access pages to view or update, the data.

In MS Access, data is stored once in one table, but can be viewed from multiple locations.
When the data is updated in a Table, Query or Form, it is automatically updated everywhere
it appears

Establishment of Ms Access database

All Ms Access databases files are saved with extension .mdb

A database should have a separate table for every major subject, such as pedigree records,
Production data or Treatment information. Data should not be duplicated in multiple tables.
Microsoft Access provides three methods to create a database „ Database Wizard (though
easy, the wizard offers limited options to customize the database)

„ Using a template (This method works best if one can find and use a template that closely
matches the specific requirements) „. Creating a database directly (This is the most flexible
method, but it requires one to define each database element separately).

Access is most popular for its tables, forms and queries. The database tables are similar to
spreadsheets, so you shouldn’t have much trouble using the basic functions of the program.
However, it does take time to learn the full features.
When setting up a database, you may list the subject matter of each column, just as you
would with a spreadsheet, and add as many columns as you’d like. When this is completed,
each row leaves room for more data input.
One feature that users really like is that they don’t need to finalize the tables manually. Also,
Access has a query function that allows information to be combined from more than one

28
table, and you can even specify the conditions. This saves a lot of time because you don’t
have to look through rows and rows of information.
If you’re already using a spreadsheet application like Excel, you’re familiar with the benefits
of organizing your data. But let’s look further into some of the specific tasks that you can
perform with Access.
 Maintain all information for each client or customer, including addresses, invoices, payment
and order information.
 Track financial data without needing a separate software program. If you have the full
Microsoft Office Suite, you may even set payment reminders.
 Manage marketing and sales thanks to having all customer information in the database. Send
out flyers, emails and coupons and track how customers respond.
 Track production and inventory by entering data on shipments and also knowing when it’s
time to order more of a particular product.

Advantages of MS Access

Now in this MS Access Tutorial, we will learn the pros/benefits for using MS Access
application:

 Access offers a fully functional, relational database management system in minutes.


 Easy to import data from multiple sources into Access
 You can easily customize Access according to personal and company needs
 Microsoft Access online works well with many of the development languages that
work on Windows OS
 It is robust and flexible, and it can perform any challenging office or industrial
database tasks.
 MS-Access allows you to link to data in its existing location and use it for viewing,
updating, querying, and reporting.
 Allows you to create tables, queries, forms, and reports, and connect with the help of
Macros
 Macros in Access is a simple programming construct with which you can use to add
functionality to your database.
 Microsoft Access online can perform heterogeneous joins between various data sets
stored across different platforms

Disadvantages of MS Access

Here, are the cons for using MS Access

 Microsoft Access database is useful for small-to-medium business sectors. However,


it is not useful for large-sized organizations
 Lacks robustness compared to dbms systems like MS SQL Server or Oracle
 All the information from your database is saved into one file. This can slow down
reports, queries, and forms

29
HARDWARE AND SOFTWARE REQUIREMENTS

Hardware and Software Requirements


This topic gives the requirements for reUZE Developer.

Hardware Requirements
The following minimum configuration is required:
 Processor: Must be at least the minimum specified for the operating system you are
using and for Visual Studio.
 Memory: Must be at least the minimum specified for the operating system you are
using.
 Disk space:
 1.2Gb for reUZE Developer
 600Mb for reUZE Server.
This disk size includes the space needed to cache information locally so that you can
modify the installation without the original source media.
 DVD drive (either locally or via a network).
 Screen with resolution of 800x600 with 256 colors minimum. Preferred screen
resolution 1024 x 768 or higher.
 reUZE Developer has additional hardware requirements the same as for Microsoft
Visual Studio. See the Visual Studio documentation for details.

Software Requirements
The following software is required:
 On 32-bit Windows, one of:
 Windows Vista
 Windows Server 2008
 Windows Server 2003 R2, Windows Server 2003
 Windows XP Professional SP2 or later
 On 64-bit Windows for X64, one of:
 Windows Vista
 Windows Server 2008
 Windows Server 2003
 Windows XP Professional
 Microsoft Visual Studio 2008 Service Pack 1 or Microsoft Visual Studio Shell 2008.
Note that Microsoft Visual Studio Express Edition is not supported.

30
 Microsoft Windows SDK is required if you are using Visual Studio Shell 2008. See
the Microsoft Download site and search for Windows SDK.
 Microsoft .NET Framework 3.5. This is included with the above versions of Visual
Studio.
 The Java Development Kit (JDK) is required for compiling Java. The JDK is
downloadable from the Sun Web site. After installing the JDK, you must put
the tools.jar file for the JDK on your classpath, using a command similar to:
set classpath=jdk-install-directory\lib\tools.jar
 A Web browser, such as Microsoft Internet Explorer 6.0 or Netscape Navigator 6.1.,
is required for Enterprise Server Administration in reUZE Server.
 To use Enterprise Server Administration, scripting or JavaScript support must be
enabled in your browser. This is on by default in Internet Explorer in most Windows
operating systems, apart from Windows 2003. Also, active content must be allowed
and not blocked. To enable both these in Internet Explorer:
1. Click Tools > Internet Options.
2. On the Security tab, click Custom Level. In the Scripting section,
under Active Scripting, click Enable.
3. On the Advanced tab, scroll down the list to the Security section, and ensure
the item Allow active content to run in files on My Computer is checked.
 Enterprise Server Help requires the Sun Java Run-time Environment on some
Windows systems to enable the Search facility to work. See Third Party Software
 Disk space: 516Mb for a minimum installation of the Net Express IDE only.
 Microsoft Visual Studio 2008 is required for using the Interface Mapping Toolkit to
generate Windows Forms and Web Forms test clients for service interfaces.
 Microsoft Internet Information Service (IIS) is also required for generating Windows
Forms test clients.
 The Microsoft .NET Framework 2.0 or later is required for the CTF Viewer. It is
available from the Microsoft .NET downloads area.
 Required browsers:
1. Microsoft Internet Explorer 6.0 SP1 or later is required to enable Form
Designer to run.
2. You need a Web browser for testing your Web applications:
 If you use Netscape Navigator, you need version 3 or later.
 If you use Netscape Navigator 6, only v6.2 is supported.
 If you use Microsoft Internet Explorer, V5.0 is adequate.

31
INTRODUCTION TO PROJECT
In Visual Basic, a project is the group of all the files that make up your program. These
might include forms, modules (blocks of code not attached to a form), graphics, and ActiveX
controls.

The project is about student information . In this we’ll gonna see how to make pages where
students can enter their respective information with particular norms. Also, how to link
different pages for proper information is also included in this.

Firstly we are coming with our loginid form where student must enter his\her active id and
password.Here we have used progress bar toolbar which means that next form is loading.

After this, if id and password would be correct, only then it will open next page which is the
MDI form, otherwise a message will pop up as you must have entered invalid id or
password.Then in MDI form, we are coming up with some of options for students as per their
choice i.e registration form, text editor, calculator, so that can have the access these choices
as per their need.

It includes the proper coding behind every action that we’ll gonna perform. For registration
form, we have connected a database from ms-access by using oledb connection.

Initially, we have made a random database in ms-access then in visual studio, select data
source option and then add new data source. This is how we made the connection and after
the connection, whatever the entries we’ll add that will display in the database table that we
have created initially.

Other than this, we are also having the options of delete, reset, add, etc i.e if you feel like you
want to delete any entry then can do that. Here we have used buttons for performing the
particular action. When user will enter his\her information that will go to their respective
textboxes. Also resetting and adding new entries option is also there to add or change the
existed data in the database.

Data grid view option is to view the changes that we are making into the table without
opening the database in access. It will display the whole database table on the screen.

Text editor is to add font color,size, name etc. to the text that we have entered. Here we are
having the option of background color, cut, copy, paste, delete etc. You can perform
accordingly. And after making your document, you may also save\save as your document.
The options mentioned above are also available with their respective shortcut keys. For this,
we have used menuscript toolbar. In this project, we have used different toolbars for different
operations for ex. Buttons, textboxes, labels, menuscript, progress bar etc.

For calculator, we have done coding behind every operation i.e for addition, subtraction,
multiplication, division etc.so that when operation is applied on operands, it must give the
desired output.

32
OBJECTIVES
The primary aim of this project is to build a quiz application to help increase the knowledge
of the students and also to aid students to be fully prepared for upcoming exams, which will
aid in achieving the following objectives;

1. This application will provide a registration form as well as a login form for the users.
2. It will enable users to take quiz on different courses at any time they so desire.
3. To enable the administrator to upload and manage questions to be answered by the
user.
4. This application will provide the score of each course after a successful completion of
a quiz section by the user.
5. It should be able to replace an existing paper work sustem and any correction
manually.

So the are some basic objectives of this project and this is going to be really helpful and
knowledgable for the students. They are going to learn many new things.

33
SPLASH SCREEN

34
LOGIN FORM

35
MDI FORM

36
CALCULATOR

37
TEXT EDITOR

38
39
REGISTRATION FORM

40
41
42
43
CODING FOR SPLASH SCREEN

Public Class Form1

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


System.EventArgs) Handles Button1.Click
timer1.enabled = True

End Sub

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


System.EventArgs)

End Sub

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


System.EventArgs) Handles ProgressBar1.Click

End Sub

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


System.EventArgs) Handles Timer1.Tick
ProgressBar1.Increment(1)
If ProgressBar1.Value = 100 Then
Timer1.Stop()

Me.Hide()
Form8.Show()

End If
End Sub

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


System.EventArgs) Handles Label1.Click

End Sub
End Class

44
CODING FOR LOGIN FORM

Public Class Form8

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


System.EventArgs) Handles Button1.Click
Dim uname As String = TextBox1.Text
Dim passwrd As String = TextBox2.Text
If (uname.Equals("srish") And passwrd.Equals("1234")) Then
MessageBox.Show("User Authenticated!")

Form3.Show()
Me.Hide()

Else
MessageBox.Show("Invalid username or password!!")
End If
End Sub

Private Sub Form8_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

End Sub

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


System.EventArgs) Handles Label1.Click

End Sub
End Class

45
CODING FOR MDI FORM
Public Class Form3

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


Form4.Show()

End Sub

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


Form5.Show()

End Sub

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


System.EventArgs)
Form6.Show()

End Sub

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


System.EventArgs)
Me.Close()

End Sub

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


System.EventArgs) Handles Button5.Click
Form4.Show()

End Sub

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


System.EventArgs) Handles Button6.Click
Form5.Show()

End Sub

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


System.EventArgs) Handles Button7.Click
Form6.Show()

End Sub

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


System.EventArgs) Handles Button8.Click
Me.Close()

End Sub
End Class

46
CODING FOR CALCULATOR
Public Class Form5
Dim Firstnum As Decimal
Dim Secondnum As Decimal
Dim Operations As Integer
Dim Operator_Selector As Boolean = False

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


System.EventArgs) Handles Button8.Click
Firstnum = TextBox1.Text
TextBox1.Text = "0"
Operator_Selector = True
Operations = 2 '=-

End Sub

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


System.EventArgs) Handles Button17.Click
If Operator_Selector = True Then
Secondnum = TextBox1.Text
If Operations = 1 Then
TextBox1.Text = Firstnum + Secondnum
ElseIf Operations = 2 Then
TextBox1.Text = Firstnum - Secondnum
ElseIf Operations = 3 Then
TextBox1.Text = Firstnum * Secondnum
Else
If Secondnum = 0 Then
TextBox1.Text = "Error"
Else
TextBox1.Text = Firstnum / Secondnum

End If
End If

Operator_Selector = False
End If

End Sub

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


System.EventArgs) Handles Button6.Click
If TextBox1.Text <> "0" Then
TextBox1.Text += "5"
Else
TextBox1.Text = "5"
End If

47
End Sub

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


System.EventArgs) Handles Button5.Click
4: If TextBox1.Text <> "0" Then
TextBox1.Text += "4"
Else
TextBox1.Text = "4"
End If

End Sub

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


System.EventArgs) Handles Button4.Click
Firstnum = TextBox1.Text
TextBox1.Text = "0"
Operator_Selector = True
Operations = 1 '=+

End Sub

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


System.EventArgs) Handles Button1.Click
If TextBox1.Text <> "0" Then
TextBox1.Text += "1"
Else
TextBox1.Text = "1"
End If

End Sub

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


System.EventArgs) Handles Button2.Click
If TextBox1.Text <> "0" Then
TextBox1.Text += "2"
Else
TextBox1.Text = "2"
End If

End Sub

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


System.EventArgs) Handles Button3.Click
If TextBox1.Text <> "0" Then
TextBox1.Text += "3"
Else
TextBox1.Text = "3"
End If

End Sub

48
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button7.Click
If TextBox1.Text <> "0" Then
TextBox1.Text += "6"
Else
TextBox1.Text = "6"
End If

End Sub

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


System.EventArgs) Handles Button9.Click
If TextBox1.Text <> "0" Then
TextBox1.Text += "7"
Else
TextBox1.Text = "7"
End If

End Sub

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


System.EventArgs) Handles Button10.Click
If TextBox1.Text <> "0" Then
TextBox1.Text += "8"
Else
TextBox1.Text = "8"
End If

End Sub

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


System.EventArgs) Handles Button11.Click
If TextBox1.Text <> "0" Then
TextBox1.Text += "9"
Else
TextBox1.Text = "9"
End If

End Sub

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


System.EventArgs) Handles Button13.Click
If TextBox1.Text <> "0" Then
TextBox1.Text += "0"

End If

End Sub

49
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button14.Click
TextBox1.Text = "0"
End Sub

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


System.EventArgs) Handles Button15.Click
If Not (TextBox1.Text.Contains(".")) Then
TextBox1.Text += "."
End If

End Sub

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


System.EventArgs) Handles Button12.Click
Firstnum = TextBox1.Text
TextBox1.Text = "0"
Operator_Selector = True
Operations = 3 '=*

End Sub

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


System.EventArgs) Handles Button16.Click
Firstnum = TextBox1.Text
TextBox1.Text = "0"
Operator_Selector = True
Operations = 4 '=/

End Sub

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


System.EventArgs)
Me.Close()
Form3.Show()

50
CODING FOR TEXT EDITOR

Public Class Form4

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


System.EventArgs) Handles NewToolStripMenuItem.Click
RichTextBox1.Clear()
End Sub

Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal


e As System.EventArgs)

End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal


e As System.EventArgs)

End Sub

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


System.EventArgs) Handles OpenToolStripMenuItem.Click
Try
Dim dlg As OpenFileDialog = New OpenFileDialog
dlg.Title = "open"
dlg.Filter = "rich text file(*.txt)|*.txt|all files(*.*)|*.*"
If dlg.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.LoadFile(dlg.FileName)
End If
Catch ex As Exception

End Try
End Sub

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


System.EventArgs) Handles SaveToolStripMenuItem.Click
Try
Dim dlg As SaveFileDialog = New SaveFileDialog
dlg.Title = "save"
'dlg.checkfileexists=true
'dlg.checkpathexists=true
dlg.DefaultExt = "txt"
dlg.Filter = "rich text file(*.txt)|*.txt|all files(*.*)|*.*"
If dlg.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.SaveFile(dlg.FileName, RichTextBoxStreamType.RichText)
End If
Catch ex As Exception
'Call saveastoolstriomenuitem_clicl(Me, e)
End Try
End Sub

51
Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles SaveAsToolStripMenuItem.Click
Try
Dim dlg As SaveFileDialog = New SaveFileDialog
dlg.Title = "Save"
dlg.CheckFileExists = False
dlg.CheckPathExists = False
dlg.DefaultExt = "txt"
dlg.Filter = "Rich Text File(*.txt)|*.txt|All files(*.*)|*.*"
If dlg.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.SaveFile(dlg.FileName, RichTextBoxStreamType.RichText)

End If

Catch ex As Exception

End Try

End Sub

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


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

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


System.EventArgs) Handles UndoToolStripMenuItem.Click
RichTextBox1.Undo()
End Sub

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


System.EventArgs) Handles RedoToolStripMenuItem.Click
RichTextBox1.Redo()
End Sub

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


System.EventArgs) Handles CopyToolStripMenuItem.Click
RichTextBox1.Copy()
End Sub

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


System.EventArgs) Handles PasteToolStripMenuItem.Click
RichTextBox1.Paste()
End Sub

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


System.EventArgs) Handles CutToolStripMenuItem.Click
RichTextBox1.Cut()

52
End Sub

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


System.EventArgs) Handles DeleteToolStripMenuItem.Click
If RichTextBox1.SelectionLength > 0 Then
RichTextBox1.Text = ""
End If
End Sub

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


System.EventArgs) Handles FontToolStripMenuItem.Click
Try
Dim dlg As FontDialog = New FontDialog
dlg.Font = RichTextBox1.Font
If dlg.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.Font = dlg.Font

End If
Catch ex As Exception

End Try

End Sub

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


As System.EventArgs) Handles SelectAllToolStripMenuItem.Click
RichTextBox1.SelectAll()
End Sub

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


System.EventArgs)
Form3.Show()
Me.Close()

End Sub

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


System.EventArgs) Handles RichTextBox1.TextChanged

End Sub

Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

End Sub

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


System.EventArgs) Handles FileToolStripMenuItem.Click

53
End Sub

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


System.EventArgs) Handles ColorsToolStripMenuItem.Click

ColorDialog1.ShowDialog()
RichTextBox1.ForeColor = ColorDialog1.Color

End Sub

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


System.EventArgs) Handles EditToolStripMenuItem.Click

End Sub
End Class

54
CODING FOR DATA GRID VIEW
Imports System.Data.OleDb
Imports System.Data
Public Class Form7
Public cn As OleDbConnection = New
OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\srishti\
desktop\database project by srishti\Database2.accdb")
Private Sub Form7_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
DataGridView1.DataSource = ""
Dim adapter As New OleDbDataAdapter("select * from table1", cn)
Dim datatable As New DataTable
adapter.Fill(datatable)
DataGridView1.DataSource = datatable
'TODO: This line of code loads data into the 'Database2DataSet1.Table1' table. You can
move, or remove it, as needed.
Me.Table1TableAdapter.Fill(Me.Database2DataSet1.Table1)

End Sub

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


As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.CellContentClick

End Sub

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


System.EventArgs)
Me.Close()

End Sub
End Class

55
CODING FOR REGISTRATION FORM
Imports System.Data.OleDb
Imports System.Data
Public Class Form6
' Dim cn As OleDbConnection
Public da As OleDbDataAdapter
Public ds As New DataSet
Public dr As OleDbDataReader
Public cmd As OleDbCommand
Public cn As OleDbConnection = New
OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Srishti\
Desktop\database project by srishti\database2.accdb")

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


System.EventArgs) Handles Label5.Click

End Sub

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


System.EventArgs) Handles Label6.Click

End Sub

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


System.EventArgs) Handles TextBox1.TextChanged

End Sub

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


System.EventArgs) Handles TextBox6.TextChanged

End Sub

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


System.EventArgs) Handles Button5.Click
TextBox6.Text = String.Empty
TextBox1.Text = String.Empty
TextBox4.Text = String.Empty
TextBox2.Text = String.Empty
TextBox3.Text = String.Empty
TextBox5.Text = String.Empty
MsgBox("DATA RESETED")

End Sub

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


System.EventArgs) Handles Label7.Click

56
End Sub

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


System.EventArgs) Handles Button1.Click
cn.Open()
cmd = New OleDbCommand("select * from table1 where id='" & TextBox1.Text & "'",
cn)
dr = cmd.ExecuteReader
If dr.HasRows Then
While (dr.Read())
TextBox2.Text = dr("name")
TextBox3.Text = dr("rollno")
TextBox4.Text = dr("email")
TextBox5.Text = dr("mobileno")
TextBox6.Text = dr("address")

End While
End If
cn.Close()

End Sub

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


System.EventArgs) Handles Button3.Click
'Dim ConnectionStr As String
'ConnectionStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\
Srishti\Desktop\database project by srishti\Database2.accdb"
'Dim cn As New OleDbConnection(ConnectionStr)
'Dim cmd As New OleDbCommand()
If TextBox1.Text <> "" And TextBox2.Text <> "" And TextBox3.Text <> "" And
TextBox4.Text <> "" And TextBox5.Text <> "" And TextBox6.Text <> "" Then
cn.Open()
MsgBox("Connected to Database")
cmd = New OleDbCommand("insert into table1 values('" & TextBox1.Text & "','" &
TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text &
"','" & TextBox6.Text & "')", cn)
cmd.ExecuteNonQuery()
cn.Close()
MsgBox("data inserted")
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
End If
cn.Close()

57
End Sub

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


System.EventArgs) Handles Button2.Click
If TextBox1.Text <> "" Then
cn.Open()
cmd = New OleDbCommand("update table1 set name ='" & TextBox2.Text & "',
rollno ='" & TextBox3.Text & "', email ='" & TextBox4.Text & "', mobileno ='" &
TextBox5.Text & "', address='" & TextBox6.Text & "' where id ='" & TextBox1.Text & "'",
cn)
cmd.ExecuteNonQuery()
MsgBox("data updated")
End If
cn.Close()

End Sub

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


System.EventArgs) Handles Button4.Click
If TextBox1.Text <> "" Then
cn.Open()
cmd = New OleDbCommand("delete from table1 where id='" & TextBox1.Text & "'",
cn)
cmd.ExecuteNonQuery()

MsgBox("data deleted")
TextBox1.Text = ""
End If
cn.Close()

End Sub

Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
'TODO: This line of code loads data into the 'Database2DataSet.Table1' table. You can
move, or remove it, as needed.

End Sub

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


System.EventArgs) Handles TextBox4.TextChanged

End Sub

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


System.EventArgs) Handles Button6.Click
Form7.Show()

58
Me.Hide()

End Sub

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


System.EventArgs)
Me.Close()

End Sub

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


System.EventArgs) Handles Label1.Click

End Sub
End Class

59

You might also like