>Concorsi
>Forum
>Bandi/G.U.
 
 
 
 
  Login |  Registrati 
Elenco in ordine alfabetico delle domande di 70-320: Developing XML Web services and Server components with Visual C# .NET and the .NET Framework

Seleziona l'iniziale:
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

> Clicca qui per scaricare l'elenco completo delle domande di questo argomento in formato Word!


You are creating a .NET Remoting object named BankOps. BankOps exposes methods for creating, finding, and modifying objects in a class named BankCustomer. BankCustomer has a large number of read/write properties. You expect a large number of remote client applications to frequently connect to BankOps. You expect these remote client applications to use many of the BankCustomer properties. You want to ensure that network traffic is minimized.

What should you do?   Add the Serializable attribute to the BankCustomer class.

You are creating a .NET Remoting object named BankOps. BankOps exposes methods for creating, finding, and modifying objects in a class named BankCustomer. BankCustomer has a large number of read/write properties. You expect a large number of remote client applications to frequently connect to BankOps. You expect these remote client applications to use many of the BankCustomer properties. You want to ensure that network traffic is minimized.

What should you do?   Derive the BankCustomer class from MarshalByRefObject. Override the inherited InitializeLifetimeService method to return null.

You are creating a .NET Remoting object named Dealer for automobile dealership. Dealer exposes a method named SaveSales that saves sales information for the dealership.

Dealer is configured to use Integrated Windows authentication to authenticate its callers. You must ensure that all users of SaveSales are members of the Manager group before allowing the code within SaveSales to run.

Which code segment should you use?   [PrincipalPermission(SecurityAction.Demand, Role=”Manager”)] public DataSet SaveSales(DataSet sales) { // Code to save sales data goes here. }

You are creating a .NET Remoting object named Payroll. The Payroll class allows remote client applications to access payroll data for your company. Client applications are developed by using Windows Forms and Web Forms.

You must ensure that remote client applications are securely authenticated prior to gaining access to Payroll object. You want to accomplish this task by writing the minimum amount of code.

What should you do?   Host the Payroll class in Internet Information Services (IIS) and implement Integrated Windows authentication.

You are creating a .NET Remoting object named PropertyCache. PropertyCache will hold a Hashtable object or name/value pairs.

A variety of remote client applications will communicate with PropertyCache to set and get property values. You need to ensure that properties set by one client application are also accessible to other client applications.

Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two)   Configure PropertyCache to be a server-activated Singleton object.

You are creating a .NET Remoting object named PropertyCache. PropertyCache will hold a Hashtable object or name/value pairs.

A variety of remote client applications will communicate with PropertyCache to set and get property values. You need to ensure that properties set by one client application are also accessible to other client applications.

Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two)   Derive the PropertyCache class from MarshalByRefObject and override InitializeLifetimeService() to return null.

You are creating a .NET Remoting object. You want to add code to the object to log error messages and warning messages. You want the log messages written to both a log file and to the Windows application log.

Which code segment should you use?   Trace.Listeners.Add(new EventLogTraceListener(“obj”)); Trace.Listeners.Add( new TextWriterTraceListener(“obj.log”)); Trace.WriteLine(“sample message”);

You are creating a serviced component named Component that will be distributed to your customers. You are also creating a setup project that will register the component in the global assembly cache on each customer’s computer.

You anticipate that there will be future updates to Component that you will provide to your customers. All updates to Component will be backward compatible. You will create similar setup projects for each update of Component that will register the updated assembly in the global assembly cache.

You need to ensure that any applications on your customers’ computer that reference Component use the most recent version of the component.

Which action or actions should you take? (Choose all that apply)   Sign Component by using a strong name.

You are creating a serviced component named Component that will be distributed to your customers. You are also creating a setup project that will register the component in the global assembly cache on each customer’s computer.

You anticipate that there will be future updates to Component that you will provide to your customers. All updates to Component will be backward compatible. You will create similar setup projects for each update of Component that will register the updated assembly in the global assembly cache.

You need to ensure that any applications on your customers’ computer that reference Component use the most recent version of the component.

Which action or actions should you take? (Choose all that apply)   Include a publisher policy file that is registered in the global assembly cache on your customer’s computers.

You are creating a serviced component named Component that will be distributed to your customers. You are also creating a setup project that will register the component in the global assembly cache on each customer’s computer.

You anticipate that there will be future updates to Component that you will provide to your customers. All updates to Component will be backward compatible. You will create similar setup projects for each update of Component that will register the updated assembly in the global assembly cache.

You need to ensure that any applications on your customers’ computer that reference Component use the most recent version of the component.

Which action or actions should you take? (Choose all that apply)   Increment the assembly version for each update of Component.

You are creating a serviced component named ItemInventory. An online catalog application will use ItemInventory to display the availability of products in inventory.

Additional serviced components written by other developers will continuously update the inventory data as orders are placed.

The ItemInventory class includes the following code segment: <Transaction(TransactionOption.Required)> _ Public Class ItemInventory Inherits ServicedComponent ‘ Method code goes here. End Class

ItemInventory is configured to require transactions. You want ItemInventory to respond to requests as quickly as possible, even if that means displaying inventory values that are not up to date with the most recent orders.

What should you do?   To the ItemInventory class, add the following attribute: <ObjectPooling(True)>

You are creating a serviced component named ItemInventory. An online catalog application will use ItemInventory to display the availability of products in inventory.

Additional serviced components written by other developers will continuously update the inventory data as orders are placed.

The ItemInventory class includes the following code segment: <Transaction(TransactionOption.Required)> _ Public Class ItemInventory Inherits ServicedComponent ‘ Method code goes here. End Class

ItemInventory is configured to require transactions. You want ItemInventory to respond to requests as quickly as possible, even if that means displaying inventory values that are not up to date with the most recent orders.

What should you do?   Modify the Transaction attribute of the ItemInventory class to be the following attribute: <Transaction(TransactionOption.Required, _ IsolationLevel:= TransactionIsolationLevel.ReadUncommitted)>

You are creating a serviced component named UserManager. UserManager adds user accounts to multiple transactional data sources.

The UserManager class includes the following code segment: [Transaction(TransactionOption.Required)] [SecurityRole(“Admin”)] public class UserManager : ServicedComponent { public void AddUser(string name, string password) { // Code to add the user to data sources goes here. } }

You must ensure that the AddUser method reliably saves the new user to either all data sources or no data sources.

What should you do?   To AddUser, add the following attribute: [AutoComplete()]

You are creating a Visual Studio .NET assembly, which will run as a shared assembly with other applications. The assembly will be installed in the global assembly cache. You will distribute the assembly to many customers outside Fulton. You must ensure that each customer receives your assembly without alteration, in a way that reliably specifies the origin of the code.

What should you do?   First sign the assembly by using a strong name. Then sign the assembly by using File Signing tool (Signcoe.exe).

You are creating a Windows-based application named WinApp. To the application, you add a Windows Form named Form and a reference to a SingleCall .NET Remoting object named TheirObject.

You need to ensure that Form creates an instance of TheirObject to make the necessary remote object calls.

Which code segment should you use?   RemotingConfiguration.RegisterActivatedClientType(typeof(TheirObject), “http://Server/TheirAppPath/TheirObject.rem”); TheirObject theirObject = new TheirObject();

You are creating a Windows-based application named WinApp. To the application, you add a Windows Form named Form and a reference to a SingleCall .NET Remoting object named TheirObject.

You need to ensure that Form creates an instance of TheirObject to make the necessary remote object calls.

Which code segment should you use?   RemotingConfiguration.RegisterWellKnownClientType(typeof(Object); “http://Server/TheirAppPath/TheirObject.rem”); TheirObject theirObject = new TheirObject();

You are creating an ASP.NET application named WebApp. To WebApp, you add a Web reference to an XML Web service named UserService.

UserService consists of a Web method named RetrieveUserInfo. This Web method takes a userID as input and returns a DataSet object containing user information. If the userID is not between the values 1 and 1000, a System ArgumentException is thrown.

In WebApp, you write a try/catch block to capture any exceptions that are thrown by UserService. You invoke RetrieveUserInfo and pass 1001 as the user ID.

Which type of exception will be caught?   System.Web.Service.Protocols.SoapException

You are creating an XML Web service named AccountingInformation for Fulton. AccountInformation exposed a Web method named GetAccountBalance that returns the account balance as a string. You must limit access to GetAccountBalance to users who have credentials stored in your Microsoft SQL Server database.

You need to design GetAccountBalance to receive encrypted user credentials by using two custom fields named Username and Password in the SOAP header. To accomplish this goal, you must write the code for GetAccountBalance.

Which code segment should you use?   public class AuthenticateUser : SoapHeader { public string Username; public string Password; } // In the AccountInformation class add this code: public AuthenticateUser authenticateUserHeader; [WebMethod, SoapHeader(“authenticateUserHeader”)] public string GetAccountBalance() { if (authenticateUserHeader == null) return “Please supply credentials. “; else // Code to authenticate user and return // the account balance goes here. }

You are creating an XML Web service named ApproveService that is available only on your intranet. The service exposes a Web method named Close that updates the status of open work orders to “closed”.

You configure ApproveService to use only Integrated Windows authentication. You must ensure that access to specific functionality within the service is based on a user’s membership in specific Windows groups. You want to accomplish this by using rolebased security.

You want to allow all members of the Reviewers group and of the Admins group to be able to execute the Close method without creating a third group that contains members from both groups.

Which code segment should you use?   [PrincipalPermissionAttribute (SecurityAction.Demand, Role=”Reviewers”)] [PrincipalPermissionAttribute (SecurityAction.Demand, Role=”Admins”)] private void Close() { // Code to process the Close method goes here. }

You are creating an XML Web service named Customer that provides customer information. You write code to keep track of error messages, warning messages, and informational messages while the service is running. You use the Trace class to write the messages to a log file.

On test computers, you want to see error messages and warning messages. On deployment computers, you want to see error messages, but not warning messages.

Which two code segments should you use (Each correct answer presents part of the solution.)? (Choose two)   private static TraceSwitch mySwitch; static BankCustomer { mySwitch = new TraceSwitch(“tswitch”, “a trace switch”); }

You are creating an XML Web service named Customer that provides customer information. You write code to keep track of error messages, warning messages, and informational messages while the service is running. You use the Trace class to write the messages to a log file.

On test computers, you want to see error messages and warning messages. On deployment computers, you want to see error messages, but not warning messages.

Which two code segments should you use (Each correct answer presents part of the solution.)? (Choose two)   Trace.WriteLineIf(mySwitch.TraceError, “An error occurred.”); Trace.WriteLineIf(mySwitch.TraceWarning, “Warning message”);

You are creating an XML Web service named InventoryService for a nationwide clothing retailer company Fulton Inc. The service provides near real-time inventory information to individual store managers by using a virtual private network (VPN).

InventoryService exposes a Web method named RetrieveInventory that returns inventory information to the caller. You configure Internet Information Services (IIS) and InventoryService to use Integrated Windows authentication.

You need to write code in InventoryService to ensure that only members of the Manager group can access RetrieveInventory.

What should you do?   To the <authorization> section of the Web.config file, add the following element: <allow roles=”Manager” />

You are creating an XML Web service named InventoryService for a Spotney Ltd. Each branch of Spotney Ltd. will build its own client application to consume InventoryService. Each branch connects to the main office of the dealership by using a virtual private network (VPN). All computers in the dealership run on Microsoft Windows operating systems.

You need to ensure that callers of InventoryService are authenticated based on their Windows logon name and password. You configure Internet Information Services (IIS) according to your security needs. You need to configure the authentication type in the Web.config file.

Which code segment should you use?   <authentication mode=”Windows” />

You are creating an XML Web service named LegalService. This service exposes two Web methods named SendMessage and ReceiveMessage. SendMessage is used to send highly confidential messages to its customers. ReceiveMessage is used to receive highly confidential messages from its customers and to process these messages for future use.

You need to ensure that these messages cannot be intercepted and viewed by anyone other than LegalService and the custondrs who access LegalService.

Which security mechanism should you use?   SSL

You are creating an XML Web service named ListBoxService. This service provides content, such as states, countries, and geographical regions, for use in drop-down list boxes.

ListBoxService contains a Web method named RetrieveRegionsListBox. This method runs a DataSet object that contains every geographical region in the world. RetrieveRegionsListBox calls a Microsoft SQL Server database to load the DataSet object with region data. You want to minimize the amount of time the method takes to return to the caller.

What should you do?   Set the CacheDuration property of the WebMethod attribute to an interval greater than zero.

You are creating an XML Web service named myService. This service has a function named WriteMessage that writes messages to a flat file in the C:\Logs\myServiceLog directory.

You want to implement security for WriteMessage so that WriteMessage and all the code it calls can write messages only to the myServiceLog directory.

Which code segment should you use?   FileIOPermission filePermission = new FileIOPermission (FileIOPermissionAccess.Write, “C:\\Logs\myServiceLog”); filePermission.PermitOnly();

You are creating an XML Web service named myWebService. This service will be used to exchange highly confidential information over the Internet with your company’s business partner named Fulton, Inc. You want only callers from Fulton, Inc., to be able to access myWebService. You do not want to have to accept a user name and password from callers.

Once callers are authenticated, you want to use Windows user accounts to authorize access to the Web methods exposed by the Web service. You set up two Windows user accounts named FultonAssociate and FultonManager. You need to configure myWebService to meet these security requirements.

Which type of authentication should you use?   Client Certificate

You are creating an XML Web service named Service that processes stock transactions. Service exposed a Web method named BuyStock that takes as input a stock symbol and the number of shares to buy.

You know that callers who consume this service will require that SOAP messages be formatted as document-literal SOAP messages or RPC-encoded SOAP messages. You must create a solution that will return both types of SOAP messages.

You want to accomplish this task by writing the minimum amount of code.

Which code segment should you use?   [SoapDocumentMethod()][WebMethod()] public string BuyStockDoc(string symbol, int shares) [SoapRpcMethod()][WebMethod()] public string BuyStockRpc(string symbol, int shares)

You are creating an XML Web service named StockService. The service contains a Web method named RetrieveStockInfo.

RetrieveStockInfo takes as input a stock symbol and returns a DataSet object that contains information about that stock. You want to capture all incoming SOAP messages in RetrieveStockInfo and write the messages to a file for future processing.

What should you do?   Create a SOAP extension for RetrieveStockInfo.

You are creating an XML Web service named Tracker to track orders for your company. Tracker includes a Web method named OrderStatus for tracking the status of individual orders. You anticipate that many client applications will use the service. You want administrators of Tracker to be able to monitor the requests per second for OrderStatus.

Which code segment should you use?   CounterCreationData[] counterData = { new CounterCreationData( “OrderStatus req/sec”, “help”, PerformanceCounterType.RateOfCountsPerSecond32) }; CounterCreationDataCollection collection = new CounterCreationDataCollection(counterData); PerformanceCounterCategory.Create(“Tracker”, “Tracker performance counters”, collection);

You are creating an XML Web service named ViewOrders that is available to customers over the Internet. ViewOrders exposes a Web method named ViewShippingDetail that requires additional security. You decide to use generic rolebased security to secure ViewShippingDetail.

You need to write code to ensure that once the caller is authenticated, a user identity named Generic is created. This user identity has membership in a group named Shipping to allow access to ViewShippingDetail.

Which code segment should you use?   GenericIdentity myIdentity = new GenericIdentity(“Generic”, “Custom”); string[] Roles = {“Shipping”}; GenericPrincipal myPrincipal = new GenericPrincipal(myIdentity, Roles); Thread.CurrentPrincipal = myPrincipal;

You are creating an XML Web service named WeatherService that provides the current weather conditions for cities around the world. Your development cycle includes three stages: development, testing, and production. In each stage, WeatherService will be deployed on a different server.

For testing, you create an ASP.NET application named WeatherTest. To WeatherTest, you add a Web reference to WeatherService. You then build a user interface and add the necessary code to test the service.

The WeatherService interface will not change between testing and deployment. You want to ensure that you do not have to recompile WeatherTest every time WeatherService is moved from one server to another.

What should you do?   Set the URLBehavior property of the generated proxy class to dynamic. Each time WeatherService is moved, update the appropriate key in the Web.config file to indicate the new location.

You are creating an XML Web service named WebService. Callers must be authenticated by using credentials passed in the SOAP header of each Web service call. You want to use role-based security to secure each method on WebService. The roles that users are assigned are stored in a custom database table. You need to write code that will allow you to dynamically change which roles can execute specific methods at run time.

What should you do?   Create a GenericIdentity object and a GenericPrincipal object. Then implement imperative role-based security.

You are creating an XML Web service that processes credit card information. This service will be consumed by computers that run on Microsoft Windows operating systems, as well as computers that run on other operating systems.

You must ensure that client credentials passed to the service are secure and cannot be compromised. You are not as concerned with the length of time that Web method calls take to maintain this level of security. You need to configure authentication for this service.

Which type of authentication should you use?   Client Certificate

You are creating an XML Web service that processes highly confidential messages. The service exposed a Web method named RetrieveMessage that takes as input a code name and returns an encrypted message.

You create a SOAP extension and override the extension’s ProcessMessage method so that you can encrypt the message before it is sent back to the caller.

You need to encrypt only the data within the RetrieveMessageResult node of the SOAP response. You create a function named EncryptMessage that encrypts the RetrieveMessageResult node. You need to ensure that this method gets called before sending the message back to the caller.

During which SoapMessageStage should you call EncryptMessage?   AfterSerialize

You are creating an XML Web service that provides a daily quotation from literary works to its customers. This quotation is requested in many different languages, thousands of times every day, and by thousands of Web sites operating many different platform.

A Web method named GetQuotes takes a languageID as input. GetQuotes uses this language ID to retrieve a translated version of the daily quotation from a Microsoft SQL Server database and to return that quotation to the customer.

You want to minimize the time it takes to return the translated version.

What should you do?   Store each translated quotation by using the Cache object.

You are creating an XML Web service that provides a daily quotation from literary works to its customers. This quotation is requested in many different languages, thousands of times every day, and by thousands of Web sites operating many different platform.

A Web method named GetQuotes takes a languageID as input. GetQuotes uses this language ID to retrieve a translated version of the daily quotation from a Microsoft SQL Server database and to return that quotation to the customer.

You want to minimize the time it takes to return the translated version.

What should you do?   Set the CacheDuration property of the WebMethod attribute to an interval greater than zero.

You are creating an XML Web service that tracks employee information. The service contains a Web method named RetrieveEmployees. The service also contains a base class named Employee and two classes named Manager and Engineer, which are derived from Employee.

RetrieveEmployees takes a roleID as input that specifies the type of employee to retrieve, either Manager or Engineer. RetrieveEmployees returns an array type Employee that contains all employees that are in the specified role.

You want to ensure that Manager and Engineer object types can be returned from RetrieveEmployees.

What should you do?   Apply two XmlInclude attributes to RetrieveEmployees, one of type Manager and one of type Engineer.

You are creating an XML Web service that will be accessed by callers who cannot use SSL encryption because if firewall restrictions. To protect sensitive data, you want to encrypt a portion of the data returned from the service by using objects in the Cryptography namespace.

The service will use a standard encryption routine to encrypt the data before it is sent to the caller. The caller will decrypt the data by using instructions provided by you.

You need to write code to encrypt the sensitive data that is in a local variable named myData. First, you create an instance of a Cryptography Service Provider.

What should you do next?   Create an Encryptor object that passes in a key and an initialization vector (IV) as parameters. Create a CryptoStream object that passes in an output stream and the Encryptor object as parameters. Convert myData to a stream and use the CryptoStream object to write the value of myData to an encrypted stream. Convert the output stream to a string.

You are creating an XML Web service that will consist of a class named Stock. Stock will expose the following public fields: Symbol, CompanyName, and CurrentPrice.

When serialized by the XMLSerializer, stock will take the following form: <Stock symbol=”> <Company /> <CurrentPrice /> </Stock>

You need to construct the Stock class.

Which code segment should you use?   Public Class Stock <XmlAttributeAttribute(“symbol”)>_ Public Symbol As String <XmlElementAttribute(“Company”)>_ Public CompanyName As String Public CurrentPrice As Double End Class

You are debugging a visual studio .Net application named App. App produces an Xml documents object and then consumes the same object. This object moves data in the application. The object has no schema, but it contains a declaration line that you must inspect.

You decide to transform the XML code and its declaration into a string for easy inspection.

What should you do?   Assign the outerXml property of the Xml document object to a string variable

You are debugging a visual studio .Net application named App. App produces an Xml documents object and then consumes the same object. This object moves data in the application. The object has no schema, but it contains a declaration line that you must inspect.

You decide to transform the XML code and its declaration into a string for easy inspection.

What should you do?   Assign the outerXml property of the Xml document element property of the Xml document object to a string variable.

You are developing a order-processing application that retrieves data from a Microsoft SQL Server database named Data that contains a table named Customers and a table named Orders.

Customer has a primary key of customerID. Each row in orders has a CustomerID that indicates which customer placed the order.

Your application uses a DataSet object named ordersDataSet to capture customer and order information before it applied to the database. The ordersDataSet object has two Data Table objects named Customers and Orders.

You want to ensure that a row cannot exist in the Orders Data Table object without a matching row existing in the customers Data Table object.

Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two.)   Create a foreign key constraint named ConstraintCustomers that has Customers.CustomerID as the parent column and Orders.CustomerID as the child column.

You are developing a order-processing application that retrieves data from a Microsoft SQL Server database named Data that contains a table named Customers and a table named Orders.

Customer has a primary key of customerID. Each row in orders has a CustomerID that indicates which customer placed the order.

Your application uses a DataSet object named ordersDataSet to capture customer and order information before it applied to the database. The ordersDataSet object has two Data Table objects named Customers and Orders.

You want to ensure that a row cannot exist in the Orders Data Table object without a matching row existing in the customers Data Table object.

Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two.)   Add ConstraintCustomers to the Orders Data Table.

You are developing a Windows-based application that requires the use of a calculation function named CalculateValue. This function includes the following signature:

int CalculateValue(int x) ;

CalculateValue is located in an unmanaged DLL named Functions.dll, and is not part of a COM interface. You need to be able to use CalculateValue in your application.

Which action or actions should you take? (Choose all that apply)   To your application, add the following code segment: [DllImport(“Functions.dll”)] public static extern int CalculateValue(int x);

You are developing a Windows-based application that requires the use of a calculation function named CalculateValue. This function includes the following signature: int CalculateValue(int);

CalculateValue is located in an unmanaged DLL named Functions.dll, and is not part of a COM interface. You need to be able to use CalculateValue in your application. Your project directory contains a copy of Functions.dll.

While you are working in Debug mode, you attempt to run your application. However, a System.DllNotFoundException is thrown. You verify that you are using the correct function named. You also verify that the code in the DLL exposes CalculateValue. You have not modified the project assembly, and you have not modified machine-level security. You need to test your application immediately.

What should you do?   Move Functions.dll to your project’s Debug directory.

You are developing an application named App by using Visual C# .NET and Visual Basic .NET. The application will use functions form a DLL written in unmanaged code.

One function requires the calling application to allocate unmanaged memory, fill it with data, and pass the address of the memory to the function. On returning from the function, the calling application must deallocate the unmanaged memory.

You need to decide how your application will handle unmanaged memory.

What should you do?   Use the methods of the Marshal class.

You are developing an application that queries a Microsoft SQL Server database. The application will package the results of the query as XML data. The XML data will be retrieved directly from the database and transmitted electronically to a business partner.

The query must retrieve all rows and all columns from a database table named Customers.

Which query should you use?   SELECT * FROM Customers FOR XML AUTO

You are developing an application that queries a table named Products in a Microsoft SQL Server database named Data. The query will be stored in a string variable named sqlQuery. The query includes the following SQL code: SELECT * FROM Products FOR XML AUTO

You must iterate the query results and populate an HTML table with product information.

You must ensure that your application processes the results as quickly as possible.

What should you do?   Set the SqlCommand object’s CommandText to sqlQuery. Use the ExecuteXmlReader method of the SqlCommand object to create an XmlReader object. Use the XmlReader object to read the data.

You are developing an application that receives product information from external vendors in the form of XML documents. The information will be stored in a Microsoft SQL Server database.

The application must validate all incoming XML data. It uses an XmlValidatingReader object to read each XML document. If any invalid sections of XML are encountered, the inconsistencies are listed in a single document.

You must ensure that the validation process runs as quickly as possible.

What should you do?   Create and register a ValidationEventHandler method.

You are developing an application that retrieves a list of geographical regions from a table in a Microsoft SQL Server database. The list of regions is displayed in a dropdown list box on a Windows Form.

You want to populate the list box with data from a DataSet object. You want to fill the DataSet object by using a SqlDataAdapter object.

You create a SqlConnection object named Connection and a SQL query string named regionSQL. You need to write the code to create the SqlDataAdapter object.

Which code segment should you use?   SqlDataAdapter DataAdapter = new SqlDataAdapter(regionSQL, Connection);

You are developing an application to maintain customer information in a Microsoft SQL Server database. You populate a DataSet object named DataSet. You bind this object to a DataGrid object.

Your application invokes a Web method named CustomerUpdates in an XML Web service. This method accepts DataSet as a parameter and processes the updates made in the DataGrid object.

You want to ensure that network traffic to the Web service is minimized.

Which code segment should you use?   if (DataSet.HasChanges()) { DataSet customerChanges = new DataSet(); customerChanges = DataSet.GetChanges(); CustomerUpdates(customerChanges); }

You are developing an application to monitor store inventory. When inventory falls below a specified level, the application automatically generates a purchase request. Suppliers have requested that you transmit purchase requests to them in an XML document. Suppliers will accept the XML document in any valid form, except they do not want the data set definition to be included in the XML file.

You create a method named GeneratePurchaseRequest. You write the code to populate a DataSet object named myDataSet with the purchase request data. You define a variable named fileName that contains the name and path of the output file.

You need to create an XML file from the data in myDataSet by adding code to GeneratePurchaseRequest. You want to accomplish this task by writing the minimum amount of code.

Which code segment should you use?   myDataSet.WriteXML(fileName, XmlWriteMode.IgnoreSchema);

You are developing an ASP.NET application that consumes an XML Web service named AccountInformation. AccountInformation exposes a Web method named GetAccountBalance that requires encrypted user credentials to be passed in the SOAP header.

AccountInformation also exposes a public class named AuthenticateUser.

AuthenticateUser has two properties named Username and Password that are both defined as string.

In the application, you create two local variables named encryptedUsername and encryptedPassword that you will use to pass user credentials to GetAccountBalance.

You need to write code that will execute the GetAccountBalance Web method.

Which code segment should you use?   AccountInformation AccountInformation = new AccountInformation(); AuthenticateUser AuthenticateUser = new AuthenticateUser(); AuthenticateUser.Username = encryptedUsername; AuthenticateUser.Password = encryptedPassword; AccountInformation.AuthenticateUserValue = AuthenticateUser; string accountBalance; accountBalance = AccountInformation.GetAccountBalance();

You are planning to create a DataSet object named DataSet to be used in a bondtrading application. Several developers will need to write code to manipulate myDataSet, and you want to ensure that DataSet is easy for them to use. You decide to create DataSet as a strongly typed data set.

Which two actions should you take (Each correct answer presents part of the solution)? (Choose two)   Create an XSD schema that defines DataSet.

You are planning to create a DataSet object named DataSet to be used in a bondtrading application. Several developers will need to write code to manipulate myDataSet, and you want to ensure that DataSet is easy for them to use. You decide to create DataSet as a strongly typed data set.

Which two actions should you take (Each correct answer presents part of the solution)? (Choose two)   Create a class for DataSet that is based on the schema and that inherits from the DataSet class.

You are preparing to deploy a serviced component named ProductAvailability. This component will be used by multiple client applications to look up the current availability of products. Some of these client applications were written by other developers and are installed on computers at other locations.

You need to maximize the security on the deployment computer. You want to configure the component’s COM+ application to run under a restricted user account named OutsideUser.

What should you do?   Use the Component Services tool to manually set the Identity property of the COM+ application to OutsideUser.

You are preparing to deploy an XML Web service named InventoryService. This service queries a Microsoft SQL Server database and returns information to the caller.

You use Visual Studio .NET to create a setup project. You need to install InventoryService. You also need to run a script to create the necessary SQL Server database and tables to store the data. To accomplish this, you need to configure the project to have administrator rights to the SQL Server database.

You add a custom dialog box to the project that prompts the user for the administrator user name and password that are used to connect to the SQL Server database. You need to make the user name and password available to a custom Installer class that will execute the script.

What should you do?   Create a custom install action. Set the CustomActionData property to the entered user name and password. Then access these values in the Install subroutine.

You are troubleshooting a Visual Studio .NET application that was developed by a former colleague. The application contains a NextToken function. This function reads product names from a file. You find the following code segment with a large assembly:

XmlTextWriter xwriter = new XmlTextWriter(“productNames.xml”, System.Text.Encoding.UTF8); xwriter.WriteStartDocument(true); xwriter.WriteStartElement(“data”); string val = NextToken(); while(val ! = “”){ xwriter.WriteElementString(“item”, val); val = NextToken(); } xwriter.WriteEndElement(); xwriter.WriteEndDocument(); xwriter.Close();

You find that productsNames.xml contains only two entries: prod0 and prod1.

Which XML output is produced by this code segment?   <?xml version=”1.0”?> <data xmlns=”> <item = “prod0” /> <item = “prod1” /> </data>

You are troubleshooting a Visual Studio .NET application that was developed by a former colleague. The application contains a NextToken function. This function reads product names from a file. You find the following code segment with a large assembly:

XmlTextWriter xwriter = new XmlTextWriter(“productNames.xml”, System.Text.Encoding.UTF8); xwriter.WriteStartDocument(true); xwriter.WriteStartElement(“data”); string val = NextToken(); while(val ! = “”){ xwriter.WriteElementString(“item”, val); val = NextToken(); } xwriter.WriteEndElement(); xwriter.WriteEndDocument(); xwriter.Close();

You find that productsNames.xml contains only two entries: prod0 and prod1.

Which XML output is produced by this code segment?   <?xml version=”1.0” encoding=”utf-8” standalone=”yes”?> <data xmlns=> <item>prod0</item> <item>prod1</item> </data>

You are using a Visual Studio .NET to develop an application that uses a non-COM DLL named Functions.dll. This DLL is written in unmanaged code. The DLL contains a function that parses a string into an array of string words and an array of numbers. A call to the function includes the following pseudocode:

input = “A string with 6 words and 2 numbers” words = null numbers = null Parse(input, words, numbers)

After execution, words contains all string words found in input and numbers contains all integers found in input. You need to enable your application to call this function.

Which code segment should you use?   [DllImport(“Functions.dll”)] public static extern void Parse(string input, ref string[] words, ref int[] numbers);

You are using Visual Studio .NET to develop a new application to replace an older COM-based application. The new application will use some of the old COM components until they can be replaced by Visual Studio .NET code. Your application uses a COM DLL named COM.dll. The Visual Studio .NET assembly for COM.dll must be named OurDotNetCOM. You must use the name “ProjectX” for the namespace of the COM components. You must ensure that your application uses these naming guidelines.

What should you do?   Run the Type Library Importer (Tlbimp.exe) with the /namespace and /out options to create the assembly.

You are using Visual Studio .NET to develop an application named App. You have a common business logic component that was created in COM that you want to use until you can replace it with Visual Studio .NET code. You create the Visual Studio .NET solution for the new application. You want to use the COM component in your Visual Studio .NET solution.

What should you do?   Use Visual Studio .NET to add a reference to the COM component.

You are using Visual Studio .NET to develop an application that uses a non-COM DLL named Functions.dll. This DLL is written in unmanaged code. One function in the DLL performs encryption. This function takes two arguments. One argument is the string to be encrypted. The other argument is the resulting encrypted string. The function returns an integer that is an error code. You must ensure that your application uses this function correctly.

Which code segment should you use?   [DllImport(“Functions.dll”)] public static extern int encrypt(string input, StringBuilder output); string input = “Stuff to encrypt”; StringBuilder output = new StringBuilder(500); int errCode = encrypt(input, output);

You are using Visual Studio .NET to develop an application that uses a non-COM DLL named Functions.dll. This DLL is written in unmanaged code. One function in the DLL performs encryption. This function takes two arguments. One argument is the string to be encrypted. The other argument is the resulting encrypted string. The function returns an integer that is an error code. You must ensure that your application uses this function correctly.

Which code segment should you use?   [DllImport(“Functions.dll”)] public static extern int encrypt(string input, ref string output); string input = “stuff to encrypt”; string output = null; int errCode = encrypt(input, ref output);

You are using Visual Studio .NET to develop an application to replace a COM-based application. A former colleague began writing a .NET class for the new application. This class will be used by client applications as a COM object. You are assigned to finish writing the class.

The class included the following code segment: [Com Visible(false)] public class Class { public Class() { // Implementation code goes here. } [ComVisible(true)] public int Method(string param) { return 0; } [ComVisible(true)] protected bool OtherMethod(){ return true; } [ComVisible(true)] public int Property { get { return 0; } } // Other implementation code goes here. }

When this code runs, it will expose one or more methods to the client application through COM.

Which member or members will be exposed? (Choose all that apply)   Method

You are using Visual Studio .NET to develop an application to replace a COM-based application. A former colleague began writing a .NET class for the new application. This class will be used by client applications as a COM object. You are assigned to finish writing the class.

The class included the following code segment: [Com Visible(false)] public class Class { public Class() { // Implementation code goes here. } [ComVisible(true)] public int Method(string param) { return 0; } [ComVisible(true)] protected bool OtherMethod(){ return true; } [ComVisible(true)] public int Property { get { return 0; } } // Other implementation code goes here. }

When this code runs, it will expose one or more methods to the client application through COM.

Which member or members will be exposed? (Choose all that apply)   Property

You are using Visual Studio .NET to develop an application to replace a COM-based application. You are assigned to write a .NET class that will be used by client applications as a COM object. Your class code is being moved and modified while development continues on the new application.

You want to minimize any possible disruption to the COM interface as a result of code changes.

Which code segment should you use?   [Guid(“9ED54F84-A89D-4fcd-A854-44251E925F09”)] public interface IClassToExpose { public int Calc(); } [ClassInterface[ClassInterfaceType.None)] public int Calc() { // Implementation code goes here. } }

You are using Visual Studio .NET to develop an application to replace a COM-based application. You are assigned to write a .NET class that will be used by client applications as a COM object. Your class code is being moved and modified while development continues on the new application.

You want to minimize any possible disruption to the COM interface as a result of code changes.

Which code segment should you use?   [ClassInterface(ClassInterfaceType.AutoDispatch)] public class ClassToExpose { public int Calc() { // Implementation code goes here. } }

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: <configuration> <system.runtime.remoting> <application> <client> <wellknown url=”http://LocalHost/AdminService/AS.rem” type=”AdminService, AdminService”/> </client> </application> </system.runtime.remoting> </configuration>

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?   To the application element of the Tester.exe.config file, add the following code segment: <channels> <channel ref=”http”> <clientProviders> <formatter ref=”binary”/> </clientProviders> </channel> </channels>

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: <configuration> <system.runtime.remoting> <application> <client> <wellknown url=”http://LocalHost/AdminService/AS.rem” type=”AdminService, AdminService”/> </client> </application> </system.runtime.remoting> </configuration>

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?   At the beginning of the Main method in Tester.exe, add the following line of code: RemotingConfiguration.Configure(“Tester.exe.config”);

You create a .NET Remoting object named Patientinfo that exposes medical patient information. Because of the confidential nature of the information, you must ensure that the data remains secure.

You want client applications to connect to Patientinfo over a secure communication channel. You want to accomplish this task by writing the minimum amount of code.

What should you do?   Install Patientinfo in an Internet Information Services (IIS) virtual directory. Configure Patientinfo to use an HttpChannel and a SoapFormatter. Configure IIS to use SSL.

You create a .NET Remoting object named Time. The Time is in the Utils namespace and is in an assembly file named dll.

The Time class is hosted in an Internet Information Services (IIS) virtual directory named UtilsSvr. The Time class is configured to be a server-activated object and uses a URI named Time.rem.

You use a client application named client.exe to test the Time object. client.exe creates instances of the Time object by using the following method signature:

public Time CreateInstance() { RemotingConfiguration.Configure(“client.exe.config”); return new Time(); }

You want client.exe to create instances of the Time class on a compute named Hosting.

What should you do?   Create a client.exe.config file that includes the following code segment: <configuration> <system.runtime.remoting> <application> <client> <wellKnown type=”Utils.Time, client” url=”http://Hosting/UtilsSvr/Time.rem”/> </client> </application> </system.runtime.remoting> </configuration>

You create a .NET Remoting object named Time. The Time is in the Utils namespace and is in an assembly file named dll.

The Time class is hosted in an Internet Information Services (IIS) virtual directory named UtilsSvr. The Time class is configured to be a server-activated object and uses a URI named Time.rem.

You use a client application named client.exe to test the Time object. client.exe creates instances of the Time object by using the following method signature:

public Time CreateInstance() { RemotingConfiguration.Configure(“client.exe.config”); return new Time(); }

You want client.exe to create instances of the Time class on a compute named Hosting.

What should you do?   Create a client.exe.config file that includes the following code segment: <configuration> <system.runtime.remoting> <application> <client url=”http://Hosting/UtilsSvr/Time.rem”> <activated type=”Utils.Time, client”/> <client> </application> </system.runtime.remoting> </configuration>

You create a serviced component named BankTransfer. BankTransfer is in a COM+ application named Fulton Bank. BankTransfer is secured by using the SecurityRole attribute for the Tellers and Managers roles. You want members of the FultonBankTellers group to be assigned to the Tellers role.

What should you do?   Use the Component Services tool to add the FultonBankTellers group to the existing Tellers role.

You create a serviced component named Item that implements an interface named Item. You want to ensure that calls to the serviced component through Item are queued.

What should you do?   To the Item assembly, add the following attribute: [assembly: ApplicationQueuing(Enables=true, QueueListenerEnabled=true)]

You create a serviced component named OrderProcessor. OrderProcessor implements the IOrderinit interface. The component and the interface contain the following code segments:

[Guid(“0B6ABB29-43D6-40a6-B5F2-83A457D062AC”)] [InterfaceType(ComInterfaceType.InterfaceIsDual)] public interface IOrderInit { // IOrderInit methods go here. } public class OrderProcessor: ServicedComponent, IOrderInit { // OrderProcessor methods go here. }

You discover that every time you rebuild OrderProcessor, existing unmanaged client code fails. The HRESULT for the exception is 0x80040154. The exception includes the following message: “Class not registered”. You need to resolve this problem.

What should you do?   Add a Guid attribute to the OrderProcessor class.

You create a serviced component named OrderProcessor. OrderProcessor implements the IOrderinit interface. The component and the interface contain the following code segments:

[Guid(“0B6ABB29-43D6-40a6-B5F2-83A457D062AC”)] [InterfaceType(ComInterfaceType.InterfaceIsDual)] public interface IOrderInit { // IOrderInit methods go here. } public class OrderProcessor: ServicedComponent, IOrderInit { // OrderProcessor methods go here. }

You discover that every time you rebuild OrderProcessor, existing unmanaged client code fails. The HRESULT for the exception is 0x80040154. The exception includes the following message: “Class not registered”. You need to resolve this problem.

What should you do?   To the OrderProcessor class, add the following attribute: [ClassInterface(ClassInterfaceType.AutoDual)]

You create a serviced component named Scheduler. Scheduler is registered in a library application. The Scheduler methods parse String objects into Date Time 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?   Set the current thread’s CurrentCulture property to each culture locale before calling the Scheduler methods.

You create a serviced component named SessionDispenser. This computer is in the Utilities assembly and is registered in a COM+ server application. SessionDispenser has multiple callers.

You discover that there are logic problems in the Create New Session method. You want to debug any calls to this method.

What should you do?   Attach the debugger to a Dllhost.exe process. Set a breakpoint on the CreateNewSession method.

You create a serviced component named StockQuote that implements the IStockQuote interface. The StockQuote class includes the following code segment: public class StockQuote : ServicedComponent, IStockQuote { public Price GetQuote(Ticker stock) { // Code for the method goes here. } }

You want to secure StockQuote so that it can only be accessed by users in the Customers and Managers roles.

Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two)   To the StockQuote class, add the following attribute: [ComponentAccessControl]

You create a serviced component named StockQuote that implements the IStockQuote interface. The StockQuote class includes the following code segment: public class StockQuote : ServicedComponent, IStockQuote { public Price GetQuote(Ticker stock) { // Code for the method goes here. } }

You want to secure StockQuote so that it can only be accessed by users in the Customers and Managers roles.

Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two)   To the StockQuote class, ad the following attributes: [SecurityRole(“Customers”, false)] [SecurityRole(“Managers”, false)]

You create a serviced component named Tracker that uses attributes to dynamically register itself for COM+ services. Tracker is in an assembly file named fullrun.dll. Tracker uses transactions and role-based security. The roles and the application identity for Tracker are configured on the development computer.

You are preparing to hand off Tracker to and administrator for deployment to production computers. You want all the COM+ configuration information for Tracker to be installed on the production computers.

What should you do?   Use the Component Services tool to export Tracker to an .msi file. Provide to the administrator the .msi file with instructions to run the installer.

You create a services component named OrderStatus that is in an assembly named Orders. OrderStatus is in its own COM+ application named App. OrderStatus is used by multiple client applications to look up the status of orders. Because you anticipate that client applications will frequently access OrderStatus, you need to ensure that the method calls are processed as quickly as possible.

What should you do?   Configure App to be a library application.

You create a Windows service named Service that queries a table named Orders in a Microsoft SQL Server database. You want Service to check every 30 seconds for now rows in Orders.

You create the following method in Service: private void ProcessOrders(object source, ElapsedEventArgs eventArgs) { // Logic to process Orders table goes here. }

You need to add additional code to Service to invoke the ProcessOrders method.

What should you do?   To the OnStart method, add the following code segment: Timer Timer = new Timer(); Timer.Elapsed += new ElapsedEventHandler(ProcessOrders); Timer.Interval = 30000; Timer.Enabled = true;

You create a Windows service named Service that queries a table named Orders in a Microsoft SQL Server database. You want Service to check every 30 seconds for now rows in Orders.

You create the following method in Service: private void ProcessOrders(object source, ElapsedEventArgs eventArgs) { // Logic to process Orders table goes here. }

You need to add additional code to Service to invoke the ProcessOrders method.

What should you do?   To the OnStart method, add the following code segment: Timer Timer = new Timer(); Timer.Elapsed += new ElapsedEventHandler(ProcessOrders); Timer.Interval 30000; Timer.AutoReset = true;

You create a Windows service that processes XML messages placed in a MSMQ queue. You discover that the service is not functioning properly. You need to debug the service to correct the program.

What should you do?   Start the Windows service. Then attach a debugger to the process.

You create an assembly that contains a collection of serviced components. You want to secure these components by using a collection of COM+ roles. Different groups of roles will secure different components.

You need to ensure that role-based security is enforced in the assembly. You want to accomplish this goal by adding an attribute to the project source code.

Which attribute should you use?   [assembly: ApplicationAccessControl(AccessChecksLevel = AccessChecksLevelOption.ApplicationComponent)]

You create an XML Web service named AutoPartsService that processes automobile part orders. This service exposes a Web method named PlaceOrder, which is shown in the following code segment:

[WebMethod(TransactionOption.RequiresNew)] public DataSet PlaceOrder(DataSet orderData) { Server1.BrakesService brakes = new Server1.BrakesService(); Server2.PartsService parts = new Server2.PartsService(); // Call OrderBrakes to order only brakes. brakes.OrderBrakes(orderData.Tables[“Brakes”]); // Call OrderParts to order all other auto parts. parts.OrderParts(orderData.Tables[“Parts”]); }

BrakesService and PartsService are XML services. The TransactionOption property of OrderBrakes and OrderParts is set to TransactionOption.Required. You develop a Windows Forms application named PartOrderApp that consumes AutoPartsService. You run PartOrderApp and place and order for three sets of brakes and four wheels. While PlaceOrder is placing the order for the wheels, you close PartOrderApp.

What is the most likely result?   OrderParts stops processing the order, and all orders are cancelled.

You create an XML Web service named AutoPartsService that processes automobile part orders. This service exposes a Web method named PlaceOrder, which is shown in the following code segment:

[WebMethod(TransactionOption.RequiresNew)] public DataSet PlaceOrder(DataSet orderData) { Server1.BrakesService brakes = new Server1.BrakesService(); Server2.PartsService parts = new Server2.PartsService(); // Call OrderBrakes to order only brakes. brakes.OrderBrakes(orderData.Tables[“Brakes”]); // Call OrderParts to order all other auto parts. parts.OrderParts(orderData.Tables[“Parts”]); }

BrakesService and PartsService are XML services. The TransactionOption property of OrderBrakes and OrderParts is set to TransactionOption.Required. You develop a Windows Forms application named PartOrderApp that consumes AutoPartsService. You run PartOrderApp and place and order for three sets of brakes and four wheels. While PlaceOrder is placing the order for the wheels, you close PartOrderApp.

What is the most likely result?   OrderParts continues processing the order, and all orders are placed.

You create an XML Web service named AutoPartsService that processes automobile part orders. This service exposes a Web method named PlaceOrder, which is shown in the following code segment:

[WebMethod(TransactionOption.RequiresNew)] public DataSet PlaceOrder(DataSet orderData) { Server1.BrakesService brakes = new Server1.BrakesService(); Server2.PartsService parts = new Server2.PartsService(); // Call OrderBrakes to order only brakes. brakes.OrderBrakes(orderData.Tables[“Brakes”]); // Call OrderParts to order all other auto parts. parts.OrderParts(orderData.Tables[“Parts”]); }

BrakesService and PartsService are XML services. The TransactionOption property of OrderBrakes and OrderParts is set to TransactionOption.Required. You develop a Windows Forms application named PartOrderApp that consumes AutoPartsService. You run PartOrderApp and place and order for three sets of brakes and four wheels. While PlaceOrder is placing the order for the wheels, you close PartOrderApp.

What is the most likely result?   OrderParts stops processing the order, the brakes are ordered, but the wheels are not ordered.

You create an XML Web service named Fulton1 that exposed your company’s inventory data. This data is used by other companies to place orders. Fulton1 must conform to existing formatting standards for inventory data.

You deploy Fulton1. You discover that some client applications are rejecting your XML formatting because the XML is inconsistent with the expected standard. You want to debug this problem by tracing the XML responses.

What should you do?   In the Web.config file, enable tracing by setting the enabled attribute of the trace element to “true”.

You create an XML Web service named Fulton1 that exposed your company’s inventory data. This data is used by other companies to place orders. Fulton1 must conform to existing formatting standards for inventory data.

You deploy Fulton1. You discover that some client applications are rejecting your XML formatting because the XML is inconsistent with the expected standard. You want to debug this problem by tracing the XML responses.

What should you do?   Create a SOAP extension to log the SoapMessageStage.AfterSerialize output to a log file.

You create an XML Web service named Fulton1. You use the Debug.Assert method in your code to verify parameter values and ranges.

You find that Service1 does not display assertion failure messages. Instead, Fulton1 returns an HTTP 500 error message when an assertion fails. You want to view the assertion failure messages.

What should you do?   Modify the compilation element of the Web.config file by setting the debug attribute to “true”.

You create an XML Web service named Fulton1. You use the Debug.Assert method in your code to verify parameter values and ranges.

You find that Service1 does not display assertion failure messages. Instead, Fulton1 returns an HTTP 500 error message when an assertion fails. You want to view the assertion failure messages.

What should you do?   In the constructor for Fulton1, add an EventLogTraceListener object to the Listeners property of the Debug class.

You create an XML Web service named LatLong that converts street addresses to latitude and longitude coordinates.

If a customer ID is not passed as part of a SOAP header, you want the service to refuse the request. You want these service refusal messages to be logged to an event log named LatLongLog. You anticipate that there will be a lot of these log entries over time. A string object named refusalMessage contains the message to log.

Which code segment should you use?   if (!EventLog.SourceExists(“LatLongSource”)) { EventLog.CreateEventSource(“LatLongSource”, “LatLongLog”); } EventLog.WriteEntry(“LatLongSource”, refusalMessage, EventLogEntryType.Error);

You create an XML Web service named PhoneNumberService that returns the telephone numbers of people in a specified geographical region. If an error occurs when the service is processing requests, a custom application exception named PhoneNumberException is thrown.

You create an ASP.NET application named PhoneBook that contains a Web reference to PhoneNumberService. You need to wrap any calls made to PhoneNumberService in a try/catch block to catch any PhoneNumberException that may be thrown.

Which two code segments are possible ways to achieve this goal (Each correct answer presents a complete solution.)? (Choose two)   try { // Code to call PhoneNumberService method goes here. } catch (SoapException ex) { // Handle the exception. }

You create an XML Web service named PhoneNumberService that returns the telephone numbers of people in a specified geographical region. If an error occurs when the service is processing requests, a custom application exception named PhoneNumberException is thrown.

You create an ASP.NET application named PhoneBook that contains a Web reference to PhoneNumberService. You need to wrap any calls made to PhoneNumberService in a try/catch block to catch any PhoneNumberException that may be thrown.

Which two code segments are possible ways to achieve this goal (Each correct answer presents a complete solution.)? (Choose two)   try { // Code to call PhoneNumberService method goes here. } Real-Certify.com The Only Way to get Certified Quickly. - 112 - catch (Exception ex) { // Handle the exception. }

You create an XML Web service named PostalCode. Your project source includes a code-behind file and a file named PostalCode.asmx.

During implementation, you use the Debug class to record debugging log messages, to verify values, and to report debugging failures. You want to deploy PostalCode to a production computer. You do not want any of the debugging code to execute on the production computer.

What should you do?   Set the project’s active configuration to Release and rebuild the DLL.

You create an XML Web service named PostalCode. Your project source includes a code-behind file and a file named PostalCode.asmx.

During implementation, you use the Debug class to record debugging log messages, to verify values, and to report debugging failures. You want to deploy PostalCode to a production computer. You do not want any of the debugging code to execute on the production computer.

What should you do?   Modify the compilation element of the Web.config file by setting the debug attribute to “false”.

You create an XML Web service named ReportService for an application on your intranet. You configure Internet Information Services (IIS) and ReportService to use Integrated Windows authentication. You configure the Access Control List (ACL) for ReportService to allow access to only members of a Windows group named FieldAgents. You test and confirm that only members of the FieldAgents group can use ReportService.

ReportService includes a method named SubmitSurveillance that calls a serviced component named ReportData. ReportData uses COM+ role-bases security to restrict component access to members of the COM+ Agents role. The COM+ Agents role is configured to include the FieldAgents group.

You call SubmitSurveillance. However, when the call to ReportData is attempted, an exception is thrown indicating that access is denied. You need to correct this problem.

What should you do?   In the <system.web> section of the Web.config file, add the following line of code: <identity impersonate=”true”/>

You create an XML Web service named Service. This service exposes a Web method named MyMethod. You need to register Service in UDDI. First, you add a new business name and a new tModel. You now need to list a valid access point to Service.

Which URL should you use?   http://Srv/AppPath/myService.asmx

You create an XML Web service named TimeService. Each time TimeService is started, it checks for the existence of an event log named TimeServiceLog. If TimeServiceLog does not exist, TimeService creates it.

You discover that when TimeService creates TimeServiceLog, it throws a System.Security.SecurityException. The exception includes the following message: “Requested registry access is not allowed”. You need to resolve this problem.

What should you do?   Configure Inetinfo.exe to run as the local administrator user account.

You create an XML Web service named TimeService. Each time TimeService is started, it checks for the existence of an event log named TimeServiceLog. If TimeServiceLog does not exist, TimeService creates it.

You discover that when TimeService creates TimeServiceLog, it throws a System.Security.SecurityException. The exception includes the following message: “Requested registry access is not allowed”. You need to resolve this problem.

What should you do?   Create an installer for TimeService, and create the new event log in the installer code.

You create an XML Web service named WeatherService. This service contains a Web method named RetrieveWeather. RetrieveWeather takes as input a city named and returns the current weather conditions for that city.

You need to provide callers of this service with the URL they need to issue an HTTPGET against WeatherService.

Which URL should you use?   http://Srv/AppPath/WeatherService.asmx/RetrieveWeather?cityname=somecity

You create an XML Web service project that consists of three services named BronzeService, SilverService, and GoldService. All three services are located in the same virtual directory on a production computer. When customers subscribe to your service, they select only one of the three available services.

A new customer subscribes to SilverService. You need to create a discovery document that enables this customer to use only SilverService.

Which discovery document should you create?   <disco:discovery xmlns:disco=”http://schemas.xmlsoap.org/disco/” xmlns:scl=http://schemas.xmlsoap.org/disco/scl/> <scl:contractRef ref=”SilverService.asmx?wsdl” /> </disco:discovery>

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://Prodution/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)   Modify the trace element in the Web.config file of the service by setting the enabled attribute to “true”.

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://Prodution/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)   View the page at http://Production/WS/Trace.axd.

You create an XML Web service that provides stock information to the customers of Fulton Inc. You successfully test the service. You are now ready to deploy the service to a new virtual directory on a production computer.

You want to deploy the service without having to manually configure any settings on the production computer.

Which deployment mechanism should you use?   Web setup project

You create an XML web service that retrieves data from Microsoft SQL Server database. You instantiate a SqlConnection object named Connection and set the Max Pool Size property of the connectionString to 50.

All 50 connections are now in use. However, a request for connection number 51 is received.

What is the most likely result?   The request is queued until a connection becomes available or until the timeout limit is reached.

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 “Switch”. 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?   To the Web.config file, add the following code segment: <system.diagnostics> <switches> <add name=”Switch” value=”1” /> </switches> </system.diagnostics>

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 “Switch”. 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?   To the Web.config file, add the following code segment: <system.diagnostics> <switches> <add name=”TraceSwitch” value=”1” /> </switches> </system.diagnostics>

You create three Windows services named 1, 2, and 3. You want to install all three services on a computer named A by using the Installer tool(Installutil.exe).

On the command line of A, you enter and run the following command: Installutil 1 2 3

During the installation process, 3 throws an installation error. The installation process completes.

How many of the three services are now installed on A?   None

You create two serviced components named OrderPipeline and OrderAdmin. Each component is registered in a separate COM+ server application.

Both components use pricing data. OrderPipeline reads the pricing data for placing user orders. OrderAdmin modifies the pricing data.

You want to ensure that OrderPipeline accesses the pricing data as quickly as possible, while still being able to immediately retrieve any pricing changes made by OrderAdmin.

What should you do?   Store the pricing data in a Hashtable object within OrderAdmin. Expose the Hashtable object through a property on OrderAdmin.

You create version 1.0.0.0 of an assembly named Assembly. You register theassembly in the global assembly cache. Assembly consists of two .NET Remoting objects named RemoteObject1 and RempoteObject2 These objects are configured in the App.config file of Assembly as shown in the following code segment:

<system.runtime.remoting> <application> <service> <activated type=”Assembly.RemoteObject1, Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=28dckd83491duj” /> <wellKnown mode=”SingleCall” objectUri=”RemoteObject2.rem” type=”Assembly.RemoteObject2, Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=28dckd83491duj” /> <channels> <channel ref=”http” /> </channels> </service> </application> </system.runtime.remoting>

You create an application named App that resides on a different computer than Assembly. App references version 1.0.0.0 of Assembly. App contains code that activates instances of RemoteObject1 and RemoteObject2 to use their services.

Due to changes in business needs, you must update Assembly. You create version 2.0.0.0 of Assembly, which is backward compatible, but you do not update any information in the App.config file of Assembly. You register version 2.0.0.0 of Assembly in the global assembly cache. You then rebuild App.

Which version of the remote object will MyApp activate?   Version 1.0.0.0 of RemoteObject1; version 1.0.0.0 of RemoteObject2.

You create version 1.0.0.0 of an assembly named Assembly. You register theassembly in the global assembly cache. Assembly consists of two .NET Remoting objects named RemoteObject1 and RempoteObject2 These objects are configured in the App.config file of Assembly as shown in the following code segment:

<system.runtime.remoting> <application> <service> <activated type=”Assembly.RemoteObject1, Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=28dckd83491duj” /> <wellKnown mode=”SingleCall” objectUri=”RemoteObject2.rem” type=”Assembly.RemoteObject2, Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=28dckd83491duj” /> <channels> <channel ref=”http” /> </channels> </service> </application> </system.runtime.remoting>

You create an application named App that resides on a different computer than Assembly. App references version 1.0.0.0 of Assembly. App contains code that activates instances of RemoteObject1 and RemoteObject2 to use their services.

Due to changes in business needs, you must update Assembly. You create version 2.0.0.0 of Assembly, which is backward compatible, but you do not update any information in the App.config file of Assembly. You register version 2.0.0.0 of Assembly in the global assembly cache. You then rebuild App.

Which version of the remote object will MyApp activate?   Version 1.0.0.0 of RemoteObject1; version 2.0.0.0 of RemoteObject2.

You develop a Windows-based application named WinApp that contains a Windows From named Form1. To WinApp, you add a Web reference to an XML Web service named Service1.

Service1 exposes two Web methods named Authenticate and RetrieveData. Both methods have sessions enabled. Authenticate authenticates a caller. If the caller is authenticated, Authenticate generates q unique key, stores that key by using the Session object, and returns that key.

RetrieveData expects a valid key that has been generated by Authenticate as inout before it will return data. If the key matches the key in the current session, RetrieveData will return data to the customer.

You write the following code segment in the Load event handler of Form1. (Line numbers are included for reference only) 01 localhost.Service1 service1 = new localhost.Service1(); 02 string key = “”; 03 DataSet userData; 04 // Insert new code. 05 key = service1.Authenticate(myUser, myPassword); 06 userData = service1.RetrieveData(key); 07 dataGrid1.DataSource = userData;

You run the application. When line 06 executes the Web service throws an exception, which indicates that the key is invalid. To ensure that the application runs without exceptions, you must insert additional code on line 04.

Which code segment should you use?   service1.PreAuthenticate = true;

You develop a Windows-based application named WinApp that contains a Windows From named Form1. To WinApp, you add a Web reference to an XML Web service named Service1.

Service1 exposes two Web methods named Authenticate and RetrieveData. Both methods have sessions enabled. Authenticate authenticates a caller. If the caller is authenticated, Authenticate generates q unique key, stores that key by using the Session object, and returns that key.

RetrieveData expects a valid key that has been generated by Authenticate as inout before it will return data. If the key matches the key in the current session, RetrieveData will return data to the customer.

You write the following code segment in the Load event handler of Form1. (Line numbers are included for reference only) 01 localhost.Service1 service1 = new localhost.Service1(); 02 string key = “”; 03 DataSet userData; 04 // Insert new code. 05 key = service1.Authenticate(myUser, myPassword); 06 userData = service1.RetrieveData(key); 07 dataGrid1.DataSource = userData;

You run the application. When line 06 executes the Web service throws an exception, which indicates that the key is invalid. To ensure that the application runs without exceptions, you must insert additional code on line 04.

Which code segment should you use?   service1.InitializeLifetimeService();

You develop a Windows-based application named WinApp that contains a Windows From named Form1. To WinApp, you add a Web reference to an XML Web service named Service1.

Service1 exposes two Web methods named Authenticate and RetrieveData. Both methods have sessions enabled. Authenticate authenticates a caller. If the caller is authenticated, Authenticate generates q unique key, stores that key by using the Session object, and returns that key.

RetrieveData expects a valid key that has been generated by Authenticate as inout before it will return data. If the key matches the key in the current session, RetrieveData will return data to the customer.

You write the following code segment in the Load event handler of Form1. (Line numbers are included for reference only) 01 localhost.Service1 service1 = new localhost.Service1(); 02 string key = “”; 03 DataSet userData; 04 // Insert new code. 05 key = service1.Authenticate(myUser, myPassword); 06 userData = service1.RetrieveData(key); 07 dataGrid1.DataSource = userData;

You run the application. When line 06 executes the Web service throws an exception, which indicates that the key is invalid. To ensure that the application runs without exceptions, you must insert additional code on line 04.

Which code segment should you use?   service1.CookieContainer = new System.Net.CookieContainer();

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=Server;” + “Initial Catalog=Billing;Integrated Security=true”; myConnection1.Open(); SqlConnection myConnection2 = new SqlConnection(); myConnection2.ConnectionString = “Data Source=Server;” + “Initial Catalog=Billing;Integrated Security=True”; myConnection2.Open(); SqlConnection myConnection3 = new SqlConnection(); myConnection3.ConnectionString= “Data Source=ServerB;” + “Initial Catalog=Search;Integrated Security=true”; myConnection3.Open(); SqlConnection myConnection4 = new SqlConnection(); myConnection4.ConnectionString = “Data Source=Server;” + “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?   Three

You develop an application named App that uses a Windows Form, a Microsoft SQL Server database, and several database components. You want to restrict users from writing their own applications to access App’s database components.

You need to configure your database component assemblies to accomplish this goal.

What should you do?   Apply the StrongNameIdentityPermission attribute, and specify SecurityAction.RequestMinimum. Set the PublicKey property to the public key of the key file you use to sign your application’s assemblies.

You develop an application named App. This application needs to run on the same computer as a Windows service named Service.

You want to ensure that Service starts from App if Service is not already running.

Which code segment should you use?   ServiceController ServiceController = new ServiceController(“Service”); if (ServiceController.Status == ServiceControllerStatus.Stopped) { ServiceController.Start(); }

You develop an ASP.NET application that consumes a third-party XML Web service named CreditService. CreditService contains a Web method named ChargeCard. ChargeCard takes as input a credit card number, a billing address, and a monetary amount and returns a Boolean variable that indicates whether or not the card was charged.

Calls to ChargeCard take one minute to complete. You do not want users to have to wait while ChargeCard executes. You want users to be taken automatically to the next Web page of the application.

Which code segment should you use to call CreditService?   CreditService.BeginChargeCard(ccNumb, billAddress, amount, new AsyncCallback(CCResponse), null); Server.Transfer(“process.aspx”); private void CCResponse(IAsyncResult aRes) { CreditService.EndChargeCard(aRes); }

You have a .NET Remoting object named BatchOrder. The BatchOrder class allows remote client applications to submit orders in batches. Each BatchOrder object holds state information that is specific to each remote client application. The BatchOrder class has overloaded constructors for initializing an object.

You want to develop a server application to host BatchOrder objects.

What should you do?   Create a Windows service, and register BatchOrder as a client-activated object.

You have a .NET Remoting object named ProductLoader. The ProductLoader class is a server-activated Singleton object. The ProductLoader class loads product data into a Microsoft SQL Server database. The Load method of the ProductLoader class is a time-consuming method to call. You are developing a client application that uses the ProductLoader class. You want to ensure that the client application can continue to respond to user input while the Load method of the ProductLoader class is called.

What should you do?   Use an AsyncDelegate instance to call the Load method.

You have a .NET Remoting object named Promotions. The Promotions class allows remote client applications to add new product promotions to an online catalog application. The Promotions class is an assembly file named fullrun.dll.

You have an Internet Information Services (IIS) virtual directory named PromotionsObject. The fullrun.dll file is in the PromotionsObject\bin directory. You want to host the Promotions class in IIS.

What should you do?   Create a Web.config file that includes the following code segment: <configuration> <system.runtime.remoting> <application> <service> <wellknown> mode=”SingleCall” objectUri=”Promotions.rem” type=”Promotions,”/> </service> <channels> <channel ref=”http”/> </channels> </application> </system.runtime.remoting> </configuration>

You have a .NET Remoting object named Scheduler. The Scheduler class is in an assembly file named TaskScheduler.dll. The Scheduler class is hosted by an application named SchedulerServer.exe. This application is configured by using a file named SchedulerServer.exe config. This file configures the Scheduler class to be a clientactivated object by using a TcpChannel and a BinaryFormatter.

You want to deploy the Scheduler object to a computer named Fulton1 so that client applications can begin to use it.

You copy TaskScheduler.dll, SchedulerServer.exe, and SchedulerServer.exe.config to a directory on Fulton1.

What should you do next?   Configure Fulton1 to execute SchedulerServer.exe each time Fulton1 is restarted. Then manually execute SchedulerServer.exe on Fulton1.

You have a .NET Remoting object named Utils. The Utils class is a client-activated .NET Remoting object.

You want to write a client application that creates and uses a Utils object. You want the client application to hold onto a reference to a Utils object for the duration of its execution.

What should you do?   In the client application, create an Implementation of the ISponsor interface. Implement the Renewal method to extend the lease.

You have a DataSet object named customersDataSet that contains a DataTable object named Customers. Customers retrieves information from a Microsoft SQL Server database. Customers contains a column named Region.

You want to create a DataView object named customersDataView that contains only customers in which the value in the Region column is France.

Which code segment should you use?   DataView customersDataView = new DataView(customersDataSet.Tables[“Customers”]); customersDataView.RowFilter= (“Region = ‘France’”);

You have a DataSet object named DataSet 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 DataSet 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?   SqlDataAdapter mySqlDataAdapter = new sqlDataAdapter();

You have a DataSet object named DataSet. This object contains two DataTable objects named Customers and Orders. Customers has a column named CustomerID, which is unique to each customer. Orders also has a column named CustomerID. You want to use the GetChildRows method of the DataRow object to get all orders for the current customers.

What should you do?   Add a data relation to DataSet on OrderID between Customers and Orders.

You have a DataSet object named loanCustomersDataSet that contains customers serviced by the loan department of Fulton Inc. 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?   loanCustomersDataSet.Merge(assetCustomersDataSet, true);

You have a DataSet object named ordersDataSet. This object contains two DataTable objects named Orders and OrderDetails. Both Orders and OrderDetails contain a column named OrderID.

You create a DataRelation object named orderRelation between Orders and OrderDetails on OrderID. Order is the parent table. OrderDetails is the child table.

You add orderRelation to the ordersDataSet relation collection by using the following line of code:

ordersDataSet.Relations.Add(orderRelation;

You verify that prior to adding orderRelation, there were no constraints on either table.

You then run the line of code.

How many constraints does each table have now?   None on Orders; none on OrderDetails.

You have a DataSet object named ordersDataSet. This object contains two DataTable objects named Orders and OrderDetails. Both Orders and OrderDetails contain a column named OrderID.

You create a DataRelation object named orderRelation between Orders and OrderDetails on OrderID. Order is the parent table. OrderDetails is the child table.

You add orderRelation to the ordersDataSet relation collection by using the following line of code:

ordersDataSet.Relations.Add(orderRelation;

You verify that prior to adding orderRelation, there were no constraints on either table.

You then run the line of code.

How many constraints does each table have now?   One on Orders; one on OrderDetails.

You have a DataSet object that contains a single DataTable object named Employees. Employees has a column named EmployeeID. EmployeeID contains no duplicate data.

You are creating a function that accepts a parameter of EmployeeID and searches Employees to return the DataRow object for the specified EmployeeID.

You want to use the Find method of the rows collection in Employees to return the requested DataRow object from the function. You need to ensure that you can use the Find method to accomplish this goal.

What should you do?   Ensure that Employees has a primary key on EmployeeID.

You have a SqlDataReader object named ordersDataReader. This object contains a column named OrderQuantity that has an integer value. This object also contains one row for each order received during the previous week. You need to write code that will process each row in ordersDataReader and pass OrderQuantity to a function named myFunction.

Which code segment should you use?   long weeklyOrderQuantity = 0; while (ordersDataReader.Read()) { myFunction((int)ordersDataReader[“OrderQuantity”]); }

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?   myProductID = (int) productsDataReader[0]; myProductName = (string) productsDataReader[1]; myUnits = (int) productsDataReader[2];

You have a strongly typed DataSet object named DataSet. This object contains three DataTable objects named Customers, Orders and OrderDetails.

Customers and Orders have a data column named CustomerID. Orders and OrderDetails have a data column named OrderID. Orders have a foreign key constraint between Customers and Orders on CustomerID.

OrderDetails has a foreign key constraint between Orders and OrderDetails on OrderID.

You want to populate Customers, Orders and OrderDetails with data from Microsoft SQL Server database.

In which order should you fill the Data table objects?   Customers Orders OrderDetails

You have an application named MyApp that contains a reference to version 1.0.0.0 of a strongly named serviced component named Component. This component is located in the bin directory of MyApp.

You receive version 2.0.0.0 of Component, which you install in the global assembly cache. You reconfigure the application configuration file to redirect calls to version 2.0.0.0.

You now receive version 3.0.0.0 of Component, which you install in the global assembly cache. You do not reconfigure the application configuration file. You then run MyApp.

Which version of Component is loaded and from which location is it loaded?   Version 2.0.0.0 from the global assembly cache.

You have an ASP.NET application named WebApp. This application uses a private assembly named Employee to store and retrieve employee data. Employee is located in the bin directory of WebApp.

You develop a new ASP.NET application named WebApp2 that also needs to use Employee. You assign Employee a strong name, set its version to 1.0.0.0, and install it in the global assembly cache. You then create a publisher policy assembly for version 1.0.0.0 and install it in the global assembly cache.

You compile WebApp2 against version 1.0.0.0. You do not recompile MyWebApp. You then run WebApp.

What is the most likely result?   Employee is loaded from the bin directory.

You have an ASP.NET application named WebApp. This application uses a private assembly named Employee to store and retrieve employee data. Employee is located in the bin directory of WebApp.

You develop a new ASP.NET application named WebApp2 that also needs to use Employee. You assign Employee a strong name, set its version to 1.0.0.0, and install it in the global assembly cache. You then create a publisher policy assembly for version 1.0.0.0 and install it in the global assembly cache.

You compile WebApp2 against version 1.0.0.0. You do not recompile MyWebApp. You then run WebApp.

What is the most likely result?   Version 1.0.0.0 of Employee is loaded by the publisher policy assembly.

You have DataSet object named LoanCustomersDataSet that contains customers serviced by the loan department of your company. You receive a second DataSet 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 loanCustomerDataSet.

Which code segment should you use?   loanCustomersDataSet.Merge (assetCustomersDataSet, True);

Your company frequently receives product information from external vendors in the form of XML data. You receive XML document files, an .xdr schema file, and an .xsd schema file.

You need to write code that will create a typed DataSet object on the basis of product information. Your code will be used in several Visual studio .NET applications to speed up data processing.

You need to create this code as quickly as possible.

What should you do?   Use the Xml Schema Definition tool (Xsd.exe) to generate the code.

Your Microsoft SQL Server 6.5 database contains a table named PurchaseOrders that consists of more than 1 million rows. You are developing an application to populate a DataReader object with data from PurchaseOrders. You want to ensure that the application processes the data as quickly as possible.

You create a SQL SELECT statement in a local variable named SQLSelect. You need to instantiate a SqlConnection object and a SqlCommand object that you will use to populate the DataReader object.

Which code segment should you use?   OleDbConnection Connection = new OleDbConnection (OleDbConnectionString); OleDbCommand Command = new OleDbCommand (SQLSelect, Connection);

Your Microsoft SQL Server database BackOrders contains a table that consists of more than 1 million rows. You need to develop an application that reads each row in the table and writes the data to a flat file. The application will run only once each day. You want the application to process the data as quickly as possible.

Which class should you use to retrieve the data?   DataReader

Your Microsoft SQL Server database contains a table named Customers. Customers contains three columns named FamilyName, PersonalName, and Address.

You instantiate a SqlCommand object named Command that you will use to populate a DataReader object named customersDataReader. You need to initialize Command to load customersDataReader to include FamilyName and PersonalName for all rows in Customers.

Which code segment should you use?   Command.CommandText = “SELECT FamilyName,“ + “PersonalName FROM Customers”;

Your Microsoft SQL Server database contains a table named Orders. Due to a recent increase in product sales, Orders now contains more than 500,000 rows. You need to develop an application to produce a report of all orders in the table.

You need to ensure that the application processes the data as quickly as possible.

Which code segment should you use?   SqlConnection myConnection = new SqlConnection (“Data Source=(local);Initial Catalog=;” + “Integrated Security=true”); SqlCommand myCommand = new SqlCommand (“SELECT * FROM Orders”; myConnection); SqlDataReader ordersDataReader; myConnection.Open(); ordersDataReader = myCommand.ExecuteReader();

Your Microsoft SQL Server database contains a table named Orders. Orders is used to store new purchase orders as they are entered into an orderentry application. To keep up with customer demand, the order fulfillment department wants to know at 15-minute intervals when new orders are entered.

You need to develop an application that reads Orders every 15 minutes and sends all new orders to the order fulfillment department. The application will run on computer that is used by several users who continuously log on and log off from the network to perform miscellaneous tasks.

Which type of .NET application should you use?   Windows service

Your Microsoft SQL Server database has a stored procedure named GetCompanyName. Ge accepts one parameter named @CustomerID and returns the appropriate company name.

You instantiate a SqlCommand object named Command. You need to initialize Command to return the company name for @CustomerID with a value of “ALFKI”.

Which code segment should you use?   Command.CommandText = “GetCompanyName”; Command.Parameters.Add(“@CustomerID”, “ALFKI”);

Your Microsoft SQL Server database has a stored procedure that sums the total number of orders received each day. The stored procedure returns a result that is a single data value of type integer.

You need to write code that will execute the stored procedure and return the result as an integer value.

You instantiate a SqlCommand object named myCommand and initialize all appropriate parameters.

Which myCommand method should you use?   ExecuteScalar