Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
46Activity
0 of .
Results for:
No results containing your search query
P. 1
VB SQL Tutorial

VB SQL Tutorial

Ratings:

4.0

(1)
|Views: 4,922 |Likes:
Published by osanosh
This is not my work, i copied it from VBMySQL.com for personal use but i realized that it would also benefit other people trying to learn about VB .Net programming so i thought i may share it. Thank you Mike of VBMySQL.com for a very wonderful tutorial!
This is not my work, i copied it from VBMySQL.com for personal use but i realized that it would also benefit other people trying to learn about VB .Net programming so i thought i may share it. Thank you Mike of VBMySQL.com for a very wonderful tutorial!

More info:

Published by: osanosh on May 02, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/13/2013

pdf

text

original

 
The VB.NET-MySQL Tutorial - Part 1
Introduction
While the articles atvbmysql.comhave been well received, there is always something new to cover. Everyweek I get requests for new sample code and articles explaining some new aspect of using Visual Basic andMySQL. One of the recurring requests has been for a full tutorial covering the creation of an application, fromdesign to deployment, using Visual Basic and MySQL. In response to these requests I have written this articleas the first of a series of articles that will provide a full tutorial for the creation of an application using VisualBasic.NET and MySQL. I will cover application design, database design, VB.NET database programming, anddeployment of the finished application.This tutorial will be very hands-on, documenting the creation of a real application that will then be availablefor download in both source and binary form for future reference. Intermediate files will be available aftereach tutorial section that can be used to familiarize yourself with the project as it progresses.In this first installment of the series I will be covering the design of our application’s database. A well-designeddatabase can be critical to the success of your database project, allowing for increased expandability andscalability, not to mention it makes for easier development. In this tutorial I will describe the steps needed tobegin your application design, then move on to the design of your database, finishing up with the writing of your table creation statements.
Choosing an Application
The very first thing required when creating an application is a need. Computer programs are created to fulfillneeds that the application users have. In my office we have many staff members, each of whom may or maynot be in the office at any given time. We currently make use of a simple application that tracks whichemployees are in the office and displays a short message for those who are out of the office indicating whenthey will return.This type of in/out tracking software is fairly common, but this type of application often comes with twolimitations; many of these applications are limited to only a certain number of users, usually in the area of 50-100. In addition, these applications often use flat files to store information; requiring that each user haveaccess to a shared network directory in order to use the system. Both of these limitations can be overcome byusing an SQL (pronounced “ess-que-ell”, not “sequel”) database. If the application we use at the office had itssource code available, modifying it would have been an option (freedom to modify an application to suit yourneeds is one of the great benefits of using Open Source software and tools). Since the application in questionis a relatively simple one, I have chosen to rewrite it using Visual Basic and MySQL.The idea for your application may come from a desire to “build a better mousetrap” - developing a betterversion of an existing application. On the other hand you may have a need for an application but cannot find asuitable existing project. Finally, the idea or need may be that of someone else; either a client or youremployer. In any case, the first step when developing an application is deciding which application to develop.
Listing Requirements and Features
Once you have determined what application you will be developing, it is important to then decide whatspecifically the application will do. You will want to define its basic functionality, along with certain features
 
that the software will implement. If you are developing this software for yourself, this stage in thedevelopment process can be fairly informal, but it is nevertheless very important. If you are developingsoftware for a client or an employer then creating a list of features and requirements is vital. The list willdetermine what your responsibilities are as a software developer and will give a clear definition of what isrequired for your project to be considered complete. It should also be remembered that clients and employershave a tendency to request additional features as the project progresses while not wanting to pay anyadditional funds to implement them. If you have a list of features in hand you can inform your customer thatyour job is to implement the listed features and that any additional features will carry an additional cost.In addition to listing features and requirements, you will also want to develop a timeline and a budget. Youwould want to schedule significant milestones such as project completion and major phases of work beingdone. For example, you may wish to schedule a milestone to signify the delivery of application and databasedesigns to the customer. You may also want a milestone for delivery of a working demonstration of theproject. Often these milestones coincide with payments from the client when you work as a consultant, withthe payments being defined in your budget.
The Development Triangle
On the subject of money and features and timelines, it is important to understand the balance that must existbetween the three. Your client will undoubtedly want you to deliver as many features as possible within asmall budget and a short time period. It will be important for you to realize that you may sometimes need toreject a requested feature or timeline in order to keep everything in balance. Imagine that time, features, andmoney are three corners of a triangle:While you can stretch the corners of this triangle, you cannot change the area it occupies, as the area of thetriangle represents your total resources. The impact of this is that every section can only increase at theexpense of the other two: If you want a project to have more features you will have to either take more timeor spend more money for additional tools or developers. If you want a project to cost less money, you eitherneed to decrease the number of features or allow the project to take more time (this is because either you cutback on the number of developers or allow them to only work on the project in their spare time). Finally, if you
 
want the project done faster you either have to decrease the number of features or spend more money formore tools and/or developers (or at least pay overtime for your existing developers).When negotiating a feature list and timeline with your client or employer be sure to keep the triangle in mind,and even show it to your customer so they can understand the relationship between features, money, andtime. If you are developing the project for your own use you benefit from having the perfect client, but stillkeep in mind that there is only so much you can do with your limited time.let’s take a look at the feature and requirements list for our in/out tracking software:
 
Login should require a username and password
 
User should be prompted for a status message when logged in
 
User can choose between no status message, a pre-set status message, or specify their own messagewhen logging in or out
 
Last two user-defined status messages should be available in a list along with pre-defined ones
 
User should be able to login from any PC with an Internet connection, with an encrypted connectionavailable
 
User should be able to flag a fellow user and be notified when they check in
 
Users should be divided into separate groups (Sales, Accounting, Programming, etc.)
 
Main screen should show a list of all staff (or selected groups) with name, in/out status, statusmessage, and custom fields
 
Application should minimize to system tray
 
User should be able to customize appearance, window size, font size, date format, name format, colors
 
Standard users can change their status, display format, and send other users messages
 
Receptionist users can change group users’ status (receptionists can be assigned to multiple groups)
 
Managers can add/delete users within their groups, change their status (for their groups), and assignreceptionists
 
Administrators can create users, assign managers and administrators, and change group memberships.They have no restrictions
 
Users should be able to choose between having the application start minimized or maximized
 
Users should be able to choose refresh interval for open windowYour features and requirements list should be as detailed as needed for you and your client, and morecomplex applications should have more detailed documentation. Once your list of features, your budget, andyour timeline is approved you can then move on to designing your application.
Entity Design
One good approach to application design is to look at the different entities that will be involved in theapplication. An entity is simply an object we want to store information about. Designing an application basedon its component entities is a basic principle of object oriented programming. In our application the mainentity is our users. There are four different kinds of user: Regular User, Receptionist, Manager, andAdministrator. There are two approaches we can take we can take to represent our different types of user.We could describe four different entities, one for each type of user, or we could just have one user entity withan attribute that defines its type.When different entities have a common base but still have major differences it can be beneficial to think of abase entity that isinheritedby the other entities. let’s take vehicles as an example. While all vehicles have a

Activity (46)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Sandro Alvarez liked this
Rizel Caraballos liked this
Dax Lee liked this
flashboy_didi liked this
zaxmajesty liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->