Testking 70-400 Microsoft exam study guide
Chapter 4: Lesson Review Answers
Lesson 1
1. You have a DataSet containing a Customer DataTable and an Order DataTable. You want to easily navigate from an Order DataRow to the Customer who placed the order. What object will allow you to easily navigate from the Order to the Customer? 70-400
A. The DataColumn object
B. The DataTable object
C. The DataRow object
D. The DataRelation object
1. Correct Answer: D
A. Incorrect: The DataColumn won’t help with the navigation.
B. Incorrect: The DataColumn won’t help with the navigation.
C. Incorrect: The DataColumn won’t help with the navigation. 70-350
D. Correct: You can use the DataRelation to navigate from the child to the parent or from the parent to the child.
2. Which of the following is a requirement when merging modified data into a DataSet?
A. A primary key must be defined on the DataTable objects.
B. The DataSet schemas must match in order to merge.
C. The destination DataSet must be empty prior to merging.
D. A DataSet must be merged into the same DataSet that created it.
2. Correct Answer: A
A. Correct: Primary keys must exist or the changed data will be appended into the destination DataSet instead of being merged.
B. Incorrect: The DataSet schemas do not need to match, and you can specify what to do about the differences.
C. Incorrect: The destination DataSet does not need to be empty.
D. Incorrect: The DataSet does not need to be merged back to the same DataSet that created it.
3. You are working with a DataSet and want to be able to display data, sorted different ways. How do you do so?
A. Use the Sort method on the DataTable object.
B. Use the DataSet object’s Sort method.
C. Use a DataView object for each sort.
D. Create a DataTable for each sort, using the DataTable object’s Copy method, and then Sort the result.
3. Correct Answer: C
A. Incorrect: The DataTable object does not have a Sort method.
B. Incorrect: The DataSet object does not have a Sort method. 70-315
C. Correct: The DataView can be used for each sort.
D. Incorrect: The DataTable object does not have a Sort method.
Lesson 2
1. Which of the following ways can you proactively clean up a database connection’s resources? (Choose two.)
A. Execute the DbConnection object’s Cleanup method.
B. Execute the DbConnection object’s Close method.
C. Assign Nothing (C# null) to the variable that references the DbConnection object.
D. Create a using block for the DbConnection object.
1. Correct Answers: B and D
A. Incorrect: No such method.
B. Correct: The Close method cleans up resources.
C. Incorrect: Is not proactive and can orphan connections.
D. Correct: The using block calls the Dispose method. 70-297
2. What event can you subscribe to if you want to display information from SQL Print statements? (Choose one.)
A. InfoMessage
B. MessageReceived
C. PostedMessage
D. NewInfo
2. Correct Answer: A
A. Correct: The InfoMessage event displays informational messages as well as the output of the SQL print statement.
B. Incorrect: No such event.
C. Incorrect: No such event.
D. Incorrect: No such event. 836 Answers
3. To perform asynchronous data access, what must be added to the connection string?
A. BeginExecute=true
B. MultiThreaded=true
C. MultipleActiveResultSets=true
D. Asynchronous=true 70-294
3. Correct Answer: D
A. Incorrect: No such key.
B. Incorrect: No such key.
C. Incorrect: No such key.
D. Correct: You must set Asynchronous=true.
Lesson 3
1. Which class can be used to create an XML document from scratch?
A. XmlConvert
B. XmlDocument
C. XmlNew
D. XmlSettings
1. Correct Answer: B
A. Incorrect: Cannot be used to create a new XML document.
B. Correct: Use the XmlDocument class to create a new document from scratch.
C. Incorrect: No such class.
D. Incorrect: No such class.
2. Which class can be used to perform data type conversion between .NET data types and XML types?
A. XmlType
B. XmlCast
C. XmlConvert
D. XmlSettings
2. Correct Answer: C
A. Incorrect: No such type.
B. Incorrect: No such type.
C. Correct: Use the XmlConvert class.
D. Incorrect: No such type.
Chapter 4: Case Scenario Answers
Case Scenario 1: Determining Ways to Update the Database 70-292
You are creating a new Web page that allows users to upload XML files that contain expense report data. The expense report data contains general information about the expense report, such as the employee name and ID, the branch office number, and the week-ending date. The expense report file also contains information that describes each specific expense. For mileage, this data includes the date and the mile amount, and the and from locations. For entertainment, the data includes the location, the expense amount, and a description of the entertainment expense.
You need to import this data into a SQL Database and are looking for the easiest possible means. Define some methods of importing this data into the SQL Server database.
You can load the XML file into a DataSet and then use a SqlDataAdapter to retrieve all changes and send the changes to the database.
You can read the XML file into an XmlDocument object and use the DOM to parse the data and write code to send the changes to the database.
You can use the XmlTextReader to read the XML file node by node, capturing the data and sending it to the database.
Case Scenario 2: Storing a DataSet to a Binary File 70-291
Your code populates a DataSet with more than 200,000 DataRows in several related DataTables. You want to store this DataSet object to a file, but you want the file to be as small as possible. What will you do to reduce the size of the file?
■ Store the DataSet as a binary file by using the BinaryFormatter object.
You must set the RemotingFormat property of the DataSet to SerializationFormat.Binary to force the DataSet to be serialized as binary.
Related posts:
- Pass4sure Microsoft 70-526 certification testing Creating DataSet Objects NS0-201 70-643 156-215.1 DataSet objects are available...
- Testking 70-528 Microsoft exam Chapter 5: Lesson Review Answers Lesson 1 1. What file...
- Testking Microsoft certification exam study guide Chapter 2 Analyzing an Existing Infrastructure Analyze the Current Administration...
- Testking 350-029 Cisco simulation test Chapter 9 Lesson 1: Configuration Settings 1. Which code segment...
- Microsoft MCTS 70-235 exam study guide 1.You are the desktop administrator for your company. You are...