Datasheet
plain text. Spreadsheets, on the other hand, are complex files containing not only the entered text and
numbers, but also details about the data, such as what the columns contain, how they are formatted, and
so on.
Databases also fall into the category of complex files. When using Microsoft Access, you have an MDB
file – this is a database file, but you can't tell anything about the data from the file itself. You need a way
to get to the data, either using Microsoft Access itself, or as we are going to do, using the .NET data
classes. Before you can access the data, you need to know how it is stored internally.
Tables
Within a database, data is stored in tables – these are the key components of all databases. A table is like a
spreadsheet, with rows and columns. You generally have multiple tables for multiple things – each
distinct type of data is stored separately, and tables are often linked together.
Let's look at an example that should make this easier to visualize. Consider an ordering system, for
example, where you store details of customers and the goods they've ordered. The following table shows
rows of customer orders, with columns (or fields) each piece of order information:
Customer Address Order Date Order Item Quantity Item Cost
John 15 High
Street
Brumingham
England
UK
01/07/2003 Widget 10 3.50
John 15 High
Street
Brumingham
England
UK
01/07/2003 Doodad 5 2.95
John 15 High
Street
Brumingham
England
UK
01/08/2003 Thingy 1 15.98
Chris 25 Easterly
Way
Cradiff
Wales
UK
01/08/2003 Widget 1 3.50
Dave 2 Middle
Lane
Oxborough
England
UK
01/09/2003 Doodad 2 2.95
248
Chapter 8
57084_08.qxp 30/01/2004 8:02 PM Page 248