Sie sind auf Seite 1von 5


CMPE 418


Answer 1.

a) HonoredToPayTaxes.aspx GUI page has a log-in form with CitizenshipNo & OnlineAccessKey
fields for user entry. There is also a CustomValidator linked up to either field. Submit button
activates the CustomValidator_ServerValidate handler in the code-behind which fetches
OnlineAccessKey from DB corresponding to CitizenshipNo to verify identity. If not verified,
args.IsValid is set to false. If verified, validator sets FormsAuthentication.SetAuthCookie for
CitizenshipNo. Then adds CitizenshipNo into HttpSessionState Session object as verified. And,
server is Reditected to WhatCanIDoforYou.aspx page. Check figure 20.39, lines 76-end.
b) At WhatCanIDoforYou.aspx page there is nothing specific to do with respect to
authentication/authorization! Web.config configuration file handles the rest.
c) Web.config file must have authentication and authorization elements set as follows:
i. <authentication mode= Forms>
<forms name= OnlineAccessCookie loginUrl= HonoredToPayTaxes.aspx>
ii. <authorization>
<deny users= ?>

a) 5 p
b) 5 p
c) 5 p.

Answer 2.
a) System.Data and its subspace System.Data.OleDb
b) Actions to create (VS .NET 2003):
i. Connection to data source:
1) View > Server Explorer
2) Right click on Data Connections
3) Double click on Add Connection
4) Click Provider tab in the Connection Properties window
5) Choose (double-click on) Data Provider for OleDb (VS .NET 2005)
6) Choose Microsoft Jet 4.0 OLE DB Provider
7) Click Connection tab
8) Provide UID/PW for DB and select the MyDB to connect to
9) Click OK.
ii. Data adapter:
1) Drag an OleDbDataAdapter from Toolbox Data Group and drop it onto the
design window
2) Data Adapter Configuration Wizard is displayed. Click Next.
3) Select Use SQL Statement,
4) Click Query Builder
5) Select table
6) Choose columns. Then OK.
iii. Data set:
1) Toolbox > Data > drag DataSet onto form
2) Choose Untyped DataSet (no schema).
iv. Using VS. NET 2005: use Data menu tab, Add DataSource, highlight DataSource and
choose table.
c) Code to:
i. fill data set in constructor: oleDbDataAdapter.Fill (dataSetName, table name);
ii. bind data to a grid in constructor: dataGrid.SetDataBinding (dataSetName, table name);
d) DB-Grid column correspondence: Use adapter.TableMappings.AddRange; to map ranges
System.Data.Common.DataTableMapping and System.Data.DataColumnMapping
constructors. Or, through Grid Options select Edit Columns.

a) 2 p
b) 4 p
c) 2 p
d) 2 p.

Answer 3.

<?xml version= "1.0" ?>

<html xmlns="" >
<title>Answer to Final Question 3</title>
<caption style="text-align:center">
Table 4.5<br />
Learning nanagement systems market<br />
<em>(millions of dollars</em>
<th>Simba Information</th>
<th>Lifelong Learning Report</th>
<th>Bersin &amp; Associates</th>

caption: 1
thead: 1
rows: 1
hd: 2
body: 2

Answer 4.

<?xml version= "1.0" ?>

<html xmlns="" >
<title>Answer to Final Question 4</title>
<link rel="Stylesheet" href="style.css" type="text/css" />
<!-- skipped parts -->
<p class="Gill">Other specifications ...:
<ul type="disc">
<li><a href="...">SVG</a> contains the CSS properties ....</li>
<li><a href="..." class="italic">Accessibility Features of CSS</a> is
a Note about ...</li>
<!-- skipped parts -->
External style sheet style.css contains for this example the following:
.Gill {font-family: Gill Sans MT}
.italic {text-decoration: italic}
li {font-size: 1.5em}
rel link: 1
text: 1
CSS elems: 1

Answer 5.

Well, as year of a data point is not mentioned, the schema is not wholly correct for the table. You
could do one of a few things in this case:
i. Assume there is an attribute field for each estimate element and mark year there,
ii. Assume there is a year element in the estimate sequence and mark year there,
iii. Assume the table content is fixed, that is, for each source first estimate is for year 2001, 2nd for
2003, 3rd for 2004, and 4th for 2006.
iv. Other choices.

I took the (ii) choice as it produces an intelligible data file.

<?xml version="1.0" encoding="utf-8" ?>

<!-- Example XML data file for the final Exam Q.5 LMS-Estimates.xml -->
<LMS:estimates xmlns:LMS="">
<source>Simba Information</source>
<source>Lifelong Learning Report</source>
<source>Bersin &amp; Associates</source>

<?xml : 1
ns: 1
root: 1
elements: 2
Answer 6.

a) Using VS .NET 2005 Beta:

If updated: Grades.asmx & Grades.asmx.cs;
otherwise: Service.asmx & Service.cs
b) <%@ WebService Language="C#" CodeBehind="~/Code/Service.cs" Class="Service" %>
Service may have been edited to read Grades.
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
// ... others as needed

[WebService (Namespace = ., Description = ..)]

public class Grades : System.Web.Services.WebService {

public double GetCGPA ( . . . ) {

public double GetGPA ( . . . ) {


a: 1
b: 2
c: 2