|
Simple example for the Region table. Shows the basic elements of smartDBforms.NET. Standard paging.
This form allows the user to view and edit records from the Northwind table Region.
Region table has only two columns – RegionID and RegionDescription.
RegionID is the primary key. It is of type int but is not set as IDENTITY. This
means that its values are not auto generated, but the user has to enter them when
inserting new records. When editing an existing record the RegionID values should
be readonly.
The first id of the regions to select is passed in as an url query parameter – RegionID. For example
the url “RegionsSimple.aspx?RegionID=2” shows all region records with ID greater than or equal to 2. If no RegionID
is passed all regions are displayed.
The default mode of the form is set to ReadOnly. The command buttons Edit and New
change the
mode to Edit and Insert respectively.
SmartPager with built-in user interface is used in order to navigate through the records.
The OperationStatus control displays operation confirmation and error messages.
CREATE TABLE [dbo].[Region](
[RegionID] [int] NOT NULL,
[RegionDescription] [nchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
CONSTRAINT [PK_Region] PRIMARY KEY NONCLUSTERED
(
[RegionID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
|