Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Practice Exam

Question 1 You have developed a .NET Remoting server that is used by employees in your organization to place vacation requests. The server makes available a Singleton SAO named VacationRequest. Clients send their employee IDs when they create the object and then later post them with their vacation requests. The server then records the information in a Jet database.

You discover that at peak times vacation requests are being mixed. For example, the vacation request from employee ID 3235 is being saved as a request from employee ID 4238. What can you do to fix this issue?

  • A. Switch from using a Singleton SAO to using a CAO.

  • B. Switch from using a Singleton SAO to using a SingleCall SAO.

  • C. Switch the database from Jet to SQL Server.

  • D. Issue a confirmation number with each call to an object to which the employee can later refer.

Question 2 You are building a .NET Remoting server that exposes the Employee type as a server-activated object. The Employee type is defined as follows:
Public Class Employee
    Inherits MarshalByRefObject

    Private EmployeeName As String

    Private m_HireDate As DateTime
    Public Property HireDate As DateTime
        Get
            HireDate = m_HireDate
        End Get
        Set
            m_HireDate = value
        End Set
    End Property

    Private m_Salary As Double
    Public Function Salary As Double
            Salary =  m_Salary
    End Function

    Public Shared DepartmentName As String

End Class

Which members of Employee will not be available remotely? [Select all that apply.]

  • A. EmployeeName

  • B. HireDate

  • C. Salary

  • D. DepartmentName

Question 3 You are developing a distributed application using the .NET Remoting infrastructure. The application exposes the Order object as a remote object to its client applications. The Order object consists of order details and an array of Product objects. The Product object consists of four fields: ProductID, Price, Qty, and QtyOnStock. The QtyOnStock field is not used by the client applications. You are expecting that a large number of Product objects will be created by the application. You want to write minimal code as well as minimize the network traffic as much as possible. What should you do? [Select two.]
  • A. Mark the ProductID, Price, and Qty fields of the Product class with the Serializable attribute.

  • B. Mark the QtyOnStock field with the NonSerialized attribute.

  • C. Mark the Product class with the Serializable attribute.

  • D. Make the Product class implement the ISerializable interface.

Question 4 You want to host a remotable class via the .NET Remoting framework so that remote clients can instantiate the class and invoke methods on it. The system standards require you to use Windows integrated authentication to authenticate users of the object. You want a solution that minimizes additional coding requirements. Which of the following techniques should you use to host the remotable class?
  • A. Use Internet Information Services (IIS) as a remoting host.

  • B. Use a console application as a remoting host.

  • C. Create a Windows service and use that to host the remotable class.

  • D. Use a Web service application to host the remotable class.

Question 5 You are developing a distributed application that allows client programs to instantiate a class named Transaction. You want the remote object to be created on the server so that it can access the corporate financial information, which is stored on an intranet. Which of the following options should you implement to make the Transaction class accessible through .NET Remoting?
  • A. Mark the Transaction class with the Serializable attribute.

  • B. The Transaction class should inherit from the MarshalByRefObject class.

  • C. The Transaction class should implement the ISerializable interface.

  • D. The Transaction class should implement the IActivator interface.

Question 6 You have designed a remotable class that allows the user to retrieve the latest weather information for his or her region. You have stored the configuration settings in a configuration file:
<system.runtime.remoting>
  <application>
     <service>
        <wellknown mode="Singleton"
          type="RemotingWeather.WeatherInfo, WeatherInfo"
          objectUri="WeatherInfo.rem"
        />
    </service>
  </application>
</system.runtime.remoting>

Which of the following methods should you use to load the configuration details from the configuration file?

  • A. Activator.GetObject

  • B. Activator.CreateInstance

  • C. Activator.CreateInstanceFrom

  • D. RemotingConfiguration.Configure

Question 7 You work for a large chemical manufacturing company that has four production units across the country. Your team has the responsibility of designing a distributed application that allows different production units to share and update material safety information for various products. One of your coworkers is using the following code to create a remoting host to host a server-activated object and is getting an error. What should she do to resolve this error?
01: Imports System.Runtime.Remoting
02: Imports System.Runtime.Remoting.Channels
03: Imports System.Runtime.Remoting.Channels.Tcp
04: Imports System.Runtime.Remoting.Channels.Http
04:
05: Sub Main()
06:     ' Create and Register channels
07:    Dim tcpChannel As TcpServerChannel = _
        New TcpServerChannel(7777)
08:    Dim httpChannel As HttpServerChannel = _
        New HttpServerChannel(8888)
09:    RemotingConfiguration.RegisterWellKnownServiceType _
         (GetType(MsdsInfo), "MsdsInfo", _
         WellKnownObjectMode.Singleton)
10: End Sub

  • A. Remove the statement at line 08.

  • B. Add the following statements just before line 09:

    ChannelServices.RegisterChannel(tcpChannel)
    ChannelServices.RegisterChannel(httpChannel)
    
  • C. In the statement at line 07, replace TcpServerChannel with TcpChannel. Similarly, in the statement at line 08, replace HttpServerChannel with HttpChannel.

  • D. Use the same port numbers in the statements at line 07 and line 08.

Question 8 You have used the Web Services Discovery Tool to retrieve information about a Web service named OrderTracker. Which file will contain the URL for any documentation of the OrderTracker Web service?
  • A. results.discomap

  • B. OrderTracker.disco

  • C. Reference.vb

  • D. OrderTracker.wsdl

Question 9 You have created a Web service that provides BankAccount details. One of your client applications calls the Web service proxy, which is generated with the wsdl.exe tool, to retrieve bank account information. This information takes some time to generate, and your application is unresponsive while you are waiting for the results. What can you do to fix this problem?
  • A. Install a faster link to the Internet.

  • B. Install more memory in the client computer.

  • C. Use asynchronous calls to invoke the Web service.

  • D. Use the new proxy generated automatically by adding a Web reference to the Web service.

  • E. Use the new proxy generated with the wsdl.exe tool using the /proxy option.

Question 10 You want to use a Web service that supplies credit card–verification services from your application. You know the URL of the ASMX file published by the Web service. What step should you take first?
  • A. Run the Web Services Discovery tool.

  • B. Open the ASMX file in a Web browser.

  • C. Run the XML Schema Definition tool.

  • D. Copy the ASMX file to your client project.

Question 11 You are designing a Web service that will return roughly 300KB of database information to clients on your intranet. How should you declare the Web method?
  • A.

    <WebMethod(BufferResponse:=False)> _
    Public Function GetData() As Object _
    
  • B.

    <WebMethod(CacheDuration:=0)> _
    Public Function GetData() As Object _
    
  • C.

    <WebMethod(CacheDuration:=7200)> _
    Public Function GetData() As Object _
    
  • D.

    <WebMethod(EnableSession:=True)> _
    Public Function GetData() As Object _
    
Question 12 You are developing a SOAP extension to run in a Web service client application. The SOAP extension includes a class named MyExtensionAttribute to flag methods to which the extension applies. The client project contains this code:
Private Sub btnGetData_Click( _
 ByVal sender As System.Object, _
 ByVal e As System.EventArgs) _
 Handles btnGetData.Click
    ' Call a Web method on the object
    Dim I As InvWebService.Inventory = _
     New InvWebService.Inv()
    objWarehouse.Inv = I.GetLatest()
End Sub

Where should you apply the MyExtensionAttribute attribute so that it interacts with the SOAP requests generated by this procedure?

  • A. To the btnGetData_Click method

  • B. To the GetInitializer method in your SOAP extension

  • C. To the GetLatest method in the Web service proxy class

  • D. To the Load event of the form containing the button

Question 13 You have purchased a commercial SOAP extension for use with your Web service. This extension encrypts some attributes in the AfterSerialize event on the client and decrypts the attributes in the BeforeDeserialize event on the server. Now you want to add your own SOAP extension to track some statistics on the incoming XML data. This SOAP extension will need access to the decrypted attributes from the other SOAP extension. How should you implement the new SOAP extension?
  • A. Add the new SOAP extension in the BeforeDeserialize event with a higher priority than the existing SOAP extension.

  • B. Add the new SOAP extension in the BeforeDeserialize event with a lower priority than the existing SOAP extension.

  • C. Add the new SOAP extension in the AfterDeserialize event with a higher priority than the existing SOAP extension.

  • D. Add the new SOAP extension in the AfterDeserialize event with a lower priority than the existing SOAP extension.

Question 14 You need to develop a Windows application that accesses the Orders XML Web service provided by your company's business partner. You know the URL of the Web service. How can you generate client-side proxy classes for the Web service? [Select two.]
  • A. Use a proxy tool such as the .NET WebService Studio tool.

  • B. Use the Web Services Description Language tool.

  • C. Use the Web Services Discovery tool.

  • D. Set a Web reference to point to the Web service.

Question 15 Your code is making asynchronous calls to two different Web methods. You want to execute other code until you arrive at a point where you require the results from the asynchronous calls. How should your code wait for the results of the asynchronous calls? [Select the two best answers.]
  • A. Use a pair of delegate callbacks, one for each Web method.

  • B. Use a WaitHandle.WaitAny method call, specifying both Web methods.

  • C. Use a WaitHandle.WaitAll method call, specifying both Web methods.

  • D. Use two WaitHandle.WaitOne method calls, one for each Web method.

Question 16 You are developing a serviced component that manages book sales. Whenever a sale is made, the ProcessSale method of the serviced component is called. The ProcessSale method calls the ValidateCreditCard Web method to validate credit card numbers entered by the user of the CreditCard Web service and then records the sales in the database by calling the RecordSales Web method from the Sales Web service. After calling these Web methods, the ProcessSale method then records the shipping instructions and sales details in the Shipping database. The code of the ProcessSale method is defined as follows:
<Transaction(TransactionOption.Required)> _
Public Class Books
    Inherits ServicedComponent
    Implements IBooks

  <AutoComplete> _
  Public Sub ProcessSale(ByVal abooks As Books())
    Dim cc As CreditCard = New CreditCard()
    If cc.ValidateCreditCard() Then
        Dim sa As Sales = New Sales()
        sa.RecordSales()
    End If
    ' Record the shipping instructions and sales
    ' detail in the Shipping database
  End Sub
End Class

The ValidateCreditCard and RecordSales Web methods have their TransactionOption property set to Required and RequiresNew, respectively. When the serviced component method is executed, the method throws an exception when it tries to save the shipping instructions in the Shipping database. What would be the state of the transactions?

  • A. All the transactions are rolled back.

  • B. The transaction in only the RecordSales method is committed. The transactions in the ValidateCreditCard and ProcessSale methods are rolled back.

  • C. Transactions in the ValidateCreditCard and RecordSales Web methods are committed. The transaction in the ProcessSale method is rolled back.

  • D. The transaction in only the ValidateCreditCard Web method is committed. The transactions in the RecordSales and ProcessSale methods are rolled back.

Question 17 You have created a Windows service that monitors email messages on your company's mail server. The service will execute on the mail server, which is a Windows 2000 Advanced Server machine. To perform its work, the Windows service needs administrative access to the computer. Which security context should you use as the startup account for the service?
  • A. LocalSystem

  • B. LocalService

  • C. NetworkService

  • D. User

Question 18 You have built a Windows Service application that will monitor network activity on a specified TCP/IP port. You intend to allow the user to specify the port as a parameter from the Services MMC snap-in. Where should you process the user's selection?
  • A. In the Main method of the service

  • B. In the OnStart method of the service

  • C. In the Run method of the service

  • D. In the OnContinue method of the service

Question 19 You are part of a team that is developing a Windows service application to monitor a legacy application for new data. Occasionally your application may encounter errors. You want to develop an error-reporting mechanism that is easy to use for administrators who will monitor and maintain the application on a day-to-day basis. You also want a scheme that is robust and requires a minimal amount of code. Which of the following techniques should you choose?
  • A. Use the event log

  • B. Use SQL Server tables

  • C. Use XML-based log files

  • D. Use plain-text log files

Question 20 You are building a class for a component that will be registered with COM+. You have defined the interface for the serviced component:
Public Interface IPhysicians
    Function Patients(ByVal PhysicianID As String) _
     As DataSet
End Interface

You want to register the component only with the IPhysicians interface defined in the preceding code snippet. How should you define the serviced component class?

  • A.

    Public Class Physicians
        Inherits ServicedComponent
        Implements IPhysicians
    End Class
    
  • B.

    <ClassInterface(ClassInterfaceType.AutoDispatch)> _
    Public Class Physicians
        Inherits ServicedComponent
        Implements IPhysicians
    End Class
    
  • C.

    <ClassInterface(ClassInterfaceType.AutoDual)> _
    Public Class Physicians
        Inherits ServicedComponent
        Implements IPhysicians
    End Class
    
  • D.

    <ClassInterface(ClassInterfaceType.None)> _
    Public Class Physicians
        Inherits ServicedComponent
        Implements IPhysicians
    End Class
    
Question 21 You have created a component that uses the COM+ object-pooling service via the classes of the System.EnterpriseServices namespace. You have installed the component on the production server. You would like to monitor the usage pattern for the component to determine the optimum size for the object pool. How should you do this?
  • A. Activate component events and statistics within the Component Services administrative tool.

  • B. Add code to the class to write messages to the event log whenever an instance of the class is created or destroyed.

  • C. Add code to the class to maintain a custom performance monitor with object pool statistics.

  • D. Use a performance monitor to track the committed RAM on the server to deduce the number of instances of the object created.

Question 22 You have been given an assignment to develop the order-processing application for your organization. The application needs to support a large number of users and should perform well during the peak time for receiving and processing orders. Which of the following COM+ services would you use in your application? [Select all that apply.]
  • A. Queued components

  • B. Automatic transactions

  • C. Object pooling

  • D. Just-in-time activation

Question 23 You are creating a serviced component named DataConnector. After the component is deployed, the system administrators should be able to configure the component to connect to various data sources by specifying the connection string of the data source. The serviced component will be used by both COM and .NET applications. You want to retrieve the specified connection string in your component and change the behavior of the serviced component. Which of the following techniques should you use to achieve this?
  • A. Override the Activate method of the serviced component.

  • B. Override the Construct method of the serviced component.

  • C. Create a method for the serviced component that receives a connection string as its parameter. Add the method definition in the component's interface.

  • D. Create a New method for the serviced component that receives a connection string as its parameter.

Question 24 You are creating a serviced component named Shipping that includes the following code segment:
<Transaction(Isolation:=TransactionIsolationLevel.Any, _
             Value:=TransactionOption.RequiresNew)> _
Public Class Shipping
    Inherits ServicedComponent
End Class

You want the component to lock the data in such a way that no dirty reads are possible, which means that the same read operation should not retrieve different values for different users. While the data is locked, other users should be able to insert a new row but should not be able to update an existing row. How should you modify your code?

  • A. Change the Isolation property of the Transaction attribute to IsolationLevel.ReadCommitted.

  • B. Change the Isolation property of the Transaction attribute to IsolationLevel.ReadUncommitted.

  • C. Change the Isolation property of the Transaction attribute to IsolationLevel.RepeatableRead.

  • D. Change the Isolation property of the Transaction attribute to IsolationLevel.Serializable.

Question 25 You are responsible for maintaining a COM component that is used by numerous applications throughout your company. You are not yet ready to convert this COM component to .NET managed code, but you need to make it available to an increasing number of other projects that are being developed under the .NET Framework. What should you do?
  • A. Set a direct reference to the existing COM component from each .NET project.

  • B. Use the Type Library Importer tool to create and sign an assembly that will use the COM component. Place the created assembly in the Global Assembly Cache.

  • C. Use the Type Library Importer tool to create an assembly that will use the COM component. Place the created assembly in the Global Assembly Cache.

  • D. Obtain a Primary Interop Assembly for the COM component.

  • E. Set a direct reference from a single .NET project to the COM component. Include this project in each solution that must make use of the component.

Question 26 In which of these situations should you use tlbimp, the Type Library Importer tool? [Select two.]
  • A. When you must call a COM component that you wrote from Visual Basic .NET code

  • B. When you must produce a strong-named assembly that calls methods from one of your company's COM components

  • C. When you require objects from Microsoft Word in your .NET application

  • D. When you need to be able to call Windows API functions in kernel.dll from your .NET code

Question 27 You use Visual Basic .NET to create an assembly named Processor.dll. This assembly contains several complex graphics-manipulation classes and is used by several applications—managed as well as unmanaged. The COM applications are already compiled, and they use late binding to invoke methods from the assembly. What actions should you take to ensure that the assembly is properly deployed on the target machine? [Select all that apply.]
  • A. Create a strong name for the assembly by using the Strong Name tool (sn.exe).

  • B. Register the assembly using the Assembly Registration tool (regasm.exe).

  • C. Create a type library for the application using the Type Library Exporter tool (tlbexp.exe).

  • D. Import the COM type library definition into an assembly by using the Type Library Importer tool (tlbimp.exe).

  • E. Deploy the assembly to the Global Assembly Cache (GAC).

  • F. Deploy the assembly to the Windows system directory.

Question 28 In your .NET application, you use a DataSet object containing a single DataTable object named Customers. The Customers DataTable has all the rows and columns from the Customers table in your database. You would like to bind only selected columns from the Customers table to a DataGrid control. You want a solution that requires minimal programming, and you want to have minimal impact on the functionality and performance of other applications accessing the same SQL Server database. How should you proceed?
  • A. Create a second DataTable object in the DataSet object. Copy the desired data to the second DataTable object. Bind the second DataTable object to the DataGrid control.

  • B. Create a Command object to retrieve the desired columns from the DataTable object. Bind the Command object to the DataGrid control.

  • C. Delete the undesired columns from the DataTable object.

  • D. Create a DataView object that retrieves only the desired columns from the DataTable object. Bind the DataGrid control to the DataView object.

Question 29 You have recently deployed an expense-reporting system in your company. The application relies heavily on its SQL Server database. All employees in the company have similar access permissions to the database. You have created the application in such a way that it uses an employee's logon name and password in the connection string to connect to SQL Server. Users of the application are consistently reporting slow performance of the application. Your task is to optimize the performance of this application. You note that another application, which uses the same SQL Server database, is having good performance. Which of the following steps will you take?
  • A. Compile the application to native code using ngen.exe.

  • B. Run the SQL Server Index Tuning Wizard.

  • C. Increase the maximum size of the connection pool in the connection string.

  • D. Use the same connection string for all users.

Question 30 You are developing a .NET application named VerifyOrders. This application receives data from the Orders application in XML format. The VerifyOrders application enables its users to review the orders and make any changes if required. When the users are done reviewing the orders, the VerifyOrders application must create an output XML file, which is returned to the Orders application. The output XML file must contain the original values as well as the changed values. Which of the following options will you choose to create such an output XML file?
  • A. Call the DataSet.WriteXmlSchema method and pass an XmlWriter object as a parameter.

  • B. Call the DataSet.WriteXml method and set the value for XmlWriteMode parameter to IgnoreSchema.

  • C. Call the DataSet.WriteXml method and set the value for XmlWriteMode parameter to WriteSchema.

  • D. Call the DataSet.WriteXml method and set the value for XmlWriteMode parameter to DiffGram.

Question 31 You are writing a Visual Basic .NET application that executes several stored procedures to update a SQL Server database. You use database transactions to ensure that either all updates to the database succeed or the changes are rolled back in case of an error. You used the following code segment to create the database connection and the transaction object in your program:
Dim sqlConnection1 As SqlConnection = _
    New SqlConnection(strConnString)
sqlConnection1.Open()

Dim sqlCommand1 As SqlCommand = New SqlCommand()
Dim sqlTrans As SqlTransaction

You need to prevent other users from updating or inserting rows into the database until the transaction is complete. Which of the following statements enables you to fulfill this requirement?

  • A.

    sqlTrans = sqlConnection1.BeginTransaction( _
       IsolationLevel.ReadCommitted)
    
  • B.

    sqlTrans = sqlConnection1.BeginTransaction( _
       IsolationLevel.Serializable)
    
  • C.

    sqlTrans = sqlCommand1.BeginTransaction( _
       IsolationLevel.ReadCommitted)
    
  • D.

    sqlTrans = sqlCommand1.BeginTransaction( _
       IsolationLevel.Serializable)
    
Question 32 You are developing a .NET application that processes data from a SQL Server database. The application reads the data from the database in a forward-only way and does not perform any update operation. You use the System.Data.SqlClient.SqlConnection object to connect to the SQL Server database. You then use a System.Data.SqlClient.SqlCommand object to run a stored procedure and retrieve the results into a System.Data.SqlClient.SqlDataReader object. The data returned by the SqlCommand object consists of 1,000 rows and one column; the column is defined as nvarchar(20) in the database. You have written the following code to concatenate the column values of the returned result set into a string variable:
Dim dr As SqlDataReader = cmd.ExecuteReader()
Dim s As String
While(dr.Read())
    s = s & dr.GetValue(0)
End While

What can you do to optimize the application? [Select two answers.]

  • A. Replace the stored procedure with a SQL statement.

  • B. Replace the SqlDataReader object with a DataSet object.

  • C. Replace the While loop with a For Each loop.

  • D. Replace the String variable with a StringBuilder object.

  • E. Replace the GetValue method with the GetString method.

Question 33 Your application uses a SqlDataReader object to retrieve patient information from a medical records database. When you find a patient who is currently hospitalized, you wish to read the names of the patient's caregivers from the same database. You have created a second SqlDataReader object, based on a second SqlCommand object, to retrieve the caregiver information. When you call the ExecuteReader method of the SqlCommand object, you get an error. What is the most likely cause of this error?
  • A. You are using the same SqlConnection object for both the SqlDataReader objects and the first SqlDataReader is still open when you try to execute the SqlCommand.

  • B. You must use a SqlDataAdapter object to retrieve the caregiver information.

  • C. You must use the OleDbDataReader object instead of the SqlDataReader object to retrieve information.

  • D. You are using the ExecuteReader method of the SqlCommand object, but you should be using the ExecuteScalar method instead.

Question 34 You are working with this XML file:
<?xml version="1.0" encoding="UTF-8"?>
<Orders>
  <Order OrderNumber="142">
    <Part PartNumber="12"/>
    <Part PartNumber="14"/>
    <Part PartNumber="22"/>
  </Order>
  <Order OrderNumber="143">
    <Part PartNumber="22"/>
    <Part PartNumber="18"/>
  </Order>
</Orders>

Which XPath expressions can you use to return the second <Part> element from the first <Order> element? [Select two.]

  • A. /Orders/Order[1]/Part[2]

  • B. /Orders/Order[0]/Part[1]

  • C. (/Orders/Order/Part)[2]

  • D. (/Orders/Order/Part)[1]

Question 35 You use Visual Basic .NET to develop an application that will be used by the customer service department. Your application receives data from the Orders application. Users of your application get calls from the customers to make changes to their orders. You write the code that allows them to make the changes to the data, but now you want to write code that sends the changed records back to the Orders application. Which of the following methods should you use to accomplish this requirement?
  • A. DataSet.Clone

  • B. DataSet.Copy

  • C. DataSet.GetChanges

  • D. DataSet.Merge

Question 36 You are a .NET developer for a large warehousing company. You need to develop a Web application that helps users manage the inventory. Inventory data is stored on a SQL Server 2000 machine named WareHouse2 in a database named Inventory. You use a SqlConnection object and Windows integrated authentication to connect with the Inventory database. Which of the following connection strings should you choose in your Visual Basic .NET program?
  • A.

    "Provider=SQLOLEDB;Data Source=WareHouse2; Initial Catalog=Inventory; Integrated Security=SSPI;"
    
    
    					  
  • B.

    "Provider=SQLOLEDB;Data Source=WareHouse2; Initial Catalog=Inventory; User Id=sa;Password=Ti7uGf1;"
    
    
    					  
  • C.

    "Data Source=WareHouse2; Initial Catalog=inventory; Trusted_Connection=True;"
    
    
    					  
  • D.

    "Data Source=WareHouse2;User Id=sa; Password=Ti7uikGf1; Initial Catalog=inventory;"
    
    
    					  
Question 37 You need to develop a database application that interacts with a Jet database. You need to write code to return the total number of customers from the database, and you need to create the fastest solution. Which of the following actions should you take?
  • A. Write an ad hoc SQL query to return the total number of customers.

  • B. Create a stored procedure to return the total number of customers.

  • C. Use the OleDbCommand.ExecuteScalar method.

  • D. Use the OleDbCommand.ExecuteReader method.

  • E. Use the OleDbDataAdapter.Fill method.

Question 38 You are developing a .NET application that retrieves data from a SQL Server database to perform analysis of sales history. A large number of users will use your application. The size of the sales history data is huge and your application needs to retrieve this data at a very fast speed. Which of the following techniques would you use to get the maximum performance when retrieving data from the SQL Server database in your Visual Basic .NET application?
  • A. Use the classes from the System.Data.OleDb namespace.

  • B. Use the classes from the System.Data.SqlClient namespace.

  • C. Use the XML Web Services to connect with the SQL Server database.

  • D. Use COM components to retrieve the data from the SQL Server database.

Question 39 Your OrderManager application allows users to enter new orders and make changes to the existing orders. The application involves a DataTable named OrdersTable. The column OrderNumber defines a primary key for OrdersTable. Which of the following segments of code should you use to define a primary key for OrdersTable in your Visual Basic .NET program?
  • A.

    Dim c As DataColumn() = New DataColumn(1)
    c(0) = OrdersTable.Columns("OrderNumber")
    OrdersTable.PrimaryKey = c
    
  • B.

    OrdersTable.PrimaryKey = "OrderNumber"
    
  • C.

    OrdersTable.PrimaryKey.Add(OrdersTable.Column
    ("OrderNumber"))
    
  • D.

    OrdersTable.PrimaryKey = OrdersTable.Columns("OrderNumber")
    
Question 40 You are attempting to retrieve all orders placed on July 19, 1996 from a SQL Server database. You have written the following SQL statement:
SELECT * FROM Orders
WHERE OrderDate = 7/19/1996

The statement executes without error but does not return any rows. You are certain that the database contains orders from the specified date. How should you correct the SQL statement?

  • A.

    SELECT * FROM Orders
    WHERE OrderDate = #7/19/1996#
    
  • B.

    SELECT * FROM Orders
    WHERE OrderDate = July 19, 1996
    
  • C.

    SELECT * FROM Orders
    WHERE OrderDate = '7/19/1996'
    
  • D.

    SELECT * FROM Orders
    WHERE OrderDate = "7/19/1996"
    
Question 41 Your Visual Basic .NET application reads an XML file from disk into an XmlDocument object and then it modifies some of the nodes in the document. You need to write minimal code. Which object should you use to write the modified XmlDocument object back to disk?
  • A. XmlTextWriter

  • B. FileStream

  • C. StreamWriter

  • D. BinaryWriter

  • E. TextWriter

Question 42 You are developing a .NET application for the purchasing department of your company. The department needs to view, add, edit, and delete the supplier information that is stored in a SQL Server database. You must make sure that when the user updates a supplier record, the information is successfully written to the database. Which of the following pair of method calls should you choose to update the database?
  • A.

    DataTable.AcceptChanges()
    SqlDataAdapter.Update(DataTable)
    
  • B.

    SqlDataAdapter.Update(DataTable)
    DataTable.AcceptChanges()
    
  • C.

    DataTable.Reset()
    SqlDataAdapter.Update(DataTable)
    
  • D.

    SqlDataAdapter.Update(DataTable)
    DataTable.Reset()
    
Question 43 Your application needs to load the contents of an XML file into memory. You do not need rich navigation through the XML file; a single pass to locate the data of interest is sufficient for the application. You also want to minimize the use of server resources. Which class should you use to implement this requirement?
  • A. XPathNavigator

  • B. XmlReader

  • C. XmlTextReader

  • D. XPathExpression

Question 44 You use a SqlDataAdapter object to fill a DataSet object with the contents of the Parts table in your database. The part name of the first part is “Windshield.” You synchronize an XmlDataDocument object with the DataSet object. In the DataSet object, you change the part name of the first part to “Wipers.” After that, in the XmlDataDocument object, you change the value of the corresponding node to “Windshield fluid.” When you call the Update method of the SqlDataAdapter object, what is the effect?
  • A. The part name in the table remains “Windshield.”

  • B. The part name in the table is updated to “Wipers.”

  • C. The part name in the table is updated to “Windshield fluid.”

  • D. The CLR throws an exception because you're trying to update the part name using the XmlDataDocument object.

Question 45 You are designing an application that will allow the user to read an XML file from the order's system and convert the XML file into a HTML file using style sheet DisplayOrders.xsl. Which object should you use to implement this requirement?
  • A. XPathNavigator

  • B. XslTransform

  • C. XmlSchema

  • D. XmlNode

Question 46 You are developing a contact-management application using Visual Basic .NET. You use the methods of the Trace and Debug classes to log serious error messages encountered during program execution. You want to record all such errors in the Windows event log. You do not want any duplicate entries for error messages in the event log. In what ways can you add a listener to the Windows event log? [Select two.]
  • A.

    Dim traceListener As EventLogTraceListener = _
       New EventLogTraceListener("CustomEventLog")
    Trace.Listeners.Add(traceListener)
    
  • B.

    Dim traceListener As EventLogTraceListener = _
       New EventLogTraceListener("CustomEventLog")
    Trace.Listeners.Add(traceListener)
    Debug.Listeners.Add(traceListener)
    
  • C.

    Dim traceListener As EventLogTraceListener = _
       New EventLogTraceListener("CustomEventLog")
    
  • D.

    Dim traceListener As EventLogTraceListener = _
       New EventLogTraceListener("CustomEventLog")
    Debug.Listeners.Add(traceListener)
    
Question 47 You have developed an online shipment-tracking Visual Basic ASP.NET Web application. The ShipmentStatus.aspx page in your application is displaying an incorrect shipping status for shipments. You want to view the tracing information for the page. What should you do?
  • A. Set the <trace> element in the Web.config configuration file of the application to this:

    <trace enabled="False" />
    
  • B. Set the <trace> element in the Web.config configuration file of the application to this:

    <trace enabled="True" />
    
  • C. Set the <trace> element in the Web.config configuration file of the application to this:

    <trace enabled="ShipmentStatus.aspx" />
    
  • D. Set the Trace attribute in the Page directive of the ShipmentStatus.aspx page to this:

    <%@ Page Trace="True" />
    
  • E. Set the Trace attribute in the Page directive of the ShipmentStatus.aspx page to this:

    <%@ Page Trace="False" />
    
Question 48 You use Visual Basic .NET to develop a component that allows developers to create bar graphs in their applications. You name the component BarGraph. The developers need to deploy the BarGraph component with each application that uses the component. How should you package the BarGraph component for deployment?
  • A. Use a Cab project to package the BarGraph component.

  • B. Use a Setup project to package the BarGraph component.

  • C. Use a Web Setup project to package the BarGraph component.

  • D. Use a Merge Module project to package the BarGraph component.

Question 49 You have created a database-driven Web application. Using Microsoft SQL Server, you have also generated an installation script for your database. This script is stored in a file named InstData.sql. You create a Web Setup project using Visual Studio .NET to deploy this application on your production Web server. Which of the following editors should you choose to create the database when deploying your application on the client's machine?
  • A. Custom Actions Editor

  • B. Launch Conditions Editor

  • C. File System Editor

  • D. User Interface Editor

Question 50 Your ASP.NET application contains this setting in the Web.config file:
<identity impersonate="True"
   userName="CORP\Auditing"
   password="Auditing"/>

You are allowing only digest or Windows integrated authentication in IIS. ASP.NET is running under the SYSTEM 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?

  • A. CORP\Shirley

  • B. ASPNET

  • C. SYSTEM

  • D. IUSR_Shirley

  • E. CORP\Auditing

Question 51 You create a serviced component named Books that is activated as a server application. This component is stored in the Books.dll assembly and is registered in the COM+ catalog. You need to debug the GetBooksList method of the serviced component. What should you do?
  • A. Open the Books solution. Set a breakpoint on the GetBooksList method. Start the debugger.

  • B. Open the solution for the client program. Set a breakpoint on the statement that calls the Books.GetBooksList method. Start debugging the client program.

  • C. Attach the debugger to the Books.dll process. Set a breakpoint on the GetBooksList method.

  • D. Attach the debugger to the dllhost.exe process. Set a breakpoint on the GetBooksList method.

Question 52 You've developed a Visual Studio .NET application that helps the shipping department in creating mix-and-match pallets. Users of the application complain that the numbers of cases in the pallet are not displayed correctly. To find the location of the error, you place a breakpoint on the GetCasesInPallet method. However, when you execute the program from the Visual Studio .NET environment, the execution does not break at the breakpoint. Which of the following actions should you take to resolve this problem?
  • A. Select Exceptions from the Debug menu.

  • B. Select Enable All Breakpoints from the Debug menu.

  • C. Select Build, Configuration Manager and set the project's configuration to Debug.

  • D. Select Build, Configuration Manager and set the project's configuration to Release.

Question 53 You are debugging your ASP.NET Web application; you are concerned about the amount of time 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?
  • A. System.Diagnostics.Trace

  • B. System.Diagnostics.Debug

  • C. System.Web.TraceContext

  • D. System.Web.UI.Page

Question 54 Your application contains this code:
Dim el As New EventLog()
el.Source = "MyLog"
el.WriteEntry("MyLog", _
 "Message", _
 EventLogEntryType.Error)

You have not called EventLog.CreateEventSource(“MyLog”) anywhere in your application, and the MyLog event log does not already exist. What happens when you execute this code?

  • A. A runtime error occurs.

  • B. The message is written to the MyLog event log.

  • C. The message is displayed in a message box.

  • D. The message is written to the Application event log.

Question 55 You have developed a remoting component that helps manage production schedules for a manufacturing company. The component is packaged as Production.dll. One of your applications uses this component, and you anticipate that in the future, some other applications may use classes from the Production.dll library. You may also need to maintain multiple versions of Production.dll. Which of the following options should you choose to deploy Production.dll? [Select all that apply.]
  • A. Sign Production.dll with sn.exe.

  • B. Sign Production.dll with signcode.exe.

  • C. Install Production.dll in the Windows system directory.

  • D. Install Production.dll in the application's bin directory.

  • E. Install Production.dll in the Global Assembly Cache.

Question 56 You are a programmer for a popular gaming software publishing company. The company has recently designed a series of games using the .NET Framework. All these new game applications share some components. Some of these components are shipped in the box with the application and others are deployed over the Internet. Which of the following commands will you use for these components before packaging it for deployment?
  • A. Use sn.exe to sign your components.

  • B. Use signcode.exe to sign your components.

  • C. Use sn.exe followed by signcode.exe to sign your components.

  • D. Use signcode.exe followed by sn.exe to sign your components.

Question 57 You develop a Windows-based application using Visual Basic .NET. Your code would like File I/O permission but can run without this permission. You plan to request the permission and trap the error if it is not granted. Which SecurityAction action should you use with the FileIOPermission object?
  • A. SecurityAction.RequestMinimum

  • B. SecurityAction.Demand

  • C. SecurityAction.RequestOptional

  • D. SecurityAction.RequestRefuse

Question 58 You would like to give target Web servers the ability to customize your application. In particular, you want to let them specify the file path where the output files need to be placed. You want to write minimal code. How should you add this capability to your application?
  • A. Let the users edit the text in the Registry and use the Microsoft.Win32.Registry class to retrieve the value that they save.

  • B. Add another customconfiguration.xml file to store the output file path for the application.

  • C. Add an <outputFilePath> element to the application configuration file, Web.config, to store the output file path for the application.

  • D. Add an <add> element to the <appSettings> element of the application configuration file, Web.config, to store the output file path for the application.

Question 59 Your ASP.NET application requires users to be authenticated with a strong identity. You must allow users with any version browser (4.x or better), and you want passwords to cross the network only with secure encryption. Which authentication should you use?
  • A. Passport authentication with anonymous IIS authentication

  • B. Windows authentication with Basic IIS authentication

  • C. Windows authentication with digest IIS authentication

  • D. Windows authentication with integrated IIS authentication

Question 60 You have developed an intranet ASP.NET application for your company that uses Microsoft Windows authentication to authenticate the users of the application. Once an employee is authenticated, he can access all the Web pages of the intranet application. However, your application has an Accounting directory that contains details of the salaries and pay checks of the employees. You want only users of the Accounting role to access the pages in this directory. Which of the following pieces of code should you write in the Web.config file of your application? [Select all that apply.]
  • A. Add the following <authorization> element in the Web.config file of the application directory:

    <authentication mode="Windows" />
    <authorization>
       <deny users="?" />
    </authorization>
    
  • B. Add the following <authorization> element in the Web.config file of the application directory:

    <authentication mode="Windows" />
    <authorization>
       <deny roles="?" />
    </authorization>
    
  • C. Add the following <authorization> element in the Web.config file of the Accounting directory:

    <authorization>
       <allow roles="Accounting" />
       <deny users="*" />
    </authorization>
    
  • D. Add the following <authorization> element in the Web.config file of the Accounting directory:

    <authorization>
       <allow roles="Accounting" />
       <deny users="?" />
    </authorization>
    
Question 61 Which of these tasks requires you to use imperative security rather than declarative security?
  • A. Refusing dangerous permissions such as Registry permission

  • B. Ensuring that your application has access to an environment variable whose name is not known until runtime

  • C. Ensuring that your application has access to a specific file whose name is known at design time

  • D. Ensuring that your application has access to a Jet database as a specific user.

Question 62 You use Visual Basic .NET to develop a remoting component called MortgageInterest that is packaged in MortgageInterest.dll version 1.0.0.0. MortgageInterest.dll is deployed into the GAC of the production server. After two months, you discover a bug in the assembly. You fix the bug by releasing a new version, 1.0.1.0, of the assembly. You place the newly created assembly in the GAC. What will happen to the applications that use MortgageInterest.dll?
  • A. The applications using the MortgageInterest.dll assembly will break because the applications will notice two versions of the assembly in the GAC and won't know which one to execute.

  • B. The applications using the MortgageInterest.dll assembly will notice a new version of the assembly and will load the new version of the assembly and cause no problems.

  • C. The applications using the MortgageInterest.dll assembly will not bother about the new version of the assembly in the GAC and will continue to use the older, buggy version of the assembly.

  • D. The applications using the MortgageInterest.dll assembly will be requested to select the desired assembly version to run for their application.

Question 63 You have developed a remoting assembly named RemoteServices that is a member of code groups as follows:
  • At the Enterprise level, the RemoteServices assembly is a member of All Code group that has the FullTrust permission set.

  • At the Machine level, the RemoteServices assembly is a member of All Code group and Sensitive code group. The All Code group has the LocalIntranet permission set, and the Sensitive code group has the Nothing permission set.

  • At the User level, the RemoteServices assembly is a member of Internet code group, which has the Internet permission set.

What permission set will the CLR assign to the RemoteServices assembly?

  • A. Nothing

  • B. Internet

  • C. LocalIntranet

  • D. FullTrust

Question 64 You have used Visual Basic .NET to build a Windows service to implement a custom networking protocol. Which tool can you use to install the Windows service for testing your program?
  • A. xcopy

  • B. Services MMC snap-in

  • C. gacutil

  • D. installutil

Question 65 In your company's monthly meeting, you have been assigned to increase the security in the organization so that malicious code cannot be executed. You have been asked to implement a security policy that allows users to execute applications locally and from the company's intranet, but users should not be allowed to execute code originating from the Internet. You want to complete this task with minimal effort. Which of the following actions should you take?
  • A. Modify the enterprise security policy.

  • B. Modify the machine security policy.

  • C. Modify the user security policy.

  • D. Modify the application domain security policy.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint