The 6 lessons of this manual will show you step by step how to build
powerful AspGrid-based Web applications.
There are only two tables in this database, Departments and Employee. The Departments table stores information on departments in some hypothetical company, and the Employee table stores information on the employees of that company. For the Employee table we have chosen to store an employee first and last names, department they work in, marital status code (1 - Single, 2-Married, 3-Divorced, etc) and whether they are fully vested (0 - not fully vested, 1 - fully vested).
There is an obvious one-to-many relationship between the two tables: each department can have multiple employees working in it. This relationship is enforced via the primary key/foreign key pair (Departments.id - Employee.DepartmentID) as shown on this entity-relationship diagram.
IMPORTANT: Note that both tables have an AutoNumber column (which is called an IDENTITY column in SQL Server). AspGrid can only work with tables that have an identity column (with the exception of read-only grids).
Identity columns help AspGrid uniquely identify each individual record in the table.
Identity columns are generally not the same as primary key columns even
though they may coincide as they do in these two tables. The main difference
between the two is that identity column values are always generated by
the DBMS and primary key column values can be entered by a user. Another
difference is that primary key columns can be of any type and identity
columns are usually long integers (MS Access supports another type of identity
columns, Replication ID, but AspGrid requires identity columns to be long
integers).