PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which approach should you choose?

You are an enterprise application developer. You are creating the first version of an application to manage rich text documents.
The application must meet the following design requirements:

Support the file system and a Microsoft SQL Server database as data stores.
Ensure the following for future versions:
o Add support for additional data stores, including network storage. o Acquire the ability to interface with third-party-distributed authoring and versioning tools.

Bring additional storage options online without having to redeploy the entire application. You need to identify an appropriate approach to meet these requirements. Which approach should you choose?

Which code segment should you use?

A Windows Forms application contains the following code segment.

Dim SQL As String = “SELECT EmployeeID, LastName, FirstName FROM Employees” Dim da As New SqlDataAdapter(SQL, connStr)
Dim dt As New DataTable()
da.MissingSchemaAction = MissingSchemaAction.AddWithKey
Dim bld As New SqlCommandBuilder(da)
da.Fill(dt)

The application allows the user to add rows to the data table. The application will propagate these additions to the database. If the addition of any row fails, the other rows must still be added. The code must log how many new rows failed to be added. You need to propagate the additions to the database and log a failed count. Which code segment should you use?

What should you do?

You are an enterprise application developer. You are implementing a new component for an application. The component accesses a database to populate a list of customer objects and exposes a method that is named GetAllCustomers. The component uses a design pattern to access the database only on an as-needed basis. A caching mechanism exists in a lower tier of the application architecture. The component must not cache data. You need to implement the logic for populating a list of customer objects by using a database query. You also need to ensure that you meet the company guidelines for the component design pattern. What should you do?

Which code segment should you add at line 05?

You are creating a Windows Forms application. The application loads a data table named dt from a database and modifies each value in the data table. You add the following code.
(Line numbers are included for reference only.)

01 Dim row As DataRow
02 For Each row In dt.Rows
03 Dim col As DataColumn
04 For Each col In dt.Columns
06 Trace.WriteLine(str)
07 Next col
08 Next row

You need to format the string named str to show the value of the column at the time the data is loaded
and the current value in the column. Which code segment should you add at line 05?

What should you do?

You are an enterprise application developer. You design a data access component that interacts with a Microsoft SQL Server database. The component uses a database connection string. The database connection string is stored in clear text in the ConnectionStrings section of the application configuration file. During testing, you discover that the component might be vulnerable
to SQL injection attacks. You need to adopt a strategy to protect the component from SQL injection attacks. What should you do?