Geeks With Blogs
Brian Scarbeau Insights from a seasoned Computer Science Trainer

 The semester is rapidly coming to a close in a couple of weeks.  After looking at what’s left to do in the Curlique lessons I will probably eliminate some of the required lessons and have them spend some additional time on web services.

The lesson has a good application using Amazon and I also have an application that I created that uses Pig Latin.

Udentsstay avehay unfay ithway isthay essonlay.  You can go here to translate if you want.

On average it takes about a week to cover two lessons. This includes instructional time as well as having the students learn the lesson online and do the task requirement in the lesson. In addition, it also includes test time. For a smaller class they can probably cover more but I have a class of twenty and some students do run into a jam and need some extra time to do something over.

The students have continued their learning of asp.net and have worked with the code wizards that have really made it easy for me to teach important concepts of working with a database. Lesson 13 has the students create a Band Admin Page so they can update the database.  

As you can see, a button has been created to Insert into the database and for delete as well. The lesson requires the instructor to talk about global variables and how they would be used. For example:

            Dim NumberoftheTour as Integer
Dim DateoftheTour as Date
Dim TheResult as Integer

Students get reminded of the fields that were originally created in the table.

 

Recall that TourNumber and ShowDate are keyfields of the Tour table. The combination of these two fields must be unique. Together these keyfields identify a unique record in the Tour table. A tour (road trip) with a single tour number can span multiple dates.

 

In addition, the students learn how to use a simple If statement to catch any errors that might come up if the button does not do what it’s told to do:

       

     Sub Button1_Click(sender As Object, e As EventArgs)
     NumberoftheTour=Textbox1.Text
     DateoftheTour=Textbox2.Text
     TheResult=QM_InsertTourDate(NumberoftheTour,DateoftheTour,
          Textbox3.Text,Textbox4.Text,Textbox5.Text,Textbox6.Text,Textbox7.Text,
          Textbox8.Text,Textbox9.Text,Textbox10.Text)
     If TheResult >= 1 then
          Label1.Text="Insert Sucessful."
     Else
          Label1.Text="Insert Failed."
     End If
End Sub

 

Lesson 14 works with the Update code wizard and the where clause to get a more detailed query from the database. Students learn how to use Filters in the code wizard query to do this task. In addition, they will learn how to tweak their code The UPDATE Code Wizard does not work quite as smoothly as the INSERT or DELETE code wizards. So we need to change the code in the query method to make it work. We are going to do several things:

·          Change the query to use the arguments passed into the query directly. Previously, the query used command parameters (@City, etc.) to pass the information into the query.

·           Rebuild the SQL query string to take arguments instead of command parameters.

·            Adjust the SQL query string to add single quotes around strings and # signs around dates.

 

I am hoping I can introduce validation controls before we introduce web services. I’m not sure if it will be next week or not.

 

All in all, the students are learning what goes on behind the scenes of creating interactive web pages.

 

Posted on Saturday, December 3, 2005 4:54 AM Teaching with ASP.NET | Back to top

Copyright © Brian Scarbeau | Powered by: GeeksWithBlogs.net