8
ACCESSING DATA WITHIN YOUR APPLICATION Advanced Visual Basic

Accessing data within VB Applications

Embed Size (px)

DESCRIPTION

This presentation explains the very basics of database interaction. This does not give code on how to do so.

Citation preview

Page 1: Accessing data within VB Applications

ACCESSING DATA WITHIN YOUR APPLICATION

Advanced Visual Basic

Page 2: Accessing data within VB Applications

Overview

The management of databases is the number one use of computers today.  A database (or relational database) is a collection of one or more (usually related) tables that has been created with database-management software.  For our course, we will be using Microsoft Access for the database management software.  We can connect our applications to databases using ADO.NET (ActiveX Data Objects .NET).  This technology allows programs to access data seamlessly from multiple, varied, and distant servers.    

Page 3: Accessing data within VB Applications

Wizards vs. ADO

Our text and Microsoft recommend the use of database wizards to complete the connections and management of data.  However, there is another way. You can connect to databases in code and be in complete control of what is happening within your application.  This is what I prefer because if I can't see the code to a process, I can't debug it!  Does the wizard have a place in programming?  SURE!  I do not use it at all professionally, but I can see the wizards having a place within small applications.

vs.

Page 4: Accessing data within VB Applications

How does ADO work?

Connection – This uses a connection string to say how we will connect to data and what format the data is in

Data Adapter – Converts database code to VB code (to simplify process). …. Populates dataset with data

Data Set – Snapshot of data when you read it from the database

Command Builder – Allows you to add, edit, delete data

Page 5: Accessing data within VB Applications

Bind Controls?

ADO wizard allows you to bind controls. This is a real easy way of displaying information, but does complicate review of data and verification of accuracy.

You can bind controls as well using ADO in code, but I find it just as easy to create a process to read and write to the controls.

Page 6: Accessing data within VB Applications

DataGridView Control

The datagridview control is a very popular method of displaying information in a VB application. You may bind to this control or add/edit items in code.

Page 7: Accessing data within VB Applications

Database Interaction

Question:

Where have you recently seen a database interaction application?

Page 8: Accessing data within VB Applications

Additional Information

For additional information about these topics, please review your text and the links provided in Blackboard.