一些70-315的试题
denal 2003-04-05 08:15:03 1. You are creating a Web site for Your company. You receive product lists in the form of XML documents. You are creating a procedure to extract information from these XML documents according to criteria that your users will select.
When a user makes a request, you want the results of these requests to be returned as quickly as possible.
What should you do?
A. Create an XmlDataDocument object and load it with the XML dat Use the DataSet property of the object to create a DataSet object. Use a SQL SELECT statement to extract the requested dat
B. Create an XmlDataDocument object and load it with the XML data. Use the SelectNodes method of the object to extract the requested data.
C. Create an XPathDocument object and load it with the XML data. Call the CreateNavigator method to create an XPathNavigator object. Call the Select method of the XPathNavigator object to run an XPath query that extracts the requested data.
D. Create an XmlReader object. Use the Read method of the object to stream through the XML data and to apply an XPath expression to extract the requested data.
Answer(s) Rank (%) Rank (# votes) Answer Rationale
C 73% 8/11 Rationales
D 27% 3/11 Rationales
----------------------------------------------------
2. You are creating an ASP.NET Web Form that displays employee data from a DataSet object. You want to fill the DataSet object and then you want to retrieve a reference to the employee whose primary key has the value of 1.
You write the following code. (Line numbers are included for reference only)
01 SqlConnection(ConnectionString);
02 conn.Open();
03 SqlCommand cmd = new SqlCommand (_SELECT * FROM Employees_, conn);
04 SqlDataAdapter da = new SqlDataAdapter(cmd);
05 DataSet ds = new DataSet();
06
07 da.Fill(ds, _Employees_);
08
09 DataRow dr;
10 dr = ds.Tables[_Employees_..Rows.Find(1);
11 nameLabel.Text = dr[_Name_..ToString();
When you run the code, you receive the following error message at line 10: _Table doesn't have a primary key._
You ensure that a primary key is defined on the Employees table in the database. You want to alleviate the error to allow the code to run correctly. You also want to catch the exception that would occur if the employee whose primary key has the value if 1 is deleted from the database.
Which two actions should you take (Each Answer: presents part of the solution.) (Choose two)
A. Add the following code at line 06: dMissingSchemaAction = MissingSchemaAction.AddWithKey;
B. Add the following code at line 06: da.MissingSchemaAction = MissingSchemaAction.Add;
C. Add the following code at line 06: da.MissingSchemaAction = MissingSchemaAction.Ignore;
D. Add the following code at line 06: da.MissingSchemaAction = MissingSchemaAction.Error;
E. Place line 07 in a structured exception handling block.
F. Place lines 10 and 11 in a structured exception handling block.
Answer(s) Rank (%) Rank (# votes) Answer Rationale
A,F 100% 5/5 Rationales
----------------------------------------------------
3. You are developing an ASP.NET application for your company's intranet. Employees will use the application to administer their employee benefits. The benefits information is stored in a Microsoft SQL Server database named Benefits.
An employee can select benefits options from 10 different drop-down list boxes. The values for each list are stored in separate tables in the Benefits database. The values that are available for employees to choose can change once each year during the benefits enrollment period.
You want to minimize the number of times your application must access the Benefits database to obtain the values for the drop-down list box.
Which two courses of action should you take (Each Answer: presents part of the solution.)? (Choose two)
A. Create one stored procedure that returns the result for all 10 drop-down list boxes. Create one DataTable object for each of the 10 drop-down list boxes. Use a SqlDataReader object to populate 10 DataTable objects by calling the NextResult() method. Bind the drop-down list boxes to the DataTable objects.
B. Create a stored procedure that returns the result set for all 10 drop-down list boxes. Bind the drop-down list boxes to the DataReader object.
C. Create one DataTable object for each of the 10 drop-down list boxes. Create a stored procedure for each of the 10 tables. Use a SqlDataReader object to populate the 10 DataTable objects. Bind the drop-down list boxes to the DataTable objects.
D. Store the result sets for the 10 drop-down list boxes in a DataSet object. Add the DataSet objects to the Cache object for the application.
E. Store the result sets for the 10 drop-down list bikes in a file on the user's computer by using the DataSet.WriteXml() method.
Answer(s) Rank (%) Rank (# votes) Answer Rationale
A,D 92% 11/12 Rationales
D,E 8% 1/12 Rationales
----------------------------------------------------