>Concorsi
>Forum
>Bandi/G.U.
 
 
 
 
  Login |  Registrati 
Elenco in ordine alfabetico delle domande di 70-315: Developing and implementing Web applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET

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 allow users to edit Customer information on a DataGrid control bound to a DataSet object. When the user clicks the Update button on the form, you call the SqlDataAdapter.Update() method to persist the changes from the DataSet object to the underlying database.

Users report that updated records are saved properly and deleted records are removed, but that new records are missing the next time they run the application. What could be the problem?   The InsertCommand property of the SqlDataAdapter points to a SqlCommand object that does not properly add rows.

You are attempting to debug an ASP.NET application located on your company's production server. The server has the remote debugging components installed, and your local workstation has a full install of Visual Studio .NET. When you attempt to connect to the server process, you receive a DCOM error. What could be the problem?   You are not a member of the Debugger Users group on the server.
You are building a custom control for your company's ASP.NET Web applications. The control will contain the company's privacy policy and copyright notices in a standard set of labels. This control should be shared by multiple applications. Which type of control should you create?   Composite Web custom control
You are converting an existing ASP application to an ASP.NET application. The ASP application uses ADO extensively for data access. You do not yet want to convert the ADO code to ADO.NET code. What should you do to ensure that the ADO objects continue to function properly on the ASP.NET pages?   Use a Page directive to set ASP compatibility mode on the ASP.NET pages.
You are converting an existing HTML and JScript-based application to use ASP.NET Web forms instead. Which of these activities is not a good candidate for code in a code-behind file?   Tracking mouse movement over an image and displaying updated text in the browser status bar depending on the mouse location
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 ContextBoundObject.

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 ASP.NET application named MyDir. It has been developed using English resources with file string.resources and place in MyDir\MyApp.dll. The same application need to be enabled for japanese customers and a japanese resources is added to the directory MyDir\ja.

What is the step required to enable the japanese resources in the application?   Use Al.exe to embed the japanese resources and place the output file in MyDir/ja

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 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 Inherits ServicedComponent Public Sub AddUser ( ByVal name As String, _ ByVal password As String) ¡® Code to add the user to data sources goes here. End Sub End Class

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 specialized control that will display text rotated at an angle specified at design time. This control must be installed into the Visual Studio .NET toolbox so that it can be used in many projects. The control's user interface will resemble that of a Label control, with one additional property named RotationAngle. What sort of control should you create?   Web custom control that inherits from the Label control
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 ASP.NET Web application that displays a table representing your company's financial performance over the past eight quarters. The information is grouped into columns and subcolumns. Which attribute can you use in the <th> tags for the table so that it will be clear to screen readers which data cells the headers are associated with?   scope
You are creating an XML Web service named Accountinformation for a community bank. Accountinformation exposes 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 customs 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 Inherits SoapHeader Public username As String Public Password As String End Class ¡® In the accountInformation class add this code: Public authenticateUserHeader As AuthenticateUser < WebMethod(), SoapHeader(¡° authenticateUserHeader¡±)> _ Public Function GetAccountBalance() As String If ( authenticateUserHeader Is ¡°¡±) Then Return ¡° Please supply Credentials.¡± Else ¡® Code to authenticate the user and return ¡® the account balance goes here. End If End Function

You are creating an XML Web service named Accountinformation for a community bank. Accountinformation exposes 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 customs 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 Public username As String Public Password As String End Class ¡® In the accountInformation class add this code: Public authenticateUserHeader As AuthenticateUser < WebMethod() > _ Public Function GetAccountBalnce() As String If ( authenticateUserHeader Is ¡°¡±) Then Return ¡° Please supply Credentials.¡± Else ¡® Code to authenticate the user and return ¡® the account balance goes here. End If End Function

You are creating an XML Web service named InventoryService for a national automobile dealership. Each branch of the dealership 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 customers 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 named Regions 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 myWebService. This service will be used to exchange highly confidential information over the Internet with your company¡¯s business partner named , Inc.

You want only callers from , 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 Associate and Manager. 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 SalesInformation. This service provided sales information to regional managers and directors by using a virtual private network ( VPN). SalesInformation exposes a Web method named GetSalesInfo that returns sales information to the caller. You must use role- based security to restrict access to GetSalesInfo to only members if the two Windows groups named Manager and Director. You configure SalesInformation to use Integrated Windows authentication.

You write the following code to create permissions in GetSalesInfo: Dim myPermission1 As New_ PrincipalPermission( Nothing, ¡° Manager¡±) Dim myPermission2 As New_ PrincipalPermission( Nothing, ¡° Director¡±)

You need to write the remaining code in GetSalesInfo to ensure that only users in the Manager group and the Director group can access SalesInformation.

Which code segment should you use?   myPermission1. Union( myPermission2). Demand()

You are creating an XML Web service named Service. This service has a function named WriteMessage that writes messages to a flat file in the C:ServiceLog directory. You want to implement security for WriteMessage so that WriteMessage and all the code it calls can write messages only to the ServiceLog directory.

Which code segment should you use?   Dim filePermission As New FileIOPermission_( FileIOPermissionAccess. Write, ¡° C:ServiceLog¡±) filePermission. PermitOnly()

You are creating an XML Web service named ShoppingCartService. All requests made to web methods of ShoopingCartservice require that callers present a valid key input. This key indicates that the user has been authenticated to make ShoppingCartService requests.

To obtain a valid key, the callers must first call GetKey.

You write the following code segment. ( Line numbers are include for reference only)

01 < WebMethod ( ) > _ 02 Public Function GetKey ( ByVal caller As String) As String 03 Dim Key As String 04 If Not Context. Session (¡° key¡±) Is Nothing 05 key = Context. Session (¡° key¡±) 06 Return key 07 Else 08 Dim isAuthenticated As Boolean 09 ¡® Code to validate the caller goes here. 10 If isAuthenticated Then 11 ¡® Code to generate ¡° key¡± goes here. 12 Context. Session (¡° Key¡±) = key 13 Return key 14 Else 15 Throw New Exception (¡° User not authenticated¡±) 16 End If 17 End If 18 End Function

You run the code and an exception is thrown on line 04. You want this code to run without exceptions.

What should you do?   On line 01, set the EnableSession property of the WebMethod Attribute to true.

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 generates a SOAP message. Parameter information in the SOAP message must be encrypted.

You write the appropriate code to modify the SOAP message. You also write a method named Encrypt. This method takes a string an argument, encrypts the string, and returns a new string that contains the encrypted string.

Before encryption , the Body element of the SOAP message will be written in the following format.

< soap: Body> < returnToSender xlmns = http:// . com/> < aString> some date</ aString> </ returnToSender> </ soap: Body>

After encryption, the Body element must be written in the following format.

< soap: Body> < returnToSender xmlns = ¡° http:// . com/¡±> 154 37 146 194 17 92 32 139 28 42 184 202 164 18 </ returnToSender> </ soap: Body>

You write code to isolate the < returnToSender> XML node in an XmlNode object named theNode. You now need to write code to encrypt the parameter information.

Which code segment should you use?   Dim encrypted as String = Encrypt( theNode. InnerXml) theNode. InnerXml = encrypted

You are creating an XML Web service that generates a SOAP message. Parameter information in the SOAP message must be encrypted.

You write the appropriate code to modify the SOAP message. You also write a method named Encrypt. This method takes a string an argument, encrypts the string, and returns a new string that contains the encrypted string.

Before encryption , the Body element of the SOAP message will be written in the following format.

< soap: Body> < returnToSender xlmns = http:// . com/> < aString> some date</ aString> </ returnToSender> </ soap: Body>

After encryption, the Body element must be written in the following format.

< soap: Body> < returnToSender xmlns = ¡° http:// . com/¡±> 154 37 146 194 17 92 32 139 28 42 184 202 164 18 </ returnToSender> </ soap: Body>

You write code to isolate the < returnToSender> XML node in an XmlNode object named theNode. You now need to write code to encrypt the parameter information.

Which code segment should you use?   Dim encrypted as String = Encrypt( theNode. InnerText) theNode. InnerText = encrypted

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?   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 Data. 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 Data to a stream and use the CryptoStream object to write the value of Data to an encrypted stream. Convert the output stream to a string.

You are debugging a visual studio . Net application named App. The application 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 an ASP.NET application. You want to write the value of a particular variable to a disk file whenever a page is loaded. You only want to record this information during debugging, not after the application has been released. Which object should you use?   System.Diagnostics.Debug
You are debugging your ASP.NET Web application and are concerned about the amount of time that it's taking to render a particular page. Which class can you use to obtain detailed timing information for the events on the page as it is rendered by the ASP.NET engine?   System.Web.TraceContext
You are deploying an ASP.NET application to multiple customer sites. You are not positive that all the bugs have been found in the application, and want to be able to retrieve debugging information from the deployed applications if necessary. You don't want the debugging information to impose any overhead when it's not needed. What should you do?   Include calls to the Trace object in the application. Use a TraceSwitch object to control the output of the Trace object. When you need to debug the application, edit the config file to activate the TraceSwitch object.
You are deploying your ASP.NET application to a single Web server. However, you're preparing to move to a Web farm should traffic justify the additional hardware investment. What should you do to make sure that your application is ready to move to a Web farm if need be?   Use either the State Service or SQL Server to store session state.
You are designing a new control for use in ASP.NET applications. The new control will be used to load an image from a disk file to an Image control at runtime. The control will not need a runtime user interface, but it must allow you to select a filename in the Properties window at design time. Which type of control should you create?   Web custom control that inherits directly from WebControl control
You are designing a Web form that will use a Repeater control to display information from several columns of the Employees table in your database. You want to display the column names at the top of the control. Which template should include Label controls with the column names?   HeaderTemplate
You are designing the user assistance for an ASP.NET application that will be available over the Internet. You have no control over the browsers that users will implement to view your application. Which form of user assistance can you use with this application?   User assistance displayed as separate Web pages
You are developing a order- processing application that retrieves data from a Microsoft SQL Server database 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 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 version of your ASP.NET application that will be shipped to a locale that uses right-to-left text ordering. What property should you set for controls on your Web forms to ensure that they fill in the proper direction?   Set the dir attribute to "rtl" in the HTML tag.
You are developing a Web form that will be used as part of an online banking application. You have placed a set of RadioButton controls on the form to represent account types. Only one account type should be selected at a time. When you test the Web form, you discover that you can select multiple account types at the same time, and you cannot deselect an account type after selecting it. How can you fix this problem (select two)?   Assign an identical GroupName property value to each of the RadioButton controls.
You are developing a Web form that will be used as part of an online banking application. You have placed a set of RadioButton controls on the form to represent account types. Only one account type should be selected at a time. When you test the Web form, you discover that you can select multiple account types at the same time, and you cannot deselect an account type after selecting it. How can you fix this problem (select two)?   Replace the RadioButton controls with a RadioButtonList control.
You are developing a Windows- based application that requires the use of a calculation function named CalculateValue. This function includes the following signature:

Calculate Value( x As Integer) As Integer 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: Declare Function CalculateValue_ Lib ¡° Functions. dll¡± ( x As Integer)

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 table named Products in a Microsoft SQL Server database. The query will be stored in a string variable named Query. 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 Command Text to Query. Use the ExecuteXmlReader method of the SqlCommand object to create a XmlReader object. Use the XmlReader object to read the data.

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 application to take orders over the Internet. When the user posts back the order form, you first check to see whether he is a registered customer of your company. If not, you must transfer control to the Register.html page. Which method should you use to effect this transfer?   Response.Redirect()
You are developing an ASP. NET application that consumes an XML Web service named AccountInformation. AccountInformation exposes a Web method named GetAccountBalance that expects 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 variable 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?   Dim AccountInformation As New AccountInformation() Dim AuthenticateUser As New AuthenticateUser() AuthenticateUser. Username = encryptedUsername AuthenticateUser. Password = encryptedPassword AccountInformation. AuthenticateUserValue = _ myAuthenticateUser Dim accountBalance As String accountBalance = myAccountInformation. GetAccountBalance()

You are developing an ASP. NET application that consumes an XML Web service named AccountInformation. AccountInformation exposes a Web method named GetAccountBalance that expects 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 variable 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?   Dim AccountInformation As New AccountInformation() Dim AuthenticateUser As New AuthenticateUser() AuthenticateUser. Username = encryptedUsername AuthenticateUser. Password = encryptedPassword Dim SoapHeaderCollection As New SoapHeaderCollection() SoapHeaderCollection. Add( myAuthenticateUser) Dim accountBalance As String accountBalance = AccountInformation. GetAccountBalance()

You are developing an ASP.NET application that can display its user interface in English, French, German, or Japanese. What strategy should you use to select the language to display?   Allow the user to select a language by choosing a hyperlink or a selection in a drop-down list.
You are developing an ASP.NET application that will display the strings on its user interface in any of five different languages, depending on the setting of the CurrentThread.CurrentUICulture property. Where should you store the localized strings so that they can most easily be displayed?   In assembly resource files
You are implementing server-to-server FTP functionality for use in your ASP.NET applications. You've decided to implement this functionality as a .NET component that inherits directly from the base Component class. How can you create a Transfer() method in your component's code?   Implement a public method named Transfer().
You are in the process of upgrading an existing ASP application to ASP.NET by converting pages one by one to the new architecture. The application currently uses an ASP.NET page to request the user's first name, which is stored in a session variable with this line of code:

Session["FirstName"] = txtFirstName.Text;

You run the application and enter a first name on the ASP.NET page. When you browse to an existing ASP page that uses the FirstName session variable, the first name is blank. What could be the problem?   The ASP and ASP.NET engines do not share session state or application state.

You are invoking a Web service that returns a StringBuilder object. Which project requires a reference to the System.Text namespace?   Both the client project and the Web service project
You are planning to create a DataSet object named DataSet to be used in a bond- trading application. Several developers will need to write code to manipulate DataSet, and you want to ensure that myDataSet 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 an XML Web service named InventoryService. This service queries a Microsoft SQL Server database and return information to the caller. You are Visual Studio . Net to create a setup project. You need to install InventorySystem. 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 using the command-line Installer tool to install three assemblies, with this command line:

InstallUtil Assembly1.dll Assembly2.dll Assembly3.dll

A problem occurs with the installation of Assembly2.dll, and that assembly cannot be installed. Which assembly or assemblies will be installed on the target machine?   No assemblies will be installed.

You are using Visual Studio . NET to develop a new application to replace an older COM- based application named Legacy. 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 OurCOM. dll. The Visual Studio . NET assembly for OurCOM. 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 a new application to replace an older COM- based application named Legacy. 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 OurCOM. dll. The Visual Studio . NET assembly for OurCOM. 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 / out option to create the assembly. Change the namespace by using the Namespace property of a CodeNamespaceImport object.

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. 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 = Nothing Numbers = Nothing 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?   Declare Function Parse Lib ¡° Functions. dll¡± _ ( ByVal input As String, ByRef Words() As String, ByRef numbers() As Integer) As Integer

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 includes the following code segment: < ComVisible( False)> Public Class Class Public Sub New() ¡® Implementation code goes here. End Sub < ComVisible( True)>_ Public Function Method( param As String) As Integer Return 0 End Function < ComVisible( True)>_ Protected Function OtherMethod() As Boolean Return True End Function < ComVisible( True)>_ Public ReadOnly Property Property() As Integer Get Return 0 End get End Property ¡® More implementation code goes here. End Class

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

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

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 includes the following code segment: < ComVisible( False)> Public Class Class Public Sub New() ¡® Implementation code goes here. End Sub < ComVisible( True)>_ Public Function Method( param As String) As Integer Return 0 End Function < ComVisible( True)>_ Protected Function OtherMethod() As Boolean Return True End Function < ComVisible( True)>_ Public ReadOnly Property Property() As Integer Get Return 0 End get End Property ¡® More implementation code goes here. End Class

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

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

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 includes the following code segment: < ComVisible( False)> Public Class Class Public Sub New() ¡® Implementation code goes here. End Sub < ComVisible( True)>_ Public Function Method( param As String) As Integer Return 0 End Function < ComVisible( True)>_ Protected Function OtherMethod() As Boolean Return True End Function < ComVisible( True)>_ Public ReadOnly Property Property() As Integer Get Return 0 End get End Property ¡® More implementation code goes here. End Class

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

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

You are working with an ASP.NET custom validation control that is required to emit client-side script as part of page processing. Which is the last Page event that you can use to create this script?   PreRender
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 ter. exe to test the AdminService interface. Tester. exe includes the following code segment:

Module Tester Sub Main() Dim service As New AdminService() End Sub End Module 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:// Srv/ 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 ter. exe to test the AdminService interface. Tester. exe includes the following code segment:

Module Tester Sub Main() Dim service As New AdminService() End Sub End Module 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:// Srv/ 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?   Replace the use of the AdminService constructor in Tester. exe with the following code segment: Dim o as Object o = Activator. CreateInstance( GetType( AdminService)) service = CType( o, AdminService)

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 collection of serviced components that performs bank transfers for Ltd. All the components are marked with the Transaction( TransactionOption. Required) attribute. All the methods in the components are marked with the AutoComplete() attribute. You discover that incorrect balance amounts are being transferred. You decide to debug the components. During debugging, a System. Runtime. InteropServices. COMException is thrown. The HRESULT for the exception is 0x8004E002. The exception includes the following message: ¡° The root transaction wanted to commit, but transaction aborted.¡± You find that this exception occurs only during the debugging session, and not when the components run outside of the debugger. This exception is preventing you from continuing to debug the components.

You need to resolve this problem.

What should you do?   Remove the AutoComplete attribute from each method. Within each method implementation, add calls to the ContextUtil. SetComplete() and ContextUtil. SetAbort() methods

You create a collection of serviced components that performs bank transfers for Ltd. All the components are marked with the Transaction( TransactionOption. Required) attribute. All the methods in the components are marked with the AutoComplete() attribute. You discover that incorrect balance amounts are being transferred. You decide to debug the components. During debugging, a System. Runtime. InteropServices. COMException is thrown. The HRESULT for the exception is 0x8004E002. The exception includes the following message: ¡° The root transaction wanted to commit, but transaction aborted.¡± You find that this exception occurs only during the debugging session, and not when the components run outside of the debugger. This exception is preventing you from continuing to debug the components.

You need to resolve this problem.

What should you do?   Remove the AutoComplete attribute form each method. Within each method implementation, add calls to the ContextUtil. MyTransactionVote and ContextUtil. DeactivateOnReturn properties.

You create a collection of serviced components that performs bank transfers for Ltd. All the components are marked with the Transaction( TransactionOption. Required) attribute. All the methods in the components are marked with the AutoComplete() attribute. You discover that incorrect balance amounts are being transferred. You decide to debug the components. During debugging, a System. Runtime. InteropServices. COMException is thrown. The HRESULT for the exception is 0x8004E002. The exception includes the following message: ¡° The root transaction wanted to commit, but transaction aborted.¡± You find that this exception occurs only during the debugging session, and not when the components run outside of the debugger. This exception is preventing you from continuing to debug the components.

You need to resolve this problem.

What should you do?   Increase the transaction timeout in the Component Services tool by using the Properties dialog box for My Computer.

You create a collection of serviced components that performs bank transfers for Ltd. All the components are marked with the Transaction( TransactionOption. Required) attribute. All the methods in the components are marked with the AutoComplete() attribute. You discover that incorrect balance amounts are being transferred. You decide to debug the components. During debugging, a System. Runtime. InteropServices. COMException is thrown. The HRESULT for the exception is 0x8004E002. The exception includes the following message: ¡° The root transaction wanted to commit, but transaction aborted.¡± You find that this exception occurs only during the debugging session, and not when the components run outside of the debugger. This exception is preventing you from continuing to debug the components.

You need to resolve this problem.

What should you do?   Replace each method implementation with the following code segment: Try ¡® The original method implementation goes here. Finally ContextUtil. SetComplete() End Try

You create a DataSet object named ProductsDataset that contains product information from a Microsoft SQL Server database. This object has a primary key on a column named ProductID. You want to create a new DataSet object that has the same structure as ProductsDataset, including the primary key. You want the new DataSet object to be empty of data.

Which code segment should you use?   Dim NewDataSet As DataSet = ProductsDataset. Clone

You create a serviced component named BankTransfer. BankTransfer is in a COM+ application named Bank. BankTransfer is secured by using the SecurityRole attribute for the Tellers and Managers roles.

You want members of the BankTellers group to be assigned to the Tellers role.

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

You create a serviced component named HealthInfo. The component exposes patient health records. You declaratively secure HealthInfo by using role- based security. You must ensure that the security checks are enforced. You want to prevent HealthInfo from executing if administrators turns off security for the COM+ application.

What should you do?   To the project source code, add the following attribute: < Assembly: ApplicationAccessControl( AccessChecksLevel:= AccessChecksLevelOption. ApplicationComponent)>

You create a serviced component named HealthInfo. The component exposes patient health records. You declaratively secure HealthInfo by using role- based security. You must ensure that the security checks are enforced. You want to prevent HealthInfo from executing if administrators turns off security for the COM+ application.

What should you do?   To the beginning of all methods, add the following code segment: IfNot ContextUtil. IsSecurityEnabled Then Throw New SecurityException(_ ¡° Security must be enabled.¡±) End If

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

< GuidAttribute(¡° 0B6ABB29- 43D6- 40a6- B5F2- 83A457D062AC¡±), _ InterfaceType( ComInterfaceType. InterfaceIsDual)> _ Public Interface IOrderInit ¡® IOrderInit methods go here End Interface Public Class OrderProcessor Inherits ServicedComponent Implements IOrderInit ¡® OrderProcessor methods go here. End Class

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:

< GuidAttribute(¡° 0B6ABB29- 43D6- 40a6- B5F2- 83A457D062AC¡±), _ InterfaceType( ComInterfaceType. InterfaceIsDual)> _ Public Interface IOrderInit ¡® IOrderInit methods go here End Interface Public Class OrderProcessor Inherits ServicedComponent Implements IOrderInit ¡® OrderProcessor methods go here. End Class

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 end of every method, add the following line of code: Marshal. ReleaseComObject( Me)

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 TKCoverage. 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 the . Utilites. exe process. Set a breakpoint on the CreateNewSession method.

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 Inherits ServicedComponent Implements IStockQuote Public Function GetQuote( stock as Ticker) as Price_ Implements IStockQuote. GetQuote ¡® Implementation code goes here. End Function End Class

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

Which 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 Inherits ServicedComponent Implements IStockQuote Public Function GetQuote( stock as Ticker) as Price_ Implements IStockQuote. GetQuote ¡® Implementation code goes here. End Function End Class

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

Which actions should you take( Each correct answer presents part of the solution.)? )(Choose two)   To the StockQuote class, add the following attributes: < SecurityRole(¡° Customers¡±, False),_ SecurityRole(¡° Managers¡±, False)>

You create a serviced component named StockQuote that implements the IStockQuote interface.

The StockQuote class includes the following code segment: Public Class StockQuote Inherits ServicedComponent Implements IStockQuote Public Function GetQuote( stock as Ticker) as Price_ Implements IStockQuote. GetQuote ¡® Implementation code goes here. End Function End Class

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

Which actions should you take( Each correct answer presents part of the solution.)? )(Choose two)   To the beginning of the GetQuote method, add the following code segment: IfNot ContextUtil. IsCallerInRole(¡° Managers, Customers¡±)_ Then Throw New SecurityException(¡° Access is denies.¡±)

You create a serviced component named Tracker that uses attributes to dynamically register itself for COM+ services. Tracker is in an assembly file named . dll. Tracker uses transactions and rolebased 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 serviced component named Tracker that uses attributes to dynamically register itself for COM+ services. Tracker is in an assembly file named . dll. Tracker uses transactions and rolebased 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?   Provide to the administrator the . dll file. Instruct the administrator to use the . NET Services Installation tool ( Regsvcs. exe) to install Tracker.

You create a serviced component named Tracker that uses attributes to dynamically register itself for COM+ services. Tracker is in an assembly file named . dll. Tracker uses transactions and rolebased 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?   Add a new merge module to your solution. Add . dll to the merge module. Provide to the administrator the . msm file with installation instructions.

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

What should you do?   To WorkItem, add the following attribute: < InterfaceQueuing( True, Interface:=¡± IWorkItem¡±)>

You create a Windows service named FxListener that performs financial transactions by using files in a drop directory. When a new XML file appears in the drop directory, FxListener opens the file and performs the financial transaction contained within the XML code. You want updates to each XML file to be logged in the Windows application log. A String object named Message contains the message to be logged.

Which code segment should you use?   EventLog. WriteEntry(¡° FxListener¡±, Message)

You create a Windows service named FxListener that performs financial transactions by using files in a drop directory. When a new XML file appears in the drop directory, FxListener opens the file and performs the financial transaction contained within the XML code. You want updates to each XML file to be logged in the Windows application log. A String object named Message contains the message to be logged.

Which code segment should you use?   Dim log As New EventLog(¡° Application¡±)log. WriteEntry( Message)

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 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?   Attach a debugger to the Windows service. Then start the Windows service.

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

You deploy 1. 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 A. You use the Debug. Assert method in your code to verify parameter values and ranges. You find that A does not display assertion failure messages. Instead, A 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 A. You use the Debug. Assert method in your code to verify parameter values and ranges. You find that A does not display assertion failure messages. Instead, A 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 A, add an EventLogTraceListener object to the Listeners property of the Debug class.

You create an XML Web service named Code. Your project source includes a code- behind file and a file named Code. 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 Code 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 myService. This service exposes a Web method named MyMethod. You need to register myService in UDDI. First, you add a new business name and a new tModel. You now need to list a valid access point to myService.

Which URL should you use?   http:// Server/ AppPath/ myService

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

Which URL should you use?   http:// Server/ AppPath/ myService= wsdl

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

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

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

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

You create an XML Web service named Service. You must ensure that this service meets the following URL authorization requirements.

. Anonymous access must be disabled for Service. . An authenticated user named User1 cannot access Service. . All other authenticared users can access Service.

You configure Internet Information Services ( IIS) to meet these requirements. You now need to configure the authorization section in the Web. config file to properly authorize the users.

Which code segment should you use?   < deny users=¡±?¡± /> < deny users=¡± User1¡± /> < allow users=¡±*¡± />

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 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?   Modify the permissions of the HKEY_ LOCAL_ MACHINESYSTEMCurrentControlSetServicesEventlog registry key to give full control to the IUSR_ computername user account.

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 subscribed 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. . org/ disco/ xmlns: sc1= http:// schemas. . org/ disco/ scl/> < scl: contractRef ref=¡± SilverService. asmx? wsdl¡±/> </ disco: discovery>

You create an XML Web service that provides stock information to its customers. 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?   Xcopy command

You create an XML Web service that provides stock information to its customers. 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 three Windows services named Service1, Service2, and Service3. 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 Service1 Service2 Service3 During the installation process, Service3 throws an installation error. The installation process completes.

How many of the three services are now installed on Computer1?   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 the Shared Property Manager.

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 Microsoft SQL Server database.

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 the assembly cache. MyAssembly cosist of two . NET Remoting objects named 1 and 2. These objects are configured in the App. config file of MyAssembly as shown in the following code segment: < system. runtime. remoting> < application> < service> < activated type=¡± Assembly. 1, MyAssembly, Version= 1.0.0.0, Culture= neutral, PublicKeyToken= 28dckd8349lduj¡±/> < wellknown mode=¡± SingleCall¡± objectUri=¡± 2. rem¡± type=¡± Assembly. 2. rem¡± Version= 1.0.0.0, Culture= neutral, PublicKeyToken= 28dckd8349lduj¡±/> < channels> < channel ref=¡± http¡±/> </ channels> </ service> </ application> </ system. runtime. remoting>

You create an application named MyApp that resides on a different computer than Assembly.

MyApp references version 1.0.0.0 of Assembly. MyApp contains code that activates instances of 1 and 2 to use their services. Due to change in business needs, you must update Assembly. You create version 2.0.0.0 of My 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 MyApp.

Which version of the remote objects will MyApp activate?   version 1.0.0.0 of 1; version 1.0.0.0 of 2

You creating Windows- based application named WinApp. To the application, you add a Windows Form named MyForm and a reference to a SingleCall . Net Remoting object named TheirObject. You need to ensure that MyForm creates an instance of TheirObject to make the necessary remote object calls.

Which code segment should you use?   RemotingConfiguration. RegisterWellKnownClientType( _ GetType( TheirObject) , http:// Server/ TheirAppPath/ TheirObject. rem¡±) Dim theirObject As New TheirObject()

You develop a Windows- based application named MyWinApp that contain a Windows Form named 1. To MyWinApp, you add a Web reference to an XML Web Service named Service1. Service1 exposes two Web methods named Authentication and RetrieveData. Both methods have sessions enabled. Authenticate authenticates a caller. If the caller is authenticated, Authenticate creates a 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 input 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 Page_ load event of 1. ( Line numbers are included for reference only) 01 Dim service1 As New localhost. Service1 ( ) 02 Dim key As String 03 Dim userData As DataSet 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 returns 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 MyWinApp that contain a Windows Form named 1. To MyWinApp, you add a Web reference to an XML Web Service named Service1. Service1 exposes two Web methods named Authentication and RetrieveData. Both methods have sessions enabled. Authenticate authenticates a caller. If the caller is authenticated, Authenticate creates a 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 input 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 Page_ load event of 1. ( Line numbers are included for reference only) 01 Dim service1 As New localhost. Service1 ( ) 02 Dim key As String 03 Dim userData As DataSet 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 returns 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 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?   Dim myServiceController As New _ ServiceController(¡° Service¡±) If myServiceController. Status = _ ServiceControllerStatus. Stopped Then myServiceController. Start() End If

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?   Dim myServiceController As New _ ServiceController() Dim myArgs( 1) As String my Args( 0)=¡± Service¡± If myServiceController. Status = ServiceControllerStatus. Stopped Then myServiceController. Start( myArgs) End If

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 indicated 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 wan users to be taken automatically to the next Web page of application.

Which code segment should you use to call CreditService?   CreditService. BeginChargeCard( ccNumb, billAddress,_ amount, New AsyncCallback( AddressOf_ CCResponse), Nothing) Server. Transfer(¡° process. aspx¡±) Private Sub CCResponse( aRes As IAsyncResult) CreditService. EndChargeCard( aRes) End Sub

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 indicated 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 wan users to be taken automatically to the next Web page of application.

Which code segment should you use to call CreditService?   Dim AsyncResult As IasyncResult AsyncResult = CreditService. BeginChargeCard( ccNumb,_ billAddress, amount, Nothing, Nothing) AsyncResult. AsyncWaitHandle. WaitOne() CreditService. EndChargeCard( AsyncResult) Server. Transfer(¡° process. aspx¡±)

You have a . NET Remoting object named ProductLoader. The ProductLoader class is a serveractivated 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 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 loanCustomersDataSet that contains customers serviced by the loan department of Ltd. You receive a second DataSet object named assetCustomersDataSet that contains customers serviced by the asset management department of . 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 myDataSet. 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 foreign key constraint on CustomerID of Orders between Customers and Orders.

You have a DataSet object named myDataSet. 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 myDataSet on OrderID between Customers and Orders.

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 strongly typed DataSet object named aDataSet. 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 added an EventLogTraceListener object to the Debug.TraceListeners collection so that debug messages are written to the Application event log. You are finished debugging and set your application to the Release configuration. The application contains calls to the Trace object to write tracing messages. In this configuration, where will the trace messages appear?   In both the Output window and in the Application event log
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 complete WebApp2 against version 1.0.0.0. You do not recompile WebApp. You then run MyWebApp.

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 complete WebApp2 against version 1.0.0.0. You do not recompile WebApp. You then run MyWebApp.

What is the most likely result?   Version 1.0.0.0 of Employee is loaded from the global assembly cache.

You have created a SqlConnection object named sqlConnection1 and a SqlDataAdapter object named sqlDataAdapter1 by dragging the Orders table from your database in the Server Explorer and dropping it on a Web form. You have added a DataGrid control named dgOrders to the Web form. You have selected the sqlDataAdapter1 object and created a DataSet object named dsOrders1 by using the Generate DataSet dialog box. The Page_Load() method for your Web form contains the following code:

private void Page_Load(
object sender, System.EventArgs e)
{
// Move the data from the
// database to the DataGrid
dgOrders.DataBind();
}

The Web form loads without error, but the DataGrid control does not display any data. What is the problem?   You neglected to call the Fill() method of the SqlDataAdapter object.

You have created a new Web service to deliver stock recommendations to your customers. You're working in an ASP.NET project within the Visual Studio .NET environment. What's the easiest way to test your new Web service to make sure that it's returning the proper results?   Run the Web service project and use the test page that it opens in the browser.
You have created a Web custom control that handles file uploading with custom authentication. This control will be used in several of your company's ASP.NET Web applications. Which method should you use for deploying this control?   Merge module
You have created a Web service named MedicalPolicies. Within the Web service class, you have a method named Reimbursables() that returns a DataSet object. What must you do to make the information contained in this DataSet object available to clients of the Web service?   Mark the Reimbursables() method with the [WebMethod] attribute.
You have created a Web user control named signup.ascx that encapsulates the controls used within your enterprise for newsletter signup forms. Now you want to use this control in other Web applications. What must you do?   Copy the control's files into each application.
You have created an ASP.NET Web form that displays parts stock information to your customers in a series of DropDownList and ListBox controls. This page is never posted back to your Web server. Which page attribute can you use to optimize this page so that it does not download unnecessary data?   EnableViewState = "false"
You have created and tested an ASP.NET application on your local development server. The application makes heavy use of Web server controls, along with static HTML text. Now you have deployed the application to your company's production server via FTP. The production server has IIS 5.0 installed. The pages in the application are displaying in a jumbled fashion, with text present but none of the Web server controls. What could be the problem?   The ASP.NET worker process is not properly installed on the production server.
You have DataSet object named LoanCustomersDataSet that contains customers serviced by the loan department of . You receive a second DataSet that contains customers serviced by the asset management department of . 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 defined a method named DataLoad() that makes a list of customers available by returning an ICollection interface. You have an ASP.NET Web form with a ListBox control named lbCustomers. The Page_Load() event handler for the Web form contains this code:

private void Page_Load(
object sender, System.EventArgs e)
{
lbCustomers.DataSource = DataLoad();
lbCustomers.DataTextField =
"CustomerName";
}

The Web form opens without error, but no customer names are displayed. What is the problem?   You have neglected to call the DataBind() method of the page.

You have deployed an ASP.NET application on your company's intranet. Your company has standardized on Internet Explorer 6.0 as the corporate browser. Users complain that when they use the Submit button to send their expense reports in via the application, the focus moves to the first control on the reporting form. This makes it difficult for users to edit their expense reports.

What is the easiest way to maintain focus across postback operations in this application?   Set the SmartNavigation attribute of the Page directive to true.

You have designed a Web form that includes a DropDownList control with the ID of ddlSize. The Items property of the ddlSize control contains the following items:

-
9
10
11
12

The Web form also contains a RequiredFieldValidator control named rfvSize. You have set the ControlToValidate property of rfvSize to ddlSize. Your goal is to make sure that a non-default value is chosen from ddlSize before the Web form is posted back to the server. What other property setting must you make on the rfvSize control?   rfvSize.InitialValue = "-";

You have designed a Web form that uses a DropDownList control to allow the user to select a state containing their shipping address. In the code-behind file for the Web form, you've implemented an event handler for the SelectedIndexChanged event to update the sales tax amount displayed on the Web form when a new state is changed.

Users report that the sales tax amount is not updated no matter which state they choose in the DropDownList. What must you do to fix this problem?   Set the AutoPostBack property of the DropDownList control to true.

You have designed an ASP.NET Web form in which you need to highlight important information within a table so that it stands out to the user. Which method of highlighting is most accessible?   <B>
You have developed a Web form that will display account information to sales representatives. You want your code to respond to the Page's Load event by running a method named LoadAccounts() along with the usual Page_Load() event handler. The LoadAccounts() event handler is defined as follows:

private void LoadAccounts(Object sender,
System.EventArgs e)

What statement should you use to attach this method to the Load event?   

this.Load += new System.EventHandler(
this.LoadAccounts);
You have developed an ASP.NET Web form that displays product information from your company's database. The database contains approximately 200 products. Each time the page is displayed, it retrieves information on one product specified by the user.

What type of caching can you use to speed up the delivery of this page?   Varying

You have implemented a Web service that calculates shipping for your company's products and exposed this Web service to the Internet. However, you have removed the UDDI and WSDL files for the Web service. What is the consequence of this action?   The Web service can only be used by applications that have knowledge of its interface.
You have inherited a large ASP.NET application because the original developer has left the company. You are concerned because there does not seem to be sufficient error trapping in the code-behind files to catch all likely errors. What is the easiest way for you to begin tracking all unhandled errors?   Add an Application_Error() event handler to the Global.asax file.
You have used the Setup Wizard to create a setup for your ASP.NET Web application and chosen to install a bootstrapper in the setup. Which of these actions will the bootstrapper not perform?   Install IIS
You have written a Visual C# .NET method that opens a database connection using a SqlConnection object, retrieves some information from the database, and then closes the connection. The information is retrieved using a stored procedure that that might not always be available because of backup schedules. You have wrapped the code to call the stored procedure in a try-catch-finally block. Where should you place the code to close the SqlConnection object?   Inside the finally block
You use a function to maintain a table named Categories in a Microsoft SQL Server database. The function creates a DataTable object named Categories in a DataSet object named categoriesDataSet. These two objects capture all insertions, updates and deletions to the Categories table.

The function instantiates a SqlDataAdapter object named DataAdapter. This object is configured to select, insert, update and delete rows in the Categories DataTable object. You need to update the database to include the changes in the Categories DataTable object and capture all data errors in a batch after all rows have been processed.

Which code segment should you use?   DataAdapter. ContinueUpdateOnError = True TKDataAdapter. Update ( CategoriesDataSet, ¡° Categories¡±) If categoriesDataSet. Tables ( 0). HasErrors Then Dim myDataRow ( ) As DataRow = _ CategoriesDataSet. Tables( 0). GetErrors ( ) End If

Your application connects to a database and adds employee names to a ListBox control in the Page.Load event. Supervisors can edit employee information on this page and submit the edits with a button on the page.

Supervisors report that after they edit an employee's information, each employee name appears twice in the ListBox control. What should you do to fix this problem?   Check the IsPostBack property in the Page.Load event and only add names if IsPostBack is false.

Your application contains a DataSet object consisting of patient and physician records. You want to write this DataSet object out to a disk file as an XML document. How should you proceed?   Call the WriteXml() method of the DataSet object.
Your application contains the following code:

SqlDataReader dr = cmd.ExecuteReader();
String s;
while(dr.Read())
{
s = s + dr.GetString(0);
}

What can you do to optimize this portion of the application?   Replace the String object with a StringBuilder object.

Your application includes 4,500 double-precision floating point numbers that you want to write out to a disk file. You'd like to minimize the size of the disk file. Which object should you use to write the file?   BinaryWriter
Your application includes a ListBox control named lbCustomers that displays a list of customers. The DataTextField property of the ListBox is bound to the CompanyName column of the Customers database table. The DataValueField property of the ListBox is bound to the CustomerID column of the Customers database table.

Your form also contains a TextBox control named txtCustomerID. This control uses simple data binding to display the SelectedItem.Value from the ListBox control.

When the user selects a new company name in the ListBox, you want to display the corresponding CustomerID value in the txtCustomerID control. What should you do?   Call the DataBind() method of the TextBox control in the SelectedIndexChanged event of the ListBox.

Your application needs to search for substrings in longer strings. This searching should be culture-aware. What should you use to perform these searches?   CultureInfo.CompareInfo
Your application requires the user to be in the Power Users group to activate certain functions. Which ASP.NET security feature should you use to ensure that the user is in this group?   Role-based security
Your application uses a SqlDataReader object to retrieve monthly shipping data from a SQL Server database. When you find a month with above-average sales, you invoke the ExecuteNonQuery() method of a SqlCommand object to insert a row in another table using an INSERT INTO stored procedure.

Calling the ExecuteNonQuery() method is causing an error. What is the most likely reason for this error?   You are using the same SqlConnection object for both the SqlDataReader object and the SqlCommand object, and the SqlDataReader is still open when you try to execute the SqlCommand.

Your application uses a custom database to hold information on inventory levels. When an exception occurs during database processing, you want to make current database status information available to the catch block. What should you do?   Derive a custom exception class from the ApplicationException class. Pass the information as properties of the custom exception class.
Your applications use a library of advanced mathematical methods from a third-party developer. This library is implemented as a COM component. You are migrating your applications to the .NET Framework. What should you do to continue to use the classes and methods within the library?   Obtain a Primary Interop Assembly from the developer of the library. Install the PIA in the Global Assembly Cache.
Your ASP.NET application allows the user to display all the orders that were placed by a particular customer. Your database contains 100 orders and 10 customers. Users of the application might want to see orders from several different customers during the course of a single session. Which ADO.NET object should you use to hold the orders?   DataView
Your ASP.NET application allows the user to input the URL of a Web page, and then applies an XSLT file to show how that Web page looks on a mobile device. What sort of control should you use to validate the TextBox control where the user inputs the URL?   RegularExpressionValidator
Your ASP.NET application contains a Web form named login.aspx. When this page is posted back to the server, you check the entered username and password against your corporate database. If the username and password match, you want to display the accountdetails.aspx Web form as the result in the user's browser. Execution of the application will proceed from that page. How should you transfer control in this case?   Server.Transfer() method
Your ASP.NET application contains this setting in the web.config file:

<identity impersonate="true"
name="CORP\Auditing"
password="Auditing"/>

You are allowing only digest or Windows integrated authentication in IIS. ASP.NET is running under the machine account. What identity will ASP.NET use to authorize resources if a user with the Windows account Shirley in the CORP domain logs in via digest authentication?   CORP\Auditing

Your ASP.NET application includes a Web page named AllErrors.htm that is displayed in response to any error. This page is configured using this code in the web.config file:

<customErrors mode="Off"
defaultRedirect="AllError.htm">
</customErrors>

The application includes a login page named Login.aspx. When an error occurs on the login page, you want to display the page LoginInstructions.htm instead of AllErrors.htm. What should you do?   Add an ErrorPage attribute to the Page directive for Login.aspx. Set the value of this attribute to LoginInstructions.htm.

Your ASP.NET application is running on your company's production Web server. To fix a bug, you've modified one of the ASPX pages that is part of this application. What must you do to ensure that the production Web server uses the modified page?   Copy the modified ASPX page to the Web server in place of the original page. IIS will automatically use the modified page.
Your ASP.NET application tracks donor contributions for non-profit organizations. Because of the nature of this data, you need to maintain session state even if the Web server crashes and needs to be restarted. Which alternative should you use to store session state for this application?   SQL Server
Your ASP.NET page displays the orders for a particular customer in a DataGrid control. The orders are retrieved by constructing an ad hoc SQL statement with a WHERE clause that specifies the customer. The application uses a SqlConnection object to connect to the database. The SQL statement is used to fill a DataSet, which is bound to the DataGrid control. What can you do to optimize this portion of your application (select two)?   Replace the ad hoc SQL statement with a stored procedure.
Your ASP.NET page displays the orders for a particular customer in a DataGrid control. The orders are retrieved by constructing an ad hoc SQL statement with a WHERE clause that specifies the customer. The application uses a SqlConnection object to connect to the database. The SQL statement is used to fill a DataSet, which is bound to the DataGrid control. What can you do to optimize this portion of your application (select two)?   Replace the DataSet object with a SqlDataReader object.
Your ASP.NET Web form displays ordering information for 62 products in a DataGrid control. Your company is as yet unable to accept Web orders, so there are no controls on the page to post the data back to the server. What can you do to optimize the delivery of this page?   Disable ViewState for the DataGrid control.
Your ASP.NET Web form includes a DataGrid control that contains data the user might want to edit. You need to maintain the information in this control across page postbacks to the server. The information is not needed by any other page in the application. Which state management technique should you use for this control?   ViewState
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 company supplies a COM component to provide network connectivity services and peer-to-peer file sharing. Some of your clients are moving to .NET and require a Runtime Callable Wrapper for your component. How should you proceed?   Use the Type Library Importer to create and sign a Primary Interop Assembly for your component.
Your Microsoft SQL Server 6.5 database contains a table named aPurchases that consists of more than 1 million rows.

You are developing an application to populate a DataReader object with data from aPurchases.

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 aSQLSelect. You need to initiate a SqlConnection object and a SqlCommand object you will use to populate the DataReader object.

Which code segment should you use?   Dim myConnection As New OleDbConnection _ ( myOleDbConnectionString) Dim tkCommand As New OleDbCommand _ ( aSQLSelect, myConnection)

Your Microsoft SQL Server database contains a table named Orders. Due to recent increase in product sale. 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?   Dim myConnection As New SqlConnection _ (¡° Data Source=( local); Initial Catalog= ;¡±_ & ¡° Integrated Security= true¡±) Dim myCommand as new SqlCommand_ (¡° SELECT * FROM Orders¡± , myConnection) Dim ordersData Reader As SqlDataReader 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 order- entry 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 Form

Your Microsoft SQL Server database contains a table named Orders. Orders is used to store new purchase orders as they are entered into an order- entry 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 GetCustomer. getCustomer accepts one parameter named @ CustomerID and returns the appropriate company name.

You initiate a SqlCommand object named myCommand. You need to initialize myCommand to return the company name for @ CustomerID with a value of ¡° ALFKI¡±.

Which code segment should you use?   myCommand. CommandText = ¡° Customer¡± myCommand. Parameters. Add (¡°@ CustomerID¡±, ¡° ALFKI¡±)

Your project contains the following API declaration:

[DllImport("kernel32.dll",
CharSet=CharSet.Auto)]
public static extern int GetComputerName(
String buffer, ref uint size);

The project also contains code to use this API to display the computer name:

public static void ShowName()
{
String buf = "";
UInt32 intLen=128;
Int32 intRet;

// Call the Win API method
intRet = GetComputerName(
buf, ref intLen);
Console.WriteLine(
"This computer is named " +
buf.ToString());
}

Users report that no computer name is displayed. What should you do?   Replace the use of String with StringBuilder in the code.

Your user would like to see German dates and currencies displayed in an application, but wants the user interface to remain in English. How can you accomplish this?   Set the CurrentCulture property to a CultureInfo object representing the de-DE culture, and set the CurrentUICulture property to a CultureInfo object representing the en-US culture.
Your Web application is used to display product information from your company's database. The application consists of a set of pages - each of which uses ADO.NET objects to display data from a SQL Server database. No page in the application passes any information to another page in the application. Which alternative should you use for session state in this application to maximize performance?   <@%Page EnableSessionState="false" %>
Your Web application provides information on your company's shipping policies. Users can select a region of the country from a ListBox control, and are then shown a list of all the shipping choices for that region. The list is stored in a database, and it changes very infrequently. You are concerned about the performance of the application when the Web server is under very heavy load. Which of these actions should you take to improve application performance?   Use caching with the VaryByParam attribute to hold the delivered page in memory between requests.
Your Web application uses a frameset to organize information. What must you do to comply with Section 508 accessibility guidelines?   Provide Title text for each frame.