Widgets Inc
Widgets is an MDI (Multiple Document Interface) database
project series based on a fictional company which keeps inventory of and sells
products. The main goal of this project is to show the concepts of working with
databases in code and get away from the bounds of the Visual Studio designer.
After going through this project you will have a better understanding of working
with databases and how the designer generated code works behind the scenes.
Additional coding concepts will be focused on for handling code efficiently and
cleanly to keep code organized, less cluttered and more generic to reduce code
duplication.
This project will also show how to work with the idea of
parent/child relationships in your code rather than relations setup in the
designer such as with a strongly typed dataset. A SQLCE (SQL Server
Compact Edition) 3.5 database will be used since this will be a local
application where the database and the application will both reside on and be
accessed only by the local workstation. SQLCE does not support Stored
procedures so this project will be using Dynamic T-SQL to issue commands to the
database. You can read more about Dynamic T-SQL and Stored Procedures in
our articles and in the project series details.
How to handle relationships between tables and perform multiple
commands one after another on multiple tables and database Normalization will
also be covered in the series which is the designing of relational database
tables to minimize duplication of data and keep consistency and integrity.
This helps make coding more efficient as well. There will be focus on
passing data more efficiently through the use of classes and function /
subroutine parameters rather than variables which will help reduce code clutter
and centralize generic code handling to perform different commands throughout
the application from one subroutine or function.
Search forms and data reporting using code will be implemented.
Input validation and error handling will be discussed and implemented such as
when to use Try Catch blocks, when they are not necessary, why they are not
needed and how to write code to prevent errors by "catching" them before they
happen. Using global objects both in the form classes and throughout the
application and how to re-use them will also be covered.
This project is not to show the best or the only way to write
database applications. It will show how you can take what you learn and
apply it in new ways to meet your needs and preferences. There is much
debate over the best way to write code. You need to make the code work for
you. This project will show you some of the methods that are used
professionally and will help you prepare to work for a company developing
software.
Project
Progression
The Widgets Inc project will start with a very simple design
focused on working in small sections. The design and code will
progressively be changed through a series of projects adding simple steps to
increase the functionality of the application.
In the beginning of the project progression, code will be used in
a design that might be considered bad design having all code inside of the form
class or GUI (Graphical User Interface) layer. Progressively code will be
moved into classes, functions and subroutines to help you understand how you can
create and use centralized code.
Projects in the series will be added periodically as they are
completed. If you chose to receive email updates during your registration,
emails will be sent out when each series project is released. If you chose
to not receive email updates and would like to change your account to add email
notifications you can do so at the bottom of the page.
Requirements:
Visual Studio 2008
Visual Basic 2008 Express Edition
or Higher
* 2005 Users
The files in each project can be added to a 2005 project using
the Project Menu - Add Exisitng Item. Be sure to remove Form1 which is
created automatically with a new project and set MdiParent1 as the startup form
in the Project Properties - Application tab.
DotNet Framework 2.0
SQL Server Compact Edition 3.5
Getting Started
Details explaining each step in the series design and
code can be viewed by selecting details under each project. Each will explain
the details for those changes and additional functionality specific to that
particular part of the project. Code will be commented in the projects as
well. Go through each project in order to understand the progression of the
entire application. The first project will explain in detail how to create the
database in the Visual Studio designer and how the MDI applicaiton is setup.
The database will only consist of the tables and columns needed for each part of
the series making the project very easy to follow and reproduce on your own.
Try our
Database Code
Generator

|
|  |  | Widgets1 |
|
|
|  |  | Widgets2 |
|
|
|  |  | Widgets3 |
|
|
|  |  | Widgets4 |
|
|
|  |  | Widgets5 |
|
|
|  |  | Widgets6 |
|
|
|  |  | Widgets7 |
|
|
|  |  | Widgets8 |
|
|