Presentation is loading. Please wait.

Presentation is loading. Please wait.

ASP.NET Relationships between tables

Similar presentations


Presentation on theme: "ASP.NET Relationships between tables"— Presentation transcript:

1 ASP.NET Relationships between tables Report viewer RadioButton List & Dropdown List

2 ASP.NET Relationships between tables

3 The Relationships Between Tables
Create the database as usual and as we already knew from the previous lectures. Click on View, and select Server Explorer window. Double-click on your database then all files which are stored in this database will appear. Right-click on Table folder and choose Add New Table. Create the fields you desire and choose their data types. Don’t forget to save your table. For example, create 3 fields “StudentID” , “StudentName” and “tel”.

4 Right-click on Table folder again and choose Add New Table to Create a new table..
Create the fields you desire and choose their data types. Don’t forget to save your table. For example, create 3 fields “CourseID” , “title” and “hours”.

5 Right-click on Table folder again and choose Add New Table.
Create the fields you desire and choose their data types. Don’t forget to save your table. For example, create 3 fields “StudentID” , “CourseID” and “score”.

6 To assign a foreign key for a table when you in the table definition click on table designer toolbar and choose relationships icon.

7 Select Tables And Columns Specification choice.

8 Select the primary key table.

9 Select the field to be foreign key in this table.

10 Finally select the delete rule.

11 Report viewer

12 Add a “reportviewer”.

13 Add a “Script Manager”.

14 Add New Item > Add a report file.

15 Add a DataSet.

16 Follow the wizard and select the data connection.

17

18

19 Arranging the report. Right Click> Insert > Table > then add each column by Right click on each cell

20 RadioButton List & Dropdown List

21 RadioButton 2 1

22 2 1 3

23 DropDownList 1 2

24 2 1 3

25

26 When you click the button you need to retrieve all selected items:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = " You are : " & RadioButtonList1.SelectedValue & " and your age is between: " & DropDownList1.SelectedValue End Sub

27

28 Questions !! 


Download ppt "ASP.NET Relationships between tables"

Similar presentations


Ads by Google