PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

How many connection pools are created?

You develop an ADO.NET application that uses a Microsoft SQL Server database and a SqlClient data provider. Your application includes the following four code segments, which are each called once:

SqlConnection myConnection1 = new SqlConnection();
myConnection1.ConnectionString = “Data Source=ProdServer;” + “Initial Catalog=Billing;Integrated Security=true”;
myConnection1.Open();

SqlConnection myConnection2 = new SqlConnection();

myConnection2.ConnectionString = “Data Source=ProdServer;” + “Initial Catalog=Billing;Integrated Security=true”;
myConnection2.Open();

SqlConnection myConnection3 = new SqlConnection();
myConnection3.ConnectionString =
“Data Source=SearchServer;”
+ “Initial Catalog=Search;Integrated Security=true”;
myConnection3.Open();

SqlConnection myConnection4 = new SqlConnection();
myConnection4.ConnectionString = “Data Source=ProdServer;” + “Initial Catalog=OrderEntry;Integrated Security=true”;
myConnection4.Open();

You verify that your application is the only application that is using SQL Server. Your application runs all code segments by using the same identity.

You run the application. Connection pooling is enabled, and the entire application runs within the
connection timeout parameter.

How many connection pools are created?

Which code segment should you use?

You have a DataSet object named myDataSet that is populated with data from a Microsoft SQL Server database. This object contains insertions, deletions, and updates to the data. You want to apply the data changes in myDataSet to the database. You decide to use the SqlClient
data provider. You need to create a data object that you will use to update the database. Which code segment should you use?

Which code segment should you use?

Your company receives product information from manufacturers in the form of XML documents. The product information is stored in a Microsoft SQL Server database.

The format of each XML document varies. Each one is located in a MemoryStream object named newProds.

You create a merge procedure that reads data and schema information in a DataSet object and merges the information into your database. You now need to write code to transfer the XML document and its schema into a DataSet object.

Which code segment should you use?

Which code segment should you use?

You have a SqlDataReader object named productsDataReader. The productsDataReader object contains three columns in the following order:

ProductID as Integer
ProductName as nvarchar(40)
UnitsInStock as Integer

You want to use productsDataReader to create an inventory management report. You define the following three variables:

int myProductID;
string myProductName;
int myUnits;

You need to ensure that the report runs as quickly as possible.

Which code segment should you use?

Which code segment should you use?

You have a DataSet object named loanCustomersDataSet that contains customers serviced by the loan department of your company. You receive a second DataSet object named assetCustomersDataSet that contains customers serviced by the asset management department of your company. Both objects have the same structure.

You want to merge assetCustomersDataSet into loanCustomersDataSet and preserve the original values in loanCustomersDataSet.

Which code segment should you use?

Which two actions should you take? (Each correct answer presents part of the solution

You create an XML Web service that calculates taxes. You deploy the service to a production computer named Production. The URL of the production XML Web service is http://Production/WS/TaxCalc.asmx. The service does not support all international tax rates. You want to find out which unsupported tax rates are being requested by users. If a user requests a tax rate that is not supported, the service records the request by using a trace message. You then want to view the unsupported rates that have been requested. Which two actions should you take? (Each correct answer presents part of the solution. Choose two.)

You need to resolve this exception

You create a .NET Remoting object named AdminService, which is hosted in Internet Information Services (IIS). The object uses an HttpChannel and a BinaryFormatter. AdminService is in an assembly named AdminService.dll. The URL for AdminService is http://LocalHost/AdminService/AS.rem.

You write a test console application named Tester.exe to test the AdminService interface. Tester.exe includes the following code segment:

public class Tester {
public static void Main(string[] Args) {
AdminService service = new AdminService();
// Code to exercise the service object.
}
}

You write a configuration file for Tester.exe. The configuration file is named Tester.exe.config and
includes the following code segment:
You run Tester.exe. The application immediately throws a System.NullReferenceException. The exception includes the following message: “Object reference not set to an instance of an object.” You need to resolve this exception.

What should you do?

What should you do?

You create a serviced component named Scheduler. Scheduler is registered in a library application. The Scheduler methods parse String objects into DateTime objects. You write a console application named Coverage.exe to test each method in Scheduler. You want Coverage.exe to test Scheduler for multiple cultures to verify its globalization support. What should you do?

What should you do?

You create an XML Web service that uses the Trace class to output error messages, warning messages, and informational messages to a log file. The service uses a TraceSwitch object to filter the trace output.

The DisplayName property of the TraceSwitch object is “globalSwitch”. On a development computer, all trace output appears in the log file.

You move the service to a production computer. You must configure the production XML Web service to output only error messages to the log file.

What should you do?