Sunday 16 May 2010

SQL Database

Right Click on App_Code

Add a "New Item" to the website project, select "SQL Server Database"

Right Click, "Add New Table"

"Identity" property of field = "Yes" to increase ID number by 1
"Show Table Data" under "Server Explorer" screen allows data entry

Grid/Form View Control:

Drag/drop grid view on .aspx design page from "Data" section of "Toolbox"

Connect to database (source), select "Database", then select from drop down list, then select headers, under "Advanced" tick both boxes, then "Finish".

Enable "Paging". Splits data over pages. Expand limit in "Properties" when grid selected ("PageSize"). "Mode" thuis changes numeric values to symbols.

Enable "Sorting"allows headings to become hyperlinks for organising data

"Edit Columns" on "Grid View Tasks". Changes column names.

Create a new page, drag/drop "Form View" from "Data" section of "Toolbox".

Choose "Data Source", select "Database", "Connection String", select headings & tick "Advanced" options, then "Finish".

Select form, choose "Auto Format" to add some colour.

"Edit Templates" = edit different states of form eg when in "Edit" mode or in "Insert" mode
Paging can again be enabled & edited.

No comments:

Post a Comment