Presentation is loading. Please wait.

Presentation is loading. Please wait.

CTEC2902 Adv Programming CTEC2902 Advanced Programming in Visual Studio ( ASP.NET + VB.NET + ADO.NET) Tugrul Essendal 1.

Similar presentations


Presentation on theme: "CTEC2902 Adv Programming CTEC2902 Advanced Programming in Visual Studio ( ASP.NET + VB.NET + ADO.NET) Tugrul Essendal 1."— Presentation transcript:

1 CTEC2902 Adv Programming CTEC2902 Advanced Programming in Visual Studio ( ASP.NET + VB.NET + ADO.NET) Tugrul Essendal 1

2 CTEC2902 Advanced Programming The story so far… You –Studied ASP.NET + VB.NET fundamentals –Want to learn more, specifically Objects and classes Database applications Let’s carry on CTEC2902 Adv Programming2

3 CTEC2902 – Content Classes and Objects use … –Constants and variables (with data types) –Functions and Subs (with parameters) –Selection and loop commands Stuff you should know already Database Applications need … Objects Built-in ADO.NET classes Your own classes to be developed 3-tier structure New material CTEC2902 Adv Programming3

4 Is this you? CTEC2902 Adv Programming4

5 ActivityMarks available Phase test 120 Phase test 230 CW part 120 CW part 230 Assessment Phase tests > short, paper-based, in class Coursework > development of database application  ASP.NET + VB.NET + ADO.NET + SQL Assessments will cover year 1 and year 2 topics 5

6 CTEC2902 Adv Programming Review 6

7 Write a function procedure, named UserType, that takes one integer parameter, named Units, which represents the number of electricity units the customer has used. The function is required to... 1)Identify the customer as being either a “heavy” or “light” electricity user (electricity units greater than 500 is heavy usage) 1)Return either “Heavy” or “Light”, as appropriate, reflecting the identification of the user. Function UserType (Units As Integer) As String If Units > 500 Then Return “Heavy” Else Return “Light” End If End Sub CTEC2902 Adv Programming7

8 Consider the following table definition: Product (ProductNumber, Name, Cost, Description) Write a SQL command that returns the name of all those products, where the cost is between £250 and £500, inclusive. SELECT Name FROM Product WHERE Cost >= 250 AND Cost <= 500 OR SELECT Name FROM Product WHERE Cost BETWEEN 250 AND 500 CTEC2902 Adv Programming8

9 Default names, like TextBox3 or Form2, are not sufficiently meaningful. They give no clues to the data they hold or the functionality they offer. This makes it difficult to understand the code and relate it to the controls on the form, which, in turn, makes maintenance very difficult. Maintenance is a very expensive activity and anything that hinders maintenance should be avoided. Fundamentals Remembered Why should you never use the default names for VB controls, like TextBox1 or Label23? CTEC2902 Adv Programming9

10 Is there any difference between these two commands? If so, what is it? State any assumptions you make. 1.Name = “Jones” 2.Name = Jones Yes, there IS a difference Name = “Jones”The literal string constant value “Jones” is assigned to string variable Name Name = JonesThe contents of variable Jones is assigned to variable Name (It is assumed that both variables are of same type, probably string) Fundamentals Remembered CTEC2902 Adv Programming10

11 Which of the following are valid assignments? 1.txtName = “Jones” 2.txtName.Text = “Jones” 3.txtName.Tag = ‘Jones’ 4.txtName.Name = “Jones” 5.txtName.Text = ‘Jones’ 6.None of the above Fundamentals Remembered CTEC2902 Adv Programming11

12 12 Write a Boolean function with the following signature: Function InRange( TheValue As Integer, _ TheLowEnd As Integer, _ TheHighEnd As Integer) As Boolean The function should return true if the value in the first parameter is in the range defined by the other two parameters and false if not. Fundamentals Remembered Function InRange(TheValue As Integer, _ TheLowEnd As Integer, _ TheHighEnd As Integer) As Boolean Function InRange( TheValue As Integer, _ TheLowEnd As Integer, _ TheHighEnd As Integer ) As Boolean If TheValue >= TheLowEnd And TheValue <= TheHighEnd Then Return True Else Return False End If End Function CTEC2902 Adv Programming12

13 CTEC2415 Object-Oriented Programming Remember to revise the material you studied last year CTEC2902 Adv Programming13

14 CTEC2415 Object-Oriented Programming Have a successful year and Enjoy yourselves CTEC2902 Adv Programming14


Download ppt "CTEC2902 Adv Programming CTEC2902 Advanced Programming in Visual Studio ( ASP.NET + VB.NET + ADO.NET) Tugrul Essendal 1."

Similar presentations


Ads by Google