Answer A

Explanation: You can use the ApplyDefaultSort property to automatically create a sort order, in ascending order, based on the primary key column or columns of the table. ApplyDefaultSort only applies when the Sort property is a null reference or an empty string, and when the table has a primary key defined. All requirements are met:

• The ApplyDefaultSort is set to true (see code above).

• The Table has a primary key

• The Sort property is set to the empty string.

The DataView will be sorted in ascending order on the Primary Key column.

Reference: .NET Framework Developer's Guide, Sorting and Filtering Data Using a DataView [Visual Basic] Incorrect Answers

B: We want to use the default sort order. We should keep the value of ApplyDefaultSort property set to True. C: It is not necessary to include a ORDER BY clause in the SELECT statement. D: We want to sort the DataView, not to filter it.

QUESTION NO: 77

You develop a Windows-based application that enables users to update customer contact information. Your application uses a DataSet object to maintain the customer data while users are reviewing and editing it. When a user finishes updating the data, your application uses the DataSet.WriteXml method to create an XML data file.

The tag name of the root element of the XML data file must be <TestKingCustomerInfo>. You need to add code to your application to ensure that this tag name is set correctly. Which code segment should you use?

A. dsCustomer.Namespace = "TestKingCustomerInfo"

B. dsCustomer = New DataSet("TestKingCustomerInfo")

C. dcCustomer.Prefix = "TestKingCustomerInfo"

D. dsCustomer.WriteXml("TestKingCustomerInfo")

Answer: A

Explanation: The DataSet.Namespace Property gets or sets the namespace of the DataSet. The Namespace property is used in the root element of the XML data file generated from the dataset.

Reference:

.NET Framework Class Library. DataSet.Namespace Property [Visual Basic]

.NET Framework Class Library, DataSet.WriteXml Method (XmlWriter) [Visual Basic]

.NET Framework Class Library, DataSet.Prefix Property [Visual Basic]

Incorrect Answers

B: The name of the dataset does not decide the name of the root element of the XML data file. C: The DataSet.Prefix Property gets or sets an XML prefix that aliases the namespace of the DataSet. The Prefix is used throughout an XML document to identify elements which belong to the namespace of the DataSet object as set by the Namespace property. D: The WriteXml method requires a XmlWriter parameter, not a Text parameter.

QUESTION NO: 78

You use Visual Studio .NET to create a Windows Service application TestKingApp. You compile a debug version and install it on your computer, which runs Windows 2000 Server. You start TestKingApp from the Windows 2000 Service Control Manager. Now you need to begin debugging it within Visual Studio .NET.

0 0

Post a comment