PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which two actions should you perform?

You are developing an application that includes the following code segment. (Line numbers are included forreference only.)
01 class Animal
02 {
03 public string Color { get; set; }
04 public string Name { get; set; }
05 }
06 private static IEnumerable<Animal> GetAnimals(string sqlConnectionString)
07 {
08 var animals = new List<Animal>();
09 SqlConnection sqlConnection = new SqlConnection(sqlConnectionString);
10 using (sqlConnection)
11 {
12 SqlCommand sqlCommand = new SqlCommand(“SELECT Name, ColorName FROM
Animals”, sqlConnection);
13
14 using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader())
15 {
16
17 {
18 var animal = new Animal();
19 animal.Name = (string)sqlDataReader[“Name”];
20 animal.Color = (string)sqlDataReader[“ColorName”];
21 animals.Add(animal);
22 }
23 }
24 }
25 return animals;
26 }
The GetAnimals() method must meet the following requirements:
Connect to a Microsoft SQL Server database.
Create Animal objects and populate them with data from the database.
Return a sequence of populated Animal objects.
You need to meet the requirements. Which two actions should you perform? (Each correct answer presents
part of the solution. Choose two.)

Which code segment should you use?

You are developing an application. The application calls a method that returns an array of integers named
employeeIds. You define an integer variable named employeeIdToRemove and assign a value to it. You
declare an array named filteredEmployeeIds. You have the following requirements:
Remove duplicate integers from the employeeIds array.
Sort the array in order from the highest value to the lowest value.
Remove the integer value stored in the employeeIdToRemove variable from the employeeIds array.
You need to create a LINQ query to meet the requirements. Which code segment should you use?

You need to design a table structure to ensure that cer…

You are designing a data warehouse hosted on SQL Azure. The data warehouse currently includes the
dimUser and dimDistrict dimension tables and the factSales fact table. The dimUser table contains records for
each user permitted to run reports against the warehouse, and the dimDistrict table contains information about
sales districts. The system is accessed by users from certain districts, as well as by area supervisors and users
from the corporate headquarters. You need to design a table structure to ensure that certain users can see
sales data for only certain districts. Some users must be permitted to see sales data from multiple districts.
What should you do?

You need to establish the best technique to log these i…

You are writing a SQL Server Integration Services (SSIS) package that transfers data from a legacy system.
Data integrity in the legacy system is very poor. Invalid rows are discarded by the package but must be logged
to a CSV file for auditing purposes. You need to establish the best technique to log these invalid rows while
minimizing the amount of development effort. What should you do?


Page 715 of 6,830« First...102030...713714715716717...720730740...Last »