Visual Basic dot net Interview Questions and answers
Home PageC#- C#.NetASP.NetAdo.NetVB.NetWinFormRemotingWPFWCFWeb ServicesXMLIIS

Visual Basic - VB.Net Faqs

Visual Basic - VB.Net Faqs 2

  

 This is my MTMdump for 70-306.  Developing Windows-based Applications with Microsoft Visual Basic.Net.

    Not only TranDumper ready, but tested in TranDumper as well.  Don't you wish everyone did that?

    This dump includes the missing questions that some dumps have mentioned.

    Good luck all.

      1. You use Visual Studio.NET to develop an application for users on your company intranet. All client computers    use Internet Explorer as their Web browser.  You plan to create a setup package to distribute your application.

    The setup package must fulfill the following requirements:
    * It is placed in a network folder that is accessible to users.
          * It is accessible through a link on your company's intranet.
          * It includes an uninstaller for the application.

      Which type of project should you create?

      A. CAB project
      B. Merge module project.
      C. Setup project.
      D. Web setup project.

      Answer: D

      Note: Verified. To deploy a Web application to a Web server, you create a Web Setup project, build it, copy it to the Web server computer, and run the installer to install the application on the server using the settings defined in your Web Setup project.  Setup projects allow you to create installers in order to distribute an application. The resulting Windows Installer (.msi) file contains the application, any dependent files,    information about the application such as registry entries, and instructions for installation.

      2. You develop a Windows-based application by using Visual Studio. NET.  The application included numerous method calls at startup. After optimizing your application code, you test the application on a variety of client computers. However, the startup time is too slow.  You must ensure that your application starts as quickly as possible the first time it runs. What should you do?

      A. Precompile your application by using the Native Image Generator (Ngen.exe).
       Install the precompiled application on the client computers.
      B. Install your application on the client computers.
       Precompile your application by using the Native Image Generator (Ngen.exe).
      C. Precompile your application by using the JIT compiler.
       Install the precompiled application on the client computers.
      D. Install your application on the client computers.
       Precompile your application by using the JIT compiler.

      Answer: A

      Note: Verified.  Pre-compiling assemblies with Ngen.exe can improve the startup time for applications, because much of the work required to execute code has been done in advance. We precompile the application and then install it.

      3. You use Visual Studio .NET to create an application that will be distributed to employees within your company. You create and deploy a distribution package to test a computer running Windows 2000 Professional.  Later you discover that your name is listed as the support contact for your application by the Add/Remove Programs option of Control Panel. You need to change the support contact to the name of our help desk administrator. Which property of the setup project should you change?

      A. Author
      B. Comments
      C. Manufacturer
      D. Support Phone

      Answer: A

      Note: Verified.  The Author property specifies the name of the author of an application or component. Once the     application is installed, the property is also displayed in the Contact field of the Support Info dialog box.

      4. You use Visual Studio .NET to create an assembly that will be used by other applications, including a standard COM client application.  You must deploy your assembly and the COM application to a client computer. You must ensure that the COM application can instantiate components within the assembly as COM components.     What should you do?

      A. Create a strong name of the assembly by using the strong Name tool (Sn.exe).
      B. Generate a registry file for the assembly by using the Assembly Registration tool (Regasm.exe).
       Register the file on the client computer.
      C. Generate a type library for the assembly by using the Type Library Importer (Tlbimp.exe).
       Register the file on the client computer.
      D. Deploy the assembly to the global assembly cache on the client computer.
       Add a reference to the assembly in the COM client application.

      Answer: B

      Note: Verified.  The Assembly Registration tool reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently. Once a class is registered, any COM client can use it as though the class were a COM class. Not, Sn.exe - Strong Name, is used to give assemblies strong names for unique identification.

      5. You develop a Windows-based application by using Visual Studio .NET and Microsoft SQL server. The application will perform numerous Assert, Deny and Permit only security operations while it is executing. You must ensure that the application is optimized for fast run-time execution. What should you do?

      A. Perform declarative security checks
      B. Perform imperative security checks
      C. Perform all security checks by using SQL Server security
      D. Implement a custom security class that retrieves security information from the SQL Server database.

      Answer: A

      Note: Verified.  Declarative security checks in the application would be the fastest solution.

      6. Another developer in your company uses Visual Studio .NET to create a component named MyComponent.  You deploy MyComponent to a server. When you execute MyComponent, you receive the following error message:
 "System.Security.Policy.PolicyException: Failed to acquire required permissions." As quickly as possible, you need to discover which permissions are required by MyComponent. What should you do?

      A. Request the source code from the developer who created MyComponent.  Examine the source code to find the required
       permissions.
      B. Run the Microsoft CLR Debugger (DbgCLR.exe) on the server to view the permissions requested by the application at
       run time.
      C. Run the Runtime Debugger (Cordbg.exe) on the server to view the permissions requested by the application at run
       time.
      D. Run the Permissions View tool (Permview.exe) on the server to view the permissions required by MyComponent.
      E. Run the MSIL Disassembler (Iidasm.exe) on the server to view permissions requested by MyComponent that were denied.

      Answer: D

      Note: Verified.  Developers can use Permview.exe to verify that they have applied permission requests correctly
    to their code. Additionally, you can run Permview.exe to determine the permissions an assembly requires to execute.

      7. You use Visual Studio .NET to develop a Windows-based application whose project name is RetailMgmt. You create
    an application configuration file that will be installed on the client computer along with RetailMgmt. You must
      ensure that the settings in the application configuration file are applied when RetailMgmt is executed.
    What should you do?

      A. Name the configuration file RetailMgmt.exe.config and copy it to the Windows\Sytem32 folder
      B. Name the configuration file RetailMgmt.confing and copy it to the Windows\Sytem32 folder
      C. Name the configuration file RetailMgmt.exe.config and copy it to the application folder
      D. Name the configuration file RetailMgmt.confing and copy it to the Windows\Sytem32 folder
      E. Name the configuration file RetailMgmt.exe.config and copy it to the global assembly cache.

      Answer: C

      Note: Verified.  The configuration file for an application hosted by the executable host is in the same directory
    as the application. The name of the configuration file is the name of the application with a .config extension.
    In this scenario the configuration file should named RetailMgmt.exe.config and be placed in the application folder.

      8. You use Visual Studio .NET to develop a Windows-based application named Advocate Resource Assistant (ARA). ARA
    contains a class named Client. The Client class is defined by the following code segment:

      Namespace Fabrikam.Buslayer
         Public Class Client
            Public Function GetPhone(clientID as Integer) as String
               'More code goes here
            End Function
            'Other functions go here
         End Class
      End Namespace

      The client class is invoked from ARA by using the following code segment:

      Public Class ClientForm
         Inherits System.Windows.Forms.Form
         Private Sub SetPhoneNumber(ByVal PostalCode As String)
            Dim client as New Client()
            TextBox1.Text = client.GetPhone(postalcode)
         End Sub
      End Class

      When you try to build your project, you receive the following error message:
      "Type 'Client' is not defined."
    What are two possible ways to correct this problem? (Choose two)

      A. Fully qualify the Client class with the Fabrikam.BusLayer namespace.
      B. Fully qualify the Client class with ARA namespace.
      C. Import the Fabrikam.BusLayer namespace in the ClientForm class.
      D. Inherit the Fabrikam.BusLayer namespace in the ClientForm class.
      E. Declare the client object variable by using the WithEvents keyword.
      F. Declare the client object variable by using the Implements keyword.

      Answer: A, C

    Note: Verified.  A - We could use a fully qualified name; Fabrikam.Buslayer.Client and C - We could import the
    Fabrikam.BusLayer namespace by creating an alias: Imports client = Fabrikam.Buslayer.Client

      9. You develop a Windows-based application. Its users will view and edit employee attendance data. The application
    uses a DataSet object named customDataSet to maintain the data while users are working with it. After a user edits
    data, business rule validation must be performed by a middle-tier component named mycomponent. You must ensure that
    your application sends only edited data rows from customDataSet to mycomponent.
      Which code segment should you use?

      A. Dim changeDataSet As New DataSet
         If customDataSet.HasChanges then myComponent.Validate(changeDataSet)
      B. Dim changeDataSet As New DataSet
         If customDataSet.HasChanges then myComponent.Validate(customDataSet)
      C. Dim changeDataSet As DataSet = customDataSet.GetChanges()
         myComponent.Validate(changeDataSet)
      D. Dim changeDataSet As DataSet = customDataSet.GetChanges()
         myComponent.Validate(customDataSet)

      Answer: C

      Note: Verified.  DataSet.GetChanges method gets a copy of the DataSet containing all changes made to it since it
    was last loaded, or since AcceptChanges was called. It is used to create a second DataSet that features only the
      changes to the data.  We then validate the changes, the changedDataSet.

      10. You use Visual Studio .NET to create several applications that will be deployed commercially over the Internet. 
    You must ensure that customers can verify that authenticity of your software.
    Which action or actions should you take? (Choose all that apply)

      A. Sign your portable executables by using Signcode.exe
      B. Generate an X.509 certificate by using Makecert.exe
      C. Purchase an X.509 certificate from a certificate authority
      D. Purchase a Software Publisher Certificate from a certificate authority
      E. Convert your certificate to a Software Publisher Certificate by using Certspc.exe

      Answer: A, D

      Note: Verified.  D - We must use a Software Publisher Certificate from a certificate authority.  A - We then use this
    certificate to sign the portable executables with the Signcode.exe utility.

      11. You develop a Windows-based time and billing application.  You create a simple user interface to capture
    user-entered data.  The application passes an object array of user-entered values to a function named
    AddUpDataTimeEntry.  This function uses the LoadDataRow method of the Data Table object either to update an
    existing record in the table or to add a new record.  When you test your application, you frequently receive an
      exception of type InalidCastException.
    What is the cause of this error?

      A. You are trying to load a duplicate value into a Data Table column that has a unique constraint
      B. The number of items in your object array does not match the number of columns in the Data Table object.
      C. The data that you are trying to load into a column is not the correct data type specified for that column.
      D. The columns in your Data Table object do not have the AllowDBNull property set to true.

      Answer: C

      Note: Verified.  Unfortunatlly, I do this all to often.  InvalidCastException Class implements the exception
    that is thrown for invalid casting or explicit conversion.  An InvalidCastException is most often caused by an
    incorrect data type.

      12. You use Visual Studio .NET to create an assembly that will be consumed by other Visual Studio .NET applications.
    No permissions should be granted to this assembly unless the assembly makes a minimum permission request for them.
    Which code segment should you use?

      A. <PRE>&lt;Assembly: PermissionSet(SecurityAction.PermitOnly, Unrestricted := True)&gt;</PRE>
      B. <PRE>&lt;Assembly: PermissionSet(SecurityAction.PermitOnly, Unrestricted := False)&gt;</PRE>
      C. <PRE>&lt;Assembly: PermissionSet(SecurityAction.RequestOptional, Unrestricted := True)&gt;</PRE>
      D. <PRE>&lt;Assembly: PermissionSet(SecurityAction.RequestOptional, Unrestricted := False)&gt;</PRE>

      Answer: C

    Note: Verified.  Its quite interesting how most dumps have the correct answer for this question, without having
    anything in the answers.  Oh well.  The RequestOptional SecurityAction requests for additional permissions
      that are optional (not required to run). This action can only be used within the scope of the assembly.  The assembly
    must have permission to request additional permission.

      13. Your company standardizes on the .NET Framework as its software development platform. Subsequently, virus
    attacks cause your company to prohibit the execution of any applications downloaded from the Internet.
      You must ensure that all client computers on your intranet can execute all .NET applications originating from your
    company. You must also ensure that the execution of .NET applications downloaded from the Internet is prohibited.
    You must expend the minimum amount of administrative effort to achieve your goal. 
    Which policy should you modify?

      A. Application Domain
      B. Enterprise
      C. Machine
      D. User

      Answer: B

      Note: Verified.  An Enterprise policy applies to the whole domain of the company. It would require minimal
    administrative effort to set up.

      14. You create a user control named ScrollControl, which you plan to sell to developers. You want to ensure that
    ScrollControl can be used only by developers who purchase a license to use it. You decide to use a license provided
    implemented by the LicFileLicense Provider class.  Now you need to add code to ScrollControl to test for a valid
    control license.
    Which two code segments should you add? (Each correct answer represents part of the solution.  Choose two)

      A. <PRE>&lt;LicenseProvider(GetType(LicFileLicenseProvider))&gt;</PRE>
      B. <PRE>&lt;LicenseProvider(GetType(ScrollControl))&gt;</PRE>
      C. In the Load event handler for ScrollControl, place the following code segment:
         Try
            LicenseManger.Validate(GetType(ScrollControl))
         Catch ex As Exception
            'Insert code to disallow use.
         End Try
      D. In the Load event handler for ScrollControl, place the following code segment:
         Try
            Dim ControlLicense As License
            LicenseManger.Validate(GetType(ScrollControl), Me)
         Catch ex As Exception
            'Insert code to disallow use.
         End Try
      E. In the Load event handler for ScrollControl, place the following code segment:
         Try
            Dim bLicensed As Boolean
            bLicensed = LicenseManger.IsValid(GetType(ScrollControl))
         Catch ex As Exception
            'Insert code to disallow use.
         End Try
      F. In the Load event handler for ScrollControl, place the following code segment:
         Try
            Dim bLicensed As Boolean
            Dim ControlLicense As License
            bLicensed = LicenseManger.IsValid(GetType(ScrollControl), Me, ControlLicense)
         Catch ex As Exception
            'Insert code to disallow use.
         End Try

      Answer: A, D

      Note: Verified.  To enable licensing for your component 1 - Apply a LicenseProviderAttribute to the
    LicFileLicenseProvider class. (This is A) 2 - Call LicenseManager.Validate or LicenseManager.IsValid
    in the constructor. (This is D)

      15. You use Visual Studio .NET to create a Windows-based application. You need to make the application accessible
    to users who have low vision.  These users navigate the interface by using a screen reader, which translates
    information about the controls on the screen into spoken words.  The screen reader must be able to identify which
    control currently has focus. One of the TextBox controls in your application enables users to enter their names.
    You must ensure that the screen reader identifies this TextBox control by speaking the word "name" when a user
    changes focus to this control.
      Which property of this control should you configure?

      A. Tag
      B. Next
      C. Name
      D. AccessibleName
      E. AccessibleRole

      Answer: D

      Note: Verified.  The AccessibleName property is the name that will be reported to the accessibility aids.

      16. You develop a Windows-based application that creates XML output from a DataSet object. The XML output is created
    by using the DataSet.WriteXml method and then is sent to another application. The second application requires the output
    to appear in the following format:

    <PRE>&lt;employee id="3" name="Ron" age="39" /&gt;</PRE>

      You need to write code to specify the format for the XML output.
    Which code segment should you use?

      A. ds.WriteXml(dataFile, XmlWriteMode.WriteSchema)
      B. ds.WriteXml(dataFile, XmlWriteMode.IgnoreSchema)
      C. Dim c As DataColumn
       For Each c in ds.Tables("employee").Columns     c.ColumnMapping = MappingType.Attribute     Next
      D. Dim c As DataColumn
       For Each c in ds.Tables("employee").Columns     c.ColumnMapping = MappingType.Element     Next

      Answer: C

    Note: Verified.  Some dumps say A, that is not correct.

      17. You are developing a Windows-based application that logs hours worked by your employees. Your design goals
    require you to maximize application performance and minimize impact on server resources. You need to implement
      a SqlCommand object that will send an SQL INSERT action query to a database each time a user makes a new entry.
    To create a function named LineItemInsert, you write the following code:

      01 Function LineItemInsert(ByVal empid As Integer, Byval projectID As Integer, _
      02 ByVal hrs As Decimal, ByVal cnn As SqlConnection) As Integer
      03 Dim SQL As String
      04 Dim Ret As Integer
      05 SQL = "INSERT INTO TimeEntries " & (EmpID, ProjectID, Hours) " & _
      06 "VALUES (" & empID & ", " & projected & ", " & hrs & ")"
      07 Dim cmd As New SqlCommand(SQL, cnn)
      08
      09 'Insert new code
      10
      11 End Function


      Your code must execute the SQL INSERT action query and verify the number of database records that are
    affected by the query. Which code segment should you add on line 9?

      A. cnn.Open()
         Ret = Cmd.ExecuteNonQuery()
         Cnn.Close()
         Return Ret
      B. cnn.Open(0)
         Ret = Cmd.ExecuteScalar()
         Cnn.Close()
         Return Ret
      C. Dim reader as SqlDataReader
         cnn.Open()
         reader = Cmd.ExecuteReader()
         Cnn.Close()
         Return reader.RecordsAffected
      D. Dim reader as SqlDataReader
         cnn.Open()
         reader = Cmd.ExecuteReader()
         Cnn.Close()
         Return reader.GetValue()

      Answer: A

      Note: Verified.  The SqlCommand.ExecuteNonQuery Method Executes a Transact-SQL statement against the Connection
    and returns the number of rows affected. This is the most effective solution.  The SqlDataReader.RecordsAffected
    property gets the number of rows changed, inserted, or deleted by execution of the Transact-SQL statement.
      C and D - There is no need to use the ExecuteReader() method.

      18. You use Visual Studio .NET to develop Windows-based application. You implement security by using the security
    classes of the .NET Framework. Your application includes the follwing procedure.

      01 Public Sub ApproveVaction(Byval user1 as string, byval role1 as string, _
      02 byval user2 as string, byval role2 as string)
      03 dim principalperm1 as new principalpermission(user1, role1)
      04 dim principalperm2 as new principalpermission(user2, role2)
      05 'Insert new code.
      06 'Additional procedure code goes here
      07 End Sub

      You must ensure that both User1 and User2 are members of the same security roles.
    Which code segement should you insert on line 5?

      A. principalperm1.IsUnrestricted
         principalperm2.IsUnrestricted
      B. principalperm1.IsSubSetOf(principalperm2)
      C. principalperm1.Intersect(principalperm2).Demand()
      D. principalperm1.Union(principalper2).Demand()

      Answer: B

      Note: Verified.  The IsSubsetOf method returns true only if the identities and roles match exactly
    (or one of them are NULL).

      19. You use Visual Studio .NET to create an application that uses an assembly. The assembly will reside on the
    client computer when the application is installed. You must ensure that any future applications installed on the
    same computer can access the assembly.
    Which two actions should you take?  (Each correct answer represents part of the solution.  Choose two)

      A. Use XCOPY to install the assembly in the global assembly caches.
      B. Use XCOPY to install the assembly in the Windows\Assembly folder.
      C. Create a strong name for the assembly.
      D. Recompile the assembly by using the Native Image Generator (Ngen.exe).
      E. Modify the application configuration file to include the assembly.
      F. User a deployment project to install the assembly in the global assembly cache.
      G. User a deployment project to install the assembly in the Windows\System32 folder.

      Answer: C, F

      Note: Verified.  The global assembly cache stores assemblies specifically designated to be shared by several
    applications on the computer.  C - An assembly must have a strong name to be installed in the global assembly cache.
      F - There are two ways to install an assembly into the global assembly cache:
      • Using Microsoft Windows Installer 2.0. This could be achieved by a deployment project.
      • Using the Global Assembly Cache tool (Gacutil.exe). This is not an option here.

      20. You use Visual Studio. NET to develop a Windows-based application named PatTrac. It uses the security class
    libraries of the .NET framework to implement security. PatTrac will run within the context of a Windows 2000 domain
    named MedicalOffice. Calls to a remote Windows 2000 domain named Hospital will occur during the execution of PatTrac.
    You want PatTrac to log on the Hospital domain by using a generic user account.
    What should you do?

      A. Create a new instance of the WindowsImpersonationContext class by
       calling the Impersonate method of the Genericidentity object and passing
       the token of the user whom you want to impersonate.
      B. Create a new instance of the WindowsImpersonationContext class by calling the
       Impersonate method of the WindowsIdentify object and passing the token of
       the user whom you want to impersonate.
      C. Create a new instance of the ZoneIdentifyPermission class by calling
       the Impersonate method of the GenericPrincipal object and passing the
       token of the user whom you want to impersonate.
      D. Create a new instance of the ZoneIdentifyPermission class by calling
       the Impersonate method of the WindowsPrincipal object and passing the
       token of the user whom you want to impersonate.

      Answer: B

    Note: Verified.  We must impersonate another user. The WindowsImpersonationContext Class, not ZoneIdentifyPermission
    class, should be used.  Furthermore the Impersonate method must be used on an Windowsidentity object, not on a
    Genericidentity object.

      21. You use Visual Studio. NET to develop a Windows-based application. You plan to reuse a procedure written in Visual
    Basic 6.0. The procedure includes the following array declaration:

      Dim Employees (1 to 10) As String

      You copy and paste the array declaration from the Visual basic 6.0 proejct into the new VB .NET project. Now you must
    ensure that the Employees array will compile in the VB .NET application. What should you do?

      A. Include the Option Base 1 statement in the Declaration section of the module.
      B. Include the Option Base 0 statement in the Declaration section of the module.
      C. Replace the Dim statement with the following code segment: Dim Employees (0 to 9) As String
      D. Replace the Dim statement with the following code segment: Dim Employees (9) As String
      E. After the Dim statement, add the following code segment: ReDim Employees (0 to 9) As String
      F. After the Dim statement, add the following code segment: Dim Employees (9) As String

      Answer: D

      Note: Verified.  Array lower bounds is supported in Visual Basic 6.0, but not in Visual Basic .Net.

      22. You develop a Windows form that provides online help for users.  You want the help functionality to be
    available when users press the F1 key.  Help text will be displayed in a pop-up window for the text box that has
      focus. To implement this functionality, you need to call a method of the HelpProvider control and pass the
    text box and the help text.
    Which method should you call?

      A. SetShowHelp
      B. SetHelpString
      C. SetHelpKeyword
      D. ToString

      Answer: B

      Note: Verified.  To associate a specific Help string with another control, use the SetHelpString method.
    The string that you associate with a control using this method is displayed in a pop-up window when the
    user presses the F1 key while the control has focus.

      23. You use Visual Studio .NET to create a class library project. Another developer named Lilliane uses ASP.NET
    to create an Internet application for your company's Web site. Lilliane deploys your class library to the \bin
      folder of her ASP.NET application on your company's development Web server. She has access to your source code
    through a share on another network server.  Lilliane reports that her application can instantiate and use classes
    from your class library. However, when she is debugging her application, she cannot step into code within your class
    library.  You must ensure that developers who use your class library can step through the code for debugging purposes.
    Which three actions should you take? (Each correct answer represents part of the solution. Choose three)

      A. Use the Build Configuration Manager to set the Active Solustion Configuration option to Debug.
       Set the Project Configuration to Debug.  Build your class library.
      B. Add the class library project to the ASP.NET solution.
      C. Copy the .dll file from the Debug folder of the class library project to the \bin folder of the ASP.NET
       application.
      D. Copy the .pdb file from the Debug folder of the class library project to the \bin folder of the ASP.NET
       application.
      E. Copy the TempPE folder from Debug folder of the class library project to the \bin folder of the ASP.NET
       application.
      F. Copy the source code from the class library to the ASP.NET application folder on the Web server.
      G. Register the class library on the Web server by using RegSvr323.exe.

      Answer: A, C, D

    Note: Verified.

      24. You use Visual Studio .NET to create a Windows-based application that will be distributed to your customers. You add
    a setup project to your solution to create a distribution package.  You deploy the distribution package on a test computer. 
    However, you discover that the distribution package does not create a shortcut to your application on the Programs menu of
    the test computer.  You need to modify your setup project to ensure that this shortcut will be available on your customers
    Programs menus.
    What should you do?

      A. Navigate to the User's programs Menu folder in the File System on the
         Target machine hierarchy. Add the primary output from your application.
      B. Navigate to the User's programs Menu folder in the File System on
         Target machine hierarchy. Create a shortcut to your application and move
         the shortcut to the User's Programs Menu folder in the same hierarchy.
      C. Navigate to the Install folder in the Customer Actions hierarchy.
         Create a custom action that adds the primary output from your application
         to the User's Programs Menu folder.
      D. Navigate to the Install folder in the Customer Actions hierarchy.
         Create a custom action that adds a shortcut to your application's
         executable file to the User's Programs Menu folder.

      Answer: A

    Note: Verified.

      25. You develop a Windows-based application that enables users to enter and edit customer order.  The application
    contains a DataSet object named orderEntryDataSet and DataTable object named orderDataTable and orderDetailDataTable.
    orderDetailDataTable requires two columns to make a unique primary key.  You need to define a primary key for
    orderDetailDataTable.
    What should you do?

      A. Set the DataTable.PrimaryKey property to a string value that lists the column names that make the primary key.
      B. Set the DataTable.PrimaryKey property to an array of DataColumn objects that reference the column that make
       the primary key.
      C. Iterate through the DataTable.Columns collection and set the DataType property of the columns that make
       the primary key.
      D. Create a UniqueConstraint on the columns that make the primary key.

      Answer: B

    Note: Verified.

      26. You use Visual Studio .NET to develop a component named MyComponent. You plan to develop several client applications
    that use MyComponent.  You need to deploy MyComponent with each of these applications.  You will create a distribution
    package to be included with each application.
    Which type of project should you create?

      A. CAB project.
      B. Merge module project.
      C. Setup Project.
      D. Web setup project.

      Answer: B

    Note: NOT Verified!

      27. You develop a Windows-based inventory management application that interacts with a Microsoft SQL Server database. Your
    application enables users to update information about items in inventory. Each time a user changes an inventory item, your
    application executes a SQL Server stored procedure to update rows in the database. The stored procedure will run many times
    during each user session.  Your application will use a SqlCommand object to execute the stored procedure. You must revise your
    code so that the use of this object optimizes query performance.
    What should you do?

      A. Call the SqlCommand.DeriveParameters method before each call to SqlCommand.ExecuteNonQuery.
      B. Call the SqlCommand.Prepare method before each call to SqlCommand.ExecuteNonQuery.
      C. Call the SqlCommand.DeriveParameters method before the first call to SqlCommand.ExecuteNonQuery.
      D. Call the SqlCommand.Prepare method before the first call to SqlCommand.ExecuteNonQuery.

      Answer: D

    Note: Verified

      28. You use Visual Studio .NET to create a Windows-based application. Your application will be used by five
    customer service representatives to access a central database.  All five representatives use client computers
      that are connected to the company intranet.  All client computers have Windows XP Professional and the .NET
    Framework installed.  When you distribute the application, you must ensure that it uses the smallest possible
    hard disk space on the client computers.
    What should you do?

      A. Copy your application to each client computer. Create a shortcut to your application on the desktop of each
       client computer.
      B. Copy your application to a shared folder on your company intranet.  Create a shortcut to your application on
       the desktop of each client computer.
      C. Create a distribution package by using the Visual Studio.NET Setup Wizard.  Exclude the dependency for the .NET
       Framework. Install the distribution package on each client computer.
      D. Create a distribution package by using the Visual Studio.NET Setup Wizard.  Set the distribution package's
       Compression property to Optimized for size. Install the distribution package on each client computer.

      Answer: A

    Note: Verified.

      29. You use Visual Studio .NET to develop a Windows-based application.  Your application will display customer order
    information from a Microsoft SQL Server database. The orders will be displayed on a Windows Form that includes a
    DataGrid control named DataGrid1. DataGrid1 is bound to a DataView object. Users will be able to edit order information
    directly in DataGrid1.  You must give users the option of displaying only edited customer orders and updated values in
    DataGrid1.
      What should you do?

      A. Set the RowStateFilter Property of the DataView object to DataViewRowState.ModifiedOriginal.
      B. Set the RowStateFilter Property of the DataView object to DataViewRowState.ModifiedCurrent.
      C. Set the RowFilter Property of the DataView object to DataViewRowState.ModifiedOriginal.
      D. Set the RowFilter Property of the DataView object to DataViewRowState.ModifiedCurrent.

      Answer: B

    Note: Verified.

      30. You plan to develop a customer information application that uses a Microsoft SQL Server database. This application
    will be used frequently by a large number of users. Your application code must obtain the fastest possible performance
    when accessing the database and retrieving large amounts of data. You must accomplish this goal with the minimum amount
    of code.
    How should you design your application?

      A. Use classes in the System.Data.OleDb namespace.
      B. Use classes in the System.Data.SqlClient namespace.
      C. Use remoting to connect to the SQL Server computer.
      D. Use interoperability to include legacy COM-based data access components.

      Answer: B

    Note: Verified.

      31. You need to create an OleDbCommand object to retrieve information about postal codes for your mailing list
    application. You create an OleDbConnection object named conn. You need to instantiate the OleDBCommand object
    and set the CommandText and Connection properties.
    What are two possible code segments for you to use? (Each correct answer represents a complete solution. Choose two)

      A. Dim comm As New OleDbCommand()
         comm.CommandText ="SELECT * FROM Regions"
         comm.Connection = conn
      B. Dim comm As New OleDbCommand("sp_GetRegions", conn)
         comm.CommandType = CommandType.Text
      C. Dim comm As New OleDbCommand("SELECT * FROM Regions", conn)
         comm.CommandType = CommandType.Text
      D. Dim comm As New OleDbCommand("sp_GetRegions", conn)
         comm.CommandType = CommandType.TableDirect
      E. Dim comm As New OleDbCommand()
         comm.CommandType ="SELECT * FROM Regions"
         comm.Connection = conn

      Answer: A, C

    Note: Verified.

      32. You develop a Windows-based application by using Visual Studio .NET.  The application uses a SqlConnection
    object for database access.  You typically run this application on a computer that has limited RAM and hard disk
    space.  After the code finishes using the SqlConnection object, you must ensure that the connection is closed and
    that any resources consumed by the object are released immediately.
    What should you do?

      A. Call the Finalize method of the SqlConnection object.
      B. Call the Dispose method of the SqlConnection object.
      C. Set the SqlConnection object equal to nothing.
      D. Set the SqlConnection object equal to "".

      Answer: B

    Note: Verified.

      33. You use Visual Studio .NET to create an application that will be deployed to several client computers.
      You plan to create a setup package to distribute your application. Because of licensing restrictions, you must
    ensure that the setup package can be installed only on computers that have a particular registry key. 
    What should you do?

      A. Add a registry key to the setup project. Set the Transitive property of your key to True.
      B. From the Properties window, set the private key file option to the registry key.
      C. From the Launch Conditions window, add a search for the registry key.  Add a launch condition to evaluate
       the search results.
      D. Open the setup project source code in Visual Studio.NET. Add code to search for the registry key and to abort
       the setup of the registry key does not exist on the client computer. Recompile setup1.exe and include it
         with your setup package.

      Answer: C

    Note: Verified.

      34. You develop a Windows-based order entry application by using Visual Studio .NET. The application includes a
    DataSet object. When a customer order exceeds the number of items currently available in stock, the application must
    create two separate entries in a database.  The first entry specifies the total number of items in the customer order,
      as well as the number of items that can be supplied immediately from available stock. The second entry records
    backorder information, and specifies the number of items that must be supplied when new stock becomes available.
      Backorder processing is handled by a separate component. You must ensure that all order information in the DataSet
    object is captured and passed to this component. To do so, you need to create a new DataSet object.
    Which method should you use?

      A. DataSet.Clone
      B. DataSet.Copy
      C. DataSet.Merge
      D. DataSet.GetChanges

      Answer: D

    Note: Verified.

      35. You develop a Windows-based application. You plan to use ADO.NET to call a Microsoft SQL Server stored procedure
    named EmployeeData.  This procedure accepts a parameter for querying the database by an employee's family name.  You
    need to add code to your application to set up the parameter for use with the stored procedure.
      Which three lines of code should you add? (Each correct answer represents part of the solution. Choose three.)

      A. Dim parm1 As New SqlParameter()
      B. Dim parm1 As New SqlParameter("@FamilyName", SqlDbType.VarChar)
      C. parm1.Direction = ParameterDirection.Input
      D. parm1.Direction = ParameterDirection.InputOutput
      E. cmd.Parameters.Add(parm1)
      F. parm1.Add (cmd)

      Answer: B, C, E

    Note: Verified.

      36. You develop a Windows-based application that uses several functions to calculate a given inventory quantity. This quantity
    is stored in a variable named IQuantity.  When you test your application, you discover that the value of IQuantity sometimes falls
    below zero.  For debugging purposes, you want your application to generate an error message in such cases. You also want to be
    able to view the call stack to help identify the function call that is causing the miscalculation. You need to insert additional
    code after the calculation of IQuantity.
    Which code segment should you use?

      A. Trace.Assert(IQuantity >= 0, "Inventory cannot be less than zero.")
      B. Trace.Assert(IQuantity < 0, "Inventory cannot be less than zero.")
      C. Trace.Fail(IQuantity >= 0, "Inventory cannot be less than zero.")
      D. Trace.WriteLineIf(IQuantity < 0, "Inventory cannot be less than zero.")

      Answer: A

    Note: Verified.

      37. Your development team creates an order entry application by using
      Visual Studio .NET. The application stores and retrieves data in a
      Microsoft SQL Server database. All database connections in the application
      are centralized in class variables within a class named MyDataClass.
      Each time your application needs to access data from the database, it
      creates an instance of MyDataClass by using the following code segment:

      Dim oData As New MyDataClass()

      When the oData variable is no longer needed, it is set to Nothing or goes out of scope. Initially, about 500 sales
    representatives use the application. Later, your company hires 50 new sales representatives who also use the application.
    You discover that the database is running out of available connections because of the increased usage. You must ensure
    that database connections are released immediately when they are no longer needed.  You must also maintain an optimum
    level of application performance.
    What should you do?

      A. Add the procedure Protected Overrides Finalize() to MyDataClass.
         Write code in the procedure to close all open database connections.
      B. Add the procedure Private Sub Finalize() to MyDataClass.
         Write code in the procedure to close all open database connections.
      C. Implement the IDisposable interface within MyDataClass. Write code in the Dispose
         procedure of IDisposable to close all open database connections. Call the
         Dispose method of MyDataClass before any reference to MyDataClass is set
         to Nothing or goes of scope.
      D. Find each location in your code where a reference to MyDataClass is set
         to nothing or goes out of scope. Add code after each instance to manually
         invoke the Visual Studio.NET garbage collector.
      E. Add code to the Terminate event of MyDataClass to close all open database connections.
      F. Ensure that each reference to MyDataClass is set to Nothing before it goes of scope.

      Answer: A

    Note: A is Verified.  C in other dump is wrong.

      38. You develop a contact management application that will enable users to retrieve information from a central
    database.  After the data is returned to your application, users must be able to view it, edit it, add new
      records, and delete existing records. All user changes must then be saved in the database.  Your application
    design requires several ADO.NET objects to work together to accomplish these requirements.  You use classes from
    the System.Data and System.Data.OleDb namespaces. First you write the code to connect to the database.
    Which four actions should you take next? (Each correct answer represents part of the solution. Choose four.)

      A. Create an OleDbDataAdapter object and define the selectCommand property.
      B. Create an OleDbCommand object and use the ExecuteScalar method.
      C. Create a DataTable object as a container for the data.
      D. Create a DataSet object as a container for the data.
      E. Call the DataAdapter.Fill method to populate the DataSet object.
      F. Call the DataAdapter.Update method to populate the DataSet object.
      G. Call the DataAdapter.Update method to save changes to the database.
      H. Call the DataSet.AcceptChanges method to save changes to the database.

      Answer: A, D, E, G

    Note: Verified.

      39. You use Visual Studio .NET to develop a Windows-based application for your human resources (HR) department. The HR
    department has two subdivisions named Benefits and Employee Information.  The Benefits subdivision includes the Vacation
    group.  Both subdivisions will use your application.  You plan to create four forms modeled after the organizational
    structure of the HR department.  The forms will be named HR, EmployeeInformation, Benefits, and Vacation.  The forms must
    be arranged in a hierarchy so that each form includes all code and controls found on the forms above it, in the hierarchy. 
    The form at the top of the hierarchy will be a standard Windows Form.  The form must also adhere to the following rules:

    * All forms should include code to access the general HR database.
      * Only forms used by the Benefits subdivision should have access to the Benefits database table.
      * The forms used by the Employee Information subdivision should have access to the EmployeeInformation database table.
      * The forms used by the Vacation group should include custom code to calculate vacation time.

      Now you must create the form hierarchy. Which code segment should you use?

    A. Public Class HR
          Inherits System.Windows.Forms.Form
       End Class
       Public Class Benefits
          Inherits System.Windows.Forms.Form
          Implements HR
       End Class
       Public Class Vacation
          Inherits System.Windows.Forms.Form
          Implements Benefits
       End Class
       Public Class EmployeeInformation
          Inherits System.Windows.Forms.Form
        Implements HR
       End Class

    B. Public Class HR
          Inherits System.Windows.Forms.Form
       End Class
       Public Class Benefits
          Inherits System.Windows.Forms.Form
          Implements HR
       End Class
       Public Class Vacation
          Inherits System.Windows.Forms.Form
          Implements Benefits
       End Class
       Public Class EmployeeInformation
          Inherits System.Windows.Forms.Form
        Implements Benefits
       End Class

    C. Public Class HR
          Inherits System.Windows.Forms.Form
       End Class
       Public Class Benefits
          Inherits HR
       End Class
       Public Class Vacation
          Inherits Benefits
       End Class
       Public Class EmployeeInformation
          Inherits HR
       End Class

    D. Public Class HR
          Inherits System.Windows.Forms.Form
       End Class
       Public Class Benefits
          Inherits HR
       End Class
       Public Class Vacation
          Inherits Benefits
       End Class
       Public Class EmployeeInformation
          Inherits Benefits
       End Class

      Answer: C

    Note: Verified.  Some dumps show the rules as the possible answers.  Not good!

      40. You use Visual Studio .NET to develop a Microsoft Windows-based application. Your application contains a
    form named CustomerForm, which includes the following design-time controls:
          * SQLConnection object named NorthwindConnection
          * SQLDataAdapter object named NorthwindDataAdapter
          * DataSet object named CustomerDataSet
          * Five TextBox controls to hold the values exposed by CustomerDataSet
          * Button control named saveButton
      At design time you set the DataBindings properties of each TextBox control to the appropriate column in the
    DataTable object of CustomerDataSet.  When the application runs, users must be able to edit the information
      displayed in the text boxes.  All user changes must be saved to the appropriate database when saveButton is
    executed.  The event handler for saveButton includes the following code segment:

      NorthwindDataAdapter.Update(CustomerDataSet)

      You test the application. However, saveButton fails to save any values edited in the text boxes.You need to
    correct this problem. 
    What should your application do?

      A. Call the InsertCommand method of NorthwindDataAdapter.
      B. Call the Update method of NorthwindDataAdapter and pass in NorthwindConnection.
      C. Before calling the Update method, ensure that a row position change occures in CustomerDataSet.
      D. Reestablish the database connection by calling the open method of NorthwindConection.

      Answer: B

      Note: Verified.  Dataset is a container; therefore, you need to fill it with data. You can populate a dataset by
    calling the Fill method of a data adapter.

      41. You use Visual Studio .NET to create an accounting application.  Within this application, you are debugging a
    function named CreditCardValidate.  This function contains several dozen variables and objects. You create a breakpoint
    at the top of CreditCardValidate and run the application within the Visual Studio .NET IDE.  As you step though the code
    in CreditCardValidate, you need to examine the contents of the bValidationStatus variable.  However, you want to avoid
    seeing the contents of all variables and objects within CreditCardValidate. You also need to complete the debugging
      process as quickly as possible.
      What should you do?

      A. Add a watch expression for CreditCardValidate.
      B. Open the Locals window.
      C. Open a QuickWatch dialog box for CreditCardValidate.
      D. From the Command window, print the contents of each variable by using
       CreditCardValidate.

      Answer: A

    Note: Verified.  I say, Not C, because Ctrl+alt+q - Displays the quick watch dialog box with the current value of the
    selected expression.  But you have to close and reopen the quick watch to see the current value and the question stated
    "As you step though the code" and "complete the debugging process as quickly as possible.  If bValidationStatus is the
    only expression you add to the watch window, you won't see the other variables.

      42. You develop a Windows-based application that connects to a Microsoft SQL Server database. Errors sometimes
    occur when users execute stored procedures in the database. You need to add error-handling code to your application
    to capture detailed information about any stored procedure that causes an error.
      Which code segment should you use?

      A. Try
            myConnection.Open()
         Catch e as exception
            'Insert error-handling code.
         End try

      B. Try
            myConnection.Open()
         Catch e as SQLException
            'Insert error-handling code.
         End try

      C. Try
            myConnection.Open()
         Catch e as DataException
            'Insert error-handling code.
         End try

      D. Try
            myConnection.Open()
         Catch e as DBConcurrencyException
            'Insert error-handling code.
         End try

      Answer: B

    Note: Verified.

      43. You develop a Windows-based application named Payroll. Your application receives information in the form of an XML
    data file named dataFile. This file does not include any schema information. You need to write code to load the XML data
    into a DataSet object.
    Which code segment should you use?

      A. Dim ds As New DataSet("PayrollData")
         ds.readXml(dataFile, XmlReadMode.IgnoreSchema)
      B. Dim ds As New DataSet("PayrollData")
         ds.readXml(dataFile, XmlReadMode.InferSchema)
      C. Dim ds As New DataSet("PayrollData")
         ds.readXml(dataFile, XmlReadMode.ReadSchema)
      D. Dim ds As New DataSet("PayrollData")
         ds.readXml(dataFile, XmlReadMode.Fragment)

      Answer: B

    Note: Verified (In Transcender as well)

      44. You develop a Windows-based customer service application that includes a search feature. Users will enter characters
    in a text box to look up customer information by family name.  For convenience, users must be able to perform a search by
    entering only the first few characters of the family name. To enable this functionality, your application will capture the
    users input and store it in a variable named CustomerName. Your application must then submit a Microsoft SQL Server query
    to the central customer service database.
    How should you write the query?

      A. SQL = "SELECT PersonalName, FamilyName FROM Customers WHERE FamilyName = '" & CustName & "%'"
      B. SQL = "SELECT PersonalName, FamilyName FROM Customers WHERE FamilyName LIKE '" & CustName & "%'"
      C. SQL = "SELECT PersonalName, FamilyName FROM Customers WHERE FamilyName = '" & CustName & "*'"
      D. SQL = "SELECT PersonalName, FamilyName FROM Customers WHERE FamilyName LIKE '" & CustName & "*'"

      Answer: B

    Note: Verified.  As everyone knows, the LIKE stmt is used for sub searches along with the %.

      45. You use Visual Studio .NET to create a Windows-based application. The application captures screen shots of a
    small portion of the visible screen. You create a form named CameraForm. You set the CameraForm.BackColor property
    to Blue. You create a button on the form to enable users to take a screen shot. Now, you need to create a
    transparent portion of CameraForm to frame a small portion of the screen. Your application will capture an image
    of the screen inside the transparent area.
      The resulting appearance of CameraForm is shown in the exhibit:

    * Not shown!

      You add a Panel control to CameraForm and name it transparentPanel. You must ensure that any underlying
    applications will be visible within the panel.
    Which two actions should you take? (Each correct answer represents part of the solution. Choose two.)

      A. Set transparentPanel.BackColor to Red.
      B. Set transparentPanel.BackColor to Blue.
      C. Set transparentPanel.BackgroundImage to None.
      D. Set transparentPanel.Visible to False.
      E. Set CameraForm.Opacity to 0%.
      F. Set CameraForm.TransparencyKey to Red.
      G. Set CameraForm.TransparencyKey to Blue.

      Answer: A, F

      Note: Verfied.  A - Will set the Background color of the Panel to Red. F - Will then set the transparency color of
    the Form to Red as well. This will make only the Panel transparent, since the background color of the form is Blue.

      46. You develop a Windows-based application to manage business contacts.  The application retrieves a list of
    contacts from a central database. The list of contacts is managed locally in a DataSet object named contactDataSet.
    To set the criteria for retrieval, your user interface must enable users to type a city name into a TextBox control.
    The list of contacts that match this name must be displayed in a DataGrid control.
    Which code segment should you use?

      A. Dim dv As New DataView()
         With dv
            .Table = contactDataSet.Tables(0)
            .RowFilter = TextBox1.Text
         End With
         DataGrid1.DataSource = dv
      B. Dim dv As New DataView()
         With dv
            .Table = contactDataSet.Tables(0)
            .RowFilter = "City = '" & TextBox1.Text & "'"
         End With
         DataGrid1.DataSource = dv
      C. Dim dv As New DataView()
         With dv
            .Table = contactDataSet.Tables(0)
            .Sort = TextBox1.Text
         End With
         DataGrid1.DataSource = dv
      D. Dim dv As New DataView()
         With dv
            .Table = contactDataSet.Tables(0)
            .Sort = "city = '" & TextBox1.Text & "'"
         End With
         DataGrid1.DataSource = dv

      Answer: B

      Note: Verified.  To form a RowFilter value, specify the name of a column followed by an operator and a value to
    filter on. The value must be in quotes. Here we use construct the rowfilter with the = operator, string
    concatenation (&) and the TextBox1.Text property.

      47. You develop a Windows-based application named Purchase that exchanges data with an accounting application.
    Purchase receives purchase order data from the accounting application in XML format.  Users of Purchase review
    and edit the data. Purchase maintains the data in a DataSet object while users are working. When they are finished
    making changes, Purchase must create an output file that will be returned to the accounting application. For
      verification and auditing purposes, the accounting application must receive both the user changes and the original
    values. Now you need to write code that will create the output file.
    What should you do?

      A. Call the DataSet.WriteXmlSchema method and specify a TextWriter object as the argument.
      B. Call the DataSet.WriteXmlSchema method and specify an XmlWriter object as the argument.
      C. Call the DataSet.WriteXml method and specify WriteSchema as the XmlWriteMode parameter.
      D. Call the DataSet.WriteXml method and specify DiffGram as the XmlWriteMode parameter.

      Answer: D

      Note: Verified.  A DiffGram is an XML format that is used to identify current and original versions of data
    elements. Here we use the DataSet.WriteXml method with the Diffgram XmlWriteMode to write the entire DataSet as
    a DiffGram, including original and current values.

      48. You develop an application that enables users to enter and edit purchase order details. The application
    includes a Windows Form named DisplayPOForm. The application uses a client-side DataSet object to manage data.
    The DataSet object contains a Data Table object named PODetails.  This object includes one column named Quantity
    and another named UnitPrice. For each item on a purchase order, your application must display a line item total
    in a DataGrid control on DisplayPOForm.  The line item is the product of Quantity times UnitPrice.  Your database
    design does not allow you to store calculated values in the database.  You need to add code to your Form_Load
    procedure to calculate and display the line item total.
    Which code segment should you use?

      A. Dim totalColumn As New DataColumn("Total", Type.GetType("System.Decimal"))
         PODetails.Columns.Add(totalColumn)
         totalColumn.Expression = "Quantity * UnitPrice"
      B. Dim totalColumn As New DataColumn("Total", Type.GetType("System.Decimal"))
         PODetails.Columns.Add(totalColumn)
         totalColumn.Equals("Quantity * UnitPrice")
      C. PODetails.DisplayExpression("Quantity * UnitPrice")
      D. PODetails.DisplayExpression("quantityColumn + unitPriceColumn")

      Answer: A

      Note: Verified.  We use the Expression property of the DataColumn object to calculate the values in the column.

      49. Your company uses Visual Studio .NET to develop internal applications.  You create a Windows control that will
    display custom status bar information. Many different developers in your company will use the control to display the
    same information in many different applications.  The control must always be displayed at the bottom of the parent form
    in every application. It must always be as wide as the form. When the form is resized, the control should be resized and
    repositioned accordingly.
      What should you do?

      A. Create a property to allow the developers to set the Dock property of the control.
         Set the default value of the property to AnchorStyle.Bottom.
      B. Create a property to allow the developer to set the Anchor property of the control.
         Set the default value of the property to AnchorStyle.Bottom.
      C. Place the following code segment in the UserControl_Load event: Me.Dock = DockStyle.Bottom
      D. Place the following code segment in the UserControl_Load event: Me.Anchor = AnchorStyle.Bottom

      Answer: C

      Note: Verified.  DockStyle.Bottom docks the control to the bottom of the form. This will force the control
    to be as wide as to form. Furthermore the control will be resized automatically.

      50. You use Visual Studio .NET to develop applications for your human resources department. You create the
    following interfaces:
      Public Interface IEmployee
         Property Salary() As Double
      End Interface
      Public Interface IExecutive
         Inherits IEmployee
         Property AnnualBonus() As Double
      End Interface
      The IEmployee interface represents a generic Employee concept. All actual employees in your company should be
    represented by interfaces that are derived from IEmployee.  Now you need to create a class named Managed to
    represent executives in your company. You want to create this class by using the minimum amount of code.
      You write the following code:
      Public Class Manager
      End class
      Which additional code segment or segments should you include in Manager?  (Choose all that apply)

      A. Implements IExecutive
      B. Implements IEmployee, IExecutive
      C. Inherits IExecutive
      D. Inherits IEmployee, IExecutive
      E. Property Salary() As Double Implements IExecutive.Salary
      F. Property AnnualBonus() As Double Implements IExecutive.AnnualBonus

      Answer: A, E, F

      Note: Verified.  The Manager Class only needs to inherit from the IExecutive class.  The Manager class inherits
    the AnnualBonus property from the IExecutie class and the Salary property from the IEmployee class (since
    IExecutive inherits from IEmployee). There is no need to define any properties for the new class.

      51. Your development team is creating a new Windows-based application for a mortgage company. The application
    consists of a user interface and several XML Web services. You develop all XML Web services and perform unit
      testing. Now you are ready to write the user interface code. Because some of your servers are being upgraded,
    the XML Web service that provides mortgage rates is currently offline. However, you have access to its
      description file. You must begin writing code against this XML Web service immediately.
    What should you do?

      A. Generate the proxy class for the XML Web service by using Disco.exe.
      B. Generate the proxy class for XML Web service by using Wsdl.exe.
      C. Obtain a copy of the XML Web service assembly and register it on your local development computer.
      D. Add the description file for the XML Web service to your Visual Studio .NET project.

      Answer: B

      Note: Verified.  Ordinarily to access an XML Web service from a client application, you first add a Web reference,
    which is a reference to an XML Web service. When you create a Web reference, Visual Studio creates an XML Web
    service proxy class automatically and adds it to your project. However, you can manually generate a proxy class
    using the XML Web services Description Language Tool, Wsdl.exe, used by Visual Studio to create a proxy class
      when adding a Web reference. This is necessary when you are unable to access the XML Web service from the machine
    on which Visual Studio is installed, such as when the XML Web service is located on a network that will not be
    accessible to the client until run time. You then manually add the file that the tool generated to your application
    project.

      52. You develop a Windows-based application that includes the following code segment.
       (Line numbers are included for reference only.)
      01 Public Sub password_Validating (ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)
      02 Handles password.Validating
      03 If ValidPassword() = False Then
      04 'Insert new code.
      05 End If
      06 End Sub

      You must ensure that users cannot move control focus away from textPassword if ValidPassword returns a value of
    False. You will add the required code on line 4.
      Which code segment should you use?

      A. e.Cancel = True
      B. sender = textName
      C. password.AcceptsTab = False
      D. password.CausesValidation = False

      Answer: A

      Note: Verified.  We cancel the validation of the control.

      53. You develop a Windows-based application that contains a class named
      Contact. Contact contains an event named ContactSaved. Many Contact
      objects will be created from the Contact class and inserted into an array
      named Contacts. You create a custom method named HandleContactSaved in
      your application. You must ensure that your application calls HandleContactSaved
    whenever the ContactSaved event is fired for any of the Contact objects.
    What should you do?

      A. Use the WithEvents keyword to declare each Contact object.
         Add each Contact object to the Contacts array as it is created.
      B. Add each Contact object to the Contacts array as it is created.
         Add the Handles keyword to HandleContactSaved.
      C. Add each Contact object to the Contacts array as it is created.
         Assign HandleContactSaved to the Handle property of the HandleRef structure.
      D. Add each Contact Object to the Contacts array as it is created.
         Call the AddHandler statement and pass the new Contact object and the address of HandleContactSaved.

      Answer: D

      Note: Verified.  The standard way to create an event handler is to use the Handles keyword with the WithEvents keyword.
    You can use the AddHandler statement to dynamically connect events with event handler procedures. To handle events using
    AddHandler 1 - Declare an object variable of the class that is the source of the events you want to handle.  2 - Use the
    AddHandler statement to specify the name of the event sender, and the AddressOf statement to provide the name of your
    event handler.

      54. You develop an enterprise application that includes a Windows Forms presentation layer, middle-tier
    components for business logic and data access, and a Microsoft SQL Server database.  You are in the process
    of creating a middle-tier component that will execute the data access routines in your application.
    When data is passed to this component, the component will call several SQL Server stored procedures to perform
    database updates. All of these procedure calls run under the control of a single transaction.  The code for the
    middle-tier will implement the following objects:
         Dim cn As New SqlConnection()
         Dim tr As SqlTransaction
      If two users try to update the same data concurrently, errors will occur. You must add code to your component
    to specify the highest possible level of protection against such errors.
    Which code should you use?

      A. tr = cn.BeginTransaction("ReadCommitted")
      B. tr = cn.BeginTransaction(IsolationLevel.ReadCommitted)
      C. tr = cn.BeginTransaction(IsolationLevel.Serializable)
      D. tr = cn.BeginTransaction("Serializable")

      Answer: C

      Note: Verified.  Serializable is the highest isolation transaction level. It provide the highest possible level
    of protection against concurrent data errors.  The correct syntax to begin a transaction with this transaction
    isolation level is: cn.BeginTransaction(IsolationLevel.Serializable)

      55. You develop a Windows-based application. The application uses a DataSet object that contains two DataTable
    objects. The application will display data from two data tables. One table contains customer information, which
      must be displayed in a data-bound ListBox control. The other table contains order information, which must be
    displayed in a DataGrid control.  You need to modify your application to enable the list box functionality.
      What should you do?

      A. Use the DataSet.Merge method.
      B. Define primary keys for the Data Table objects.
      C. Create a foreign key constraint on the DataSet object.
      D. Add a DataRelation object to the Relations collection of the DataSet object.

      Answer: D

      Note: Verified.  We want to use data from both DataTable object. We must relate the DataTable objects.
    A DataRelation is used to relate two DataTable objects to each other through DataColumn objects. DataRelation
    objects are contained in a DataRelationCollection, which you can access through the Relations property of the
    DataSet.  A foreign key constraint represents an action restriction enforced on a set of columns in a primary
    key/foreign key relationship when a value or row is either deleted or updated.

      56. You develop a Windows-based application by using Visual Studio .NET.  Your application receives XML data files
    from various external suppliers.  An XML Schema file defines the format and the data types for the XML data files.
    Your application must parse the incoming XML data files to ensure that they conform to the schema.
      What should you do?

      A. Implement a DataSet object and code an event handler to process its events.
      B. Implement a DataSet object and set its Enforce Constraints property to True.
      C. Implement an XmlValidatingReader object and code an event handler to process its events.
      D. Implement an XmlValidatingReader object and examine its ReadState property after reading the XML data file.

      Answer: C

      Note: Verified.  The XmlValidatingReader class, an implementation of the XmlReader class, provides support for XML
    validation. The ValidationEventHandler event is used to set an event handler for receiving information about schema
      validation errors.

      57. You use Visual Studio .NET to create an application. Your application
      contains two classes, Region and City, which are defined in the following
      code segment. (Line numbers are included for reference only.)

      01 Public Class Region
      02 Public Overridable Sub CalculateTax()
      03 'Code to calculate tax goes here.
      04 End Sub
      05 End Class
      06 Public Class City
      07 Inherits Region
      08 Public Overrides Sub CalculateTax()
      09 'Insert new code.
      10 End Sub
      11 End Class

      You need to add code to the CalculateTax method of the City class to call
      the CalculateTax method of the Region class. Which code segment should you
      add on line 9?

      A. CalculateTax()
      B. Me.CalculateTax()
      C. MyBase.CalculateTax()
      D. MyClass.CalculateTax()

      Answer: C

      Note: Verified
      Use the MyBase keyword to call methods in a base class when overriding methods in a derived class.

      58. You are maintaining a Visual Studio .Net application that was developed by a colleague. The application
    calculates interest and penalties for financial transactions. All variables that contain financial data are
      defined as type Double. When users enter financial data, the application periodically fails during execution. 
    Failure occurs in response to a variety of actions. The application returns the following error message:
    "Arithmetic operation resulted in an overflow"  You need to identify as many potential exceptions as possible
    in the application code.
      What should you do?

      A. Set Option Explicit to On.
      B. Set Option Explicit to Off.
      C. Set Option Strict to On.
      D. Set Option Strict to Off.
      E. Set Option Compare to Binary.
      F. Set Option Compare to Text.

      Answer: C

      Note: Verified.  The Options Strict statement concerns which conversion are allowed. Option Strict ON disallows
    any data type conversions in which ddata loss would occur and anyconversion between numeric types and strings. 
    In short it help to identify potential arithmetic exceptions.

      59. You use Visual Studio .NET to create a Windows Form. You add a custom control named BarGraph, which
    displays numerical data. You create a second custom control named DataBar.  Each instance of DataBar
    represents one data value in BarGraph.  BarGraph retrieves its data from a Microsoft SQL Server database.
      For each data value that it retrieves, a new instance of DataBar is added to BarGraph. BarGraph also includes
    a Label control named DataBarCount, which displays the number of DataBar controls currently contained by BarGraph.
    You must add code to one of your custom controls to ensure that DataBarCount is always updated with the correct value.
    What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two)

      A. Add the following code segment to the ControlAdded event handler for DataBar:
         Me.DataBarCount.Text = Me.Controls.Count()
      B. Add the following code segment to the ControlAdded event handler for DataBar:
         Me.DataBarCount.Text = Parent.Controls.Count()
      C. Add the following code segment to the ControlAdded event handler for BarGraph:
         DataBarCount.Text = Me.Controls.Count()
      D. Add the following code segment to the constructor for BarGraph:
         Me.Parent.DataBarCount.Text = Me.Controls.Count()
      E. Add the following code segment to the constructor for DataBar:
         Me.Parent.DataBarCount.Text = Me.Controls.Count()
      F. Add the following code segment to the AddDataPoint method of BarGraph:
         DataBarCount.Text = Me.Controls.Count()

      Answer: C, E

      Note: Verified.  We could either catch the ControlAdded event, or add code constructor. C - The
    Control.ControlAdded Event occurs when a new control is added to the Control.ControlCollection.
    When a control is added to BarGraph we could set the count of controls to the number of current controls in
      BarGraph. E - Every time a new DataBar is constructed we could set the counter.

      60. You use Visual Studio .NET to develop a Windows-based application. Your application will display customer
    order information from a Microsoft SQL Server database.  The orders will be displayed on a Windows Form in a data
      grid named DataGrid1.  DataGrid1 is bound to a DataView object.  The Windows Form includes a button control named
    displayBackOrder.  When users click this button, DataGrid1 must display only customer orders whose BackOrder
      value is set to True.  How should you implement this functionality?

      A. Set the RowFilter property of the DataView object to "BackOrder = True".
      B. Set the RowStateFilter property of the DataView object to "BackOrder = True".
      C. Set the Sort property of the DataView object to "BackOrder = True".
      D. Set the ApplyDefaultSort property of the DataView object to True.

      Answer: A

      Note: NOT Verified!  Using the RowFilter property of a data view, you can filter reccords in a data table to
    make available only records you want to work with.

      61. You develop a Windows-based application for tracking telephone calls.  The application stores and retrieves data
    by using a Microsoft SQL Server database.  You will use the SQL Client managed provider to connect and send commands
    to the database.  You use integrated security to authenticate users.  Your server is called CallCenter100 and the
    database name is CustomerService.  You need to set the connection string property of the SQL Connection object.
    Which code segment should you use?

      A. "Provider=SQLOLEDB.1;Data Source=CallCenter100; Initial Catalog=CustomerService"
      B. "Provider=MSDASQL;Data Source=CallCenter100; Initial Catalog=CustomerService"
      C. "Data Source=CallCenter100; Initial Catalog=Master"
      D. "Data Source=CallCenter100; Initial Catalog=CustomerService"

      Answer: D

      Note: Verified.  Some dumps say A, but A is not the answer, because the managed provider does not use 'Provider'
      You can use the ConnectionString property to connect to a variety of data sources.  Again, the "Provider = value "
    clause is not used by the SQL Client managed provider.

      62. You are maintaining a Visual Studio .NET application that was created by another developer. The application
    functions as expected for several months.  Then users report that it sometimes calculates tax amounts incorrectly. 
    An examination of the source code leads you to suspect that the errors are caused by a function named
    CalculateSalesTax.  To test your hypothesis, you place a breakpoint on the following line of code:

        decTax = CalculateSalesTax(decRate, decSaleAmount)

    However, when you run the application to create a test invoice, the breakpoint is not invoked.
      How should you correct this problem?

      A. Select Enable All Breakpoints from the Debug menu.
      B. Select Configuration Manager from the Build menu.  Set the Activate Solution Configuration option to Debug.
         Set the Configuration property of the project to Debug.
      C. Select Options from the Tools menu and then select the General object from the Debugging folder.
         Choose the option In break mode, only stop execution of the current process.
      D. Select Exceptions from the Debug menu. Under the heading If the exception is not handles, select Break into the
       Debugger.

      Answer: B

      Note: Verified.  If the Active Solution Configuration is set to Release, no Breakpoints would apply. This could
    cause the behavior described in this scenario. If we should change this setting to Debug, then the breakpoints would
    be applied!.

      63. You company assigns you to modify a Visual Studio .NET application that was created by a former colleague.
    However, when you try to build the application, you discover several syntax errors. You need to correct the syntax
      errors and compile a debug version of the code so the application can be tested. Before compiling, you want to
    locate each syntax error as quickly as possible.
    What should you do?

      A. Select each error listed in the Task List window.
      B. Open the Application event log from the Visual Studio .NET Server Explorer window. Select each error listed.
      C. Run the application in Debug mode. Each time an error is encountered, correct it and continue debugging the
       application.
      D. Select Build Solution from the Build menu. When the build fails, correct each error listed in the Output window.
      E. Select Build Comment Web Pages from the Tools menu. Select each function listed in the report that is generated.

      Answer: A

      Note: Verified.  The task list windows contains information which helps you to organize and manage the work of
    building your application. Among other things it will include each syntax error of the application.

      64. You use Visual Studio .NET to create a Windows-based application. The application includes a form named
    StandardOperatingProcedures (SOP).  SOP allows users to enter very lengthy text into a database.  When users click
      the Print button located on SOP, this text must be printed by the default printer.  You implement the printing
    functionality by using the native .NET System Class Libraries with all default settings. Users report that only
      the first page of the text is being printed.
      How should you correct this problem?

      A. In the BeginPrint event, set the HasMorePages property of the PrintEventArgs object to True.
      B. In the EndPrint event, set the HasMorePages property of the PrintEventArgs object to True.
      C. In the PrintPage event, set the HasMorePages property of the PrintPageEventArgs object to True.
      D. In the QueryPageSettings event, set the HasMorePages property of the QueryPageSettingEventArgs object to True.

      Answer: C

      Note: Verified.  PrintDocument.PrintPage Event occurs when the output to print for the current page is needed.
    This event has the HasMorePages property which gets or sets a value indicating whether an additional page
    should be printed.

      65. You develop a Windows-based application named Mort1 by using Visual Studio .NET. Mort1 consumes an XML Web service
    named MortgageRate and exposes a method named GetCurrentRate.  Mort1 uses GetCurrentRate to obtain the current mortgage
    interest rate.  Six months after you deploy Mort1, users begin reporting errors. You discover that MortgageRate has been
      modified.  GetCurrentRate now requires you to pass a postal code before returning the current mortgage interest rate. 
    You must ensure that Mort1 consumes the most recent version of MortgageRate. You must achieve this goal in the most
    direct way possible.
    What should you do?

      A. Use Disco.exe to generate a new proxy class for MortgageRate.
      B. Modify the Mort1 code to pass the postal code to GetCurrentRate.
      C. Use the Update Web Reference menu item to update the reference to MortgageRate in Mort1.
      D. Use the Add Reference dialog box to recreate the reference to MortgageRate in Mort1.
      E. Remove the reference to MortgageRate in Mort1. Use the Add Web Reference dialog box to create the reference.

      Answer: C

      Note:  Verified.  If your application contains a Web reference to an XML Web service that has been recently modified
    on the server, you may need to update the reference in your project.  To update a project Web reference 1 - In Solution
    Explorer, access your project's Web References folder and select the node for the Web reference you want to update.  2 -
    Right-click the reference and click Update Web Reference.

      66. Your development team is creating a Windows-based application for a mortgage company. The application
    asynchronously calls the ProcessLoan method of an XML Web service. The XML Web service will notify your code
      when it finished executing ProcessLoan. You must ensure that your code can continue processing while waiting
    for a response from the XML Web service.  Your code must establish when ProcessLoan finished executing.
    What should your application do?

      A. Use the WaitHande.WaitAny method of the IAsyncResult.AsyncWaitHandle object.
         Examine the value of IAsyncResult.IsCompleted to see if ProcessLoan is finished executing.
      B. Use the WaitHandle.WaitAll method of the IAsyncResult.AsyncWaitHandle object.
         Examine the value of IAsyncResult.IsCompleted to see of ProcessLoan is finished executing.
      C. Supply a callback delegate to the BeginProcessLoan method of the XML Web service.
         After the XML Web service returns its response, a thread will invoke the callback from the threadpool.
      D. Supply a callback delegate to the EndProcessLoan method of the XML Web service.
         After the XML Web service returns it response, a thread will invoke the callback from the threadpool.

      Answer: C

      Note: Verified.  Calling an XML Web service asynchronously is a two-step operation. The first step, calling the
    Begin method, initiates the XML Web service call. The second step, calling the End method, completes the XML
    Web service call and returns the XML Web service response. There are different methods to determine when the
      asynchronous XML Web service call has completed. The preferred and most efficient method is to supply a callback
    delegate to the Begin method.

      67. Your development team uses Visual Studio .NET to create an accounting application, which contains a class
    named SupplierAccounts. This class instantiates several classes from a COM component that was created by using
    Visual Basic 6.0 Each COM component class includes a custom method named ShutDownObject that must be called before
    terminating references to the class.  Software testers report that the COM component appears to remain in memory
      after the application terminates. You must ensure that the ShutDownObject method of each COM component class is
    called before SupplierAccounts is terminated.
      What should you do?

      A. Add code to the Terminate event of SupplierAccounts to call the ShutDownObject method of each COM component class.
      B. Find each location in your code where a reference to Supplier Accounts is set to Nothing or goes out of scope.
       Add code after each instance to manually invoke the Visual Studio .NET garbage collector.
      C. Add the procedure Protected Overrides Finalize() to SupplierAccounts.  Add code to the procedure to call the
       ShutDownObject method of each COM component class.
      D. Add the procedure Private Sub Finally()to SupplierAccounts. Add code to the procedure to call the ShutDownObject
       method of each COM component class.

      Answer: C

      Note: Verified.  The Sub Finalize procedure in Visual Basic .NET destroys objects. It could be useful when
    destroying Visual Basic 6.0 COM objects.

      68. Your project team uses Visual Studio .NET to create an accounting application. Each team member uses the
    Write method of both the Debug class and the Trace class to record information about application execution in
    the Windows 2000 event log. You are performing integration testing for the application. You need to ensure
    that only one entry is added to the event log each time a call is made to the Write method of either the Debug
    class or the Trace class.
    What are two possible code segments for you to use? (Each correct answer presents a complete solution.  Choose two)

      A. Dim myTraceListener As New EventLogTraceListener("myEventLogSource")
         Trace.Listeners.Add(myTraceListener)
      B. Dim myDebugListener AS New EventLogTraceListener("myEventLogSource")
         Debug.Listeners.Add(myDebugListener)
      C. Dim myTraceListener As New EventLogTraceListener("myEventLogSource")
         Debug.Listeners.Add(myTraceListener)
         Trace.Listeners.Add(myTraceListener)
      D. Dim myDebugListener As New EventLogTraceListener("myEventLogSource")
         Dim myTraceListener As New EventLogTraceListener("myEventLogSource")
         Debug.Listeners.Add(myDebugListener)
         Trace.Listeners.Add(myTraceListener)

      Answer: A, B

      Note: Verified.  An EventLogTraceListener redirects output to an event log. Debug and trace share the same Listeners
    collection, so if you add a listener object to a Debug.Listeners collection in your application, it gets added to the
      Trace.Listeners collection as well, and vice versa.

      69. You use Visual Studio .NET to create a Windows-based data management application named MyApp.
    You implement the following code segment:
      Dim oSwitch As New_
      TraceSwitch("MySwitch", "My TraceSwitch")
      Dim oWriter As New IO.StreamWritter(IO.File.Open("c:\MyApp.txt", IO.FileMode.Append))
      Dim oListener As New TextWriterTraceListener(oWriter)
      Trace.Listeners.Add(oListener)
      Try
         CustomerUpdate()
      Catch oEx As Exception
         Trace.WriteLineIf(oSwitch.TraceError, "Error: " & oEx.Message)
      Finally
         Trace.Listeners.Clear()
         oWriter.Close()
         oWriter. = Nothing
      End Try

      You compile a debug version of the application and deploy it to a user's computer. The user reports errors, which are
    generated within the CustomerUpdate procedure.  You decide to enable logging of the error messages generated by
      CustomerUpdate. You want to use the minimum amount of administrative effort.
    What should you do?

      A. Start the application with the following command line: /TRACE MySwitch 1.
      B. Start the application with the following command line: /d:TRACE=True.
      C. Start the application with the following command line: /XML
      D. Create an environment variable on the user's computer. Name the variable MySwitch and assign it a value of 1.
      E. Edit your application's config file to set the value of MySwitch to 1.

      Answer: E

      Note: Verified.  After your application has been distributed, you can still enable or disable trace output by configuring
    the trace switches in your application. You can change the values of the switch objects using the configuration file.  In
    addition to specifying the name of a switch to configure, you must also specify a value for the switch. This value is an
    Integer.  For BooleanSwitch, a value of 0 corresponds to Off, and any nonzero value corresponds to On.

      70. You use Visual Studio .NET to create a Windows-based application for online gaming. Each user will run the client
    version of the application on his or her local computer. In the game, each user controls two groups of soldiers,
    Group 1 and group 2. You create a top-level menu item whose caption is Groups. Under this menu, you create two submenus. 
    One is named group1Submenu, and its caption is Group 1. The other is named group2Submenu, and its caption is Group2. 
    When the user selects the Groups menu.  The two submenus will be displayed. The user can select only one group of soldiers
    at a time.  You must ensure that a group can be selected either by clicking the appropriate submenu item or by holding down
    the ALT key and pressing 1 or 2. You must also ensure that the group currently select will be indicated by a dot next to the
      corresponding submenu item. You do not want to change the caption text of any of your menu items.
    Which for actions should you take? (Each correct answer represents part of the solution.  Choose four)

      A. Set group1Submenu.Text to "Group &1".
         Set group2Submenu.Text to "Group &2".
      B. Set Group1.ShortCut to "ALT1".
         Set Group2.ShortCut to "ALT2".
      C. In the group1Submenu.Click event, place the following code segment: group1Submenu.DefaultItem = True
         In the group2Submenu.Click event, place the following code segment: group2Submenu.DefaultItem = True
      D. In the group1Submenu.Click event, place the following code segment: group2Submenu.DefaultItem = False
         In the group2Submenu.Click event, place the following code segment: group1Submenu.DefaultItem = False
      E. In the group1Submenu.Click event, place the following code segment: group1Submenu.Checked = True
         In the group2Submenu.Click event, place the following code segment: group2Submenu.Checked = True
      F. In the group1Submenu.Click event, place the following code segment: group2Submenu.Checked = False
         In the group2Submenu.Click event, place the following code segment: group1Submenu.Checked = False
      G. Set group1Submenu.RadioCheck to True.
         Set group2Submenu.RadioCheck to True.
      H. Set group1Submenu.RadioCheck to False.
         Set group2Submenu.RadioCheck to False.

      Answer: A, E, F, G

      Note: Verified. A - The & sign is used to define the required Access key. E, F - The menu item's Checked
    property is either true or false, and indicates whether the menu item is selected. We should set the clicked
      Submenu Checked property to True, and the other Submenu Checked property to False. G - The menu item's
      RadioCheck property customizes the appearance of the selected item: if RadioCheck is set to true, a radio
    button appears next to the item;

      71. You use Visual Studio .NET to develop a Windows-based application that interacts with a Microsoft SQL Server
    database.  Your application contains a form named CustomerForm.  You add the following designtime components to
      the form:

          * SqlConnection object named NorthwindConnection
          * SqlDataAdapter object named NorthwindDataAdapter.
          * DataSet object named NorthwindDataSet.
          * Five TextBox controls to hold the values exposed by NorthwindDataSet.

      At design time, you set the DataBindings properties of each TextBox controls to the appropriate column in the
    DataTable object of NorthwindDataSet.  When you test the application, you can successfully connect to the database. 
    However, no data is displayed in any text boxes.  You need to modify your application code to ensure that data is
    displayed appropriately.  Which behavior should occur while the CustomerForm.Load event handler is running?

      A. Execute the Add method of the TextBoxes DataBindings collection and pass in NorthwindDataSet.
      B. Execute the BeginInit method of NorthwindDataSet.
      C. Execute the Open method of NorthwindConnection.
      D. Execute the FillSchema method of NorthwindDataAdapter and pass in NorthwindDataSet.
      E. Execute the Fill method of NorthwindDataAdapter and pass in NorthwindDataSet.

      Answer: E

      Note: Verified.  Dataset is a container; therefore, you need to fill it with data. You can populate a dataset by
    calling the Fill method of a data adapter.

      72. You are a developer for a company that provides free software over the Internet.  You are developing an
    e-mail application that users all over the world can download. The application displays text strings in the user
      interface. At run time, these text strings must appear in the language that is appropriate to the locale setting
    of the computer running the application. You have resources to develop version of the application for only four
    different cultures. You must ensure that your application will also be usable by people of other cultures.
    How should you prepare the application for deployment?

      A. Package a different assembly for each culture.
      B. Package a different executable file for each culture.
      C. Package a main assembly for source code and the default culture.
         Package satellite assemblies for the other cultures.
      D. Package a main assembly for source code. Package satellite assemblies for each culture.

      Answer: C

      Note: Verified. When you build a project, the resource files are compiled and then embedded in satellite
      assemblies, or assemblies which contain only the localized resources. The fallback resources are built into
    the main assembly, which also contains the application code.

      73. You use Visual Studio .NET to create an application that interacts with a Microsoft SQL Server database. 
    You create a SQL Server stored procedure named CustOrderDetails and save it in the database. Other developers on
      your team frequently debug other stored procedures.  You need to verify that your stored procedure is performed
    correctly.  You need to step through CustOrderDetails inside the Visual Studio .NET debugger.
    What should you do?

      A. Run CustOrderDetails by using the Visual Studio .NET Server Explorer.
      B. Step into CustOrderDetails by using the Visual Studio .NET Server Explorer.
      C. From the Command window, use Ctrl+E to run CustOrderDetails.
      D. Move CustOrderDetails from the Visual Studio .NET Server Explorer window to a Windows Form.  Run the application
    in Debug mode and step though CustOrderDetails.

      Answer: B

      Note: Verified.  To debug a stored procedure from Server Explorer 1 - Establish a connection to a database using
    Server Explorer.  2 - Expand the database name node.  3 - Expand the Stored Procedures node.  4 - Right-click the
    stored procedure you want to debug and choose Step Into Stored Procedure from the shortcut menu.

      74. You use Visual Studio .NET to create a Windows-based application. The application includes a form named
    GraphForm, which displays statistical data in graph format. You use a custom graphing control that does not
      support resizing. You must ensure that users cannot resize, minimize, or maximize GraphForm.
    Which three actions should you take? (Each answer represents part of the solution. Choose three)

      A. Set GraphForm.MinimizeBox to False.
      B. Set GraphForm.MaximizeBox to False.
      C. Set GraphForm.ControlBox to False.
      D. Set GraphForm.ImeMode to Disables.
      E. Set GraphForm.WindowState to Maximized.
      F. Set GraphForm.FormBorderStyle to one of the Fixed styles.
      G. Set GraphForm.GridSize to the appropriate size.

      Answer: A, B, F

      Note: Verified.  We disable the Minimize and Maximize buttons with the GraphForm.Minimizebox and the
    GraphForm.Maximizebox properties. Furthermore we should use a fixed FormBorderStyle to prevent the users
    from manually resizing the form.

      75. You develop a Windows-based application named CustOrders. You implement
      the Trace object within your application code. You will use this object to
      record application information, such as errors and performance data, in a
      log file.  You must have the ability to enable and disable Trace logging. This
      functionality must involve the minimum amount of administrative effort.
      What should you do?

      A. Create a Boolean constant in your application named #TraceLogging and
         set it to False. Each time your code uses Trace logging, use a #if..#Then
         statement to evaluate your #TraceLogging constant.
      B. On each computer that will host your application, create an environment
         variable named CustOrders.Trace. Set the environment variable to True when
         you want to enable Trace logging. Set it to False when you want to disable Trace logging.
      C. On each computer that will host your application, edit the shortcut
         used to start your application. Add /d:TRACE=True to the Target property.
      D. Use the TraceSwitch class within your code. Each time your code uses Trace logging,
         consult the TraceSwitch level to verify whether to log information. Change
         the TraceSwitch level by editing your applications .config file.

      Answer: D

      Note: Verified. By placing Trace Switches in your code, you can control whether tracing
      occurs and how extensive it is.

      76. You use Visual Studio .NET to create a component named Request. This component includes a method named
    AcceptRequest, which tries to process new user requests for services. AcceptRequest calls a private function
      named Validate. You must ensure that any exceptions encountered by Validate are bubbled up to the parent form
    of Request. The parent form will then be responsible for handling the exceptions. You want to accomplish this
    goal by writing the minimum amount of code.
      What should you do?

      A. Use the following code segment in AcceptRequest:
         Me.Validate()
      B. Use the following code segment in AcceptRequest:
         Try
            Me.Validate()
         Catch ex As Exception
            Throw ex
         End Try
      C. Use the following code segment in AcceptRequest:
         Try
            Me.Validate()
         Catch ex As Exception
         Throw new Exception ("Exception in AcceptRequest", ex)
         End Try
      D. Create a customer Exception class named RequestException by the following code segment:
         Public Class RequestException Inherits System.ApplicationException
            Public Sub New()
            End Sub
            Public Sub New (message As String)
               MyBase.New(message)
            End Sub
            Public Sub New (message As String, inner As Exception)
               MyBase.New(message, inner)
            End Sub
         End class
         In addition, use the following code segment in AcceptRequest:
         Try
            Me.Validate()
         Catch ex As Exception
         Throw new RequestException("Exception in AcceptRequest", ex)
         End Try

      Answer: B

      Note: Verified.  We use a Try...Catch statement to catch any exceptions from the Validate function. We then throw
    any exceptions, without adding any further information (not C), to the parent form of Request.

      77. You develop a Windows-Based application that accesses a Microsoft SQL
      Server database.  Users must supply a user name and password when they start
      the application.  This information is then used to dynamically build a
      connection string.  When you test the application, you discover that it is
      not using the SqlClient connection pooling feature.  You must reduce the
      time needed to retrieve information.
    How should you modify the connection string?

      A. to use the Windows user logon when connecting to the database.
      B. to use the SQL Server used login when connecting to the database.
      C. to use the same application logon ID and password for every connection to the database.
      D. to use the guest login ID and password for every connection to the database.

      Answer: C

      Note: Verified. We must use the same connection string to only use one connection pool.
      The performance of the application can be enhanced by having the
      application share, or "pool," connections to the data source. When a
      connection is opened, a connection
      pool is created based on an exact matching algorithm that associates the
      pool with the connection string in the connection. Each connection pool is
      associated with a distinct connection string. When a new connection is
      opened, if the connection string is not an exact match to an existing
      pool, a new pool is created.

      78. You use Visual Studio .NET to create a component that will be shared by two client applications. Eventually,
    you plan to deploy new version of this shared component. However, not all of the new versions will be compatible
    with both client applications. When you deploy the shared component and the client applications, you must ensure
    that you can upgrade the shared component for a single client application. You must also minimize the need for
    configuration changes when you deploy new version of the component.
    What are two possible ways to achieve your goal? (Each correct answer represents a complete solution. Choose two)

      A. Deploy each client application to its own folder.  Deploy the shared component to its own folder.  Register the
       shared component by using RegSvr32 with the /s option.
      B. Deploy each client application to its own folder.  Deploy a separate copy of the shared component to each client
       application folder.  When you deploy a new version of the component, replace the older version only if the new
         version remains compatible with the client application in the same folder.
      C. Compile the client applications with reference to the shared component.  Deploy both client applications and the
       shared component to a single folder. When you deploy a new version of the component, increment its version number.
      D. Create a strong name of the shared component and specify a version number.  Compile each client application and
       bind it to the shared component.  Deploy the shared component to the global assembly cache on the client computer.
         Deploy each client application to its own folder.  When you deploy a new version of the component, increment its
       version number.

      Answer: B, D

    Note: Verified.

      79. You develop an inventory management application that will call a Microsoft
      SQL Server stored procedure named sp_GetDailySales. The stored procedure
      will run a query that returns your daily sales total as an output parameter.
    This total will be displayed to users in a message box. Your application uses
    a SqlCommand object to run sp_GetDailySales.

    You write the following code to call sp_GetDailySales:
      Dim cnn As SqlConnection = New SqlConnection(myConnString)
      Dim cmd As SqlCommand = New _ SqlCommand("sp_GetInventoryLevel", cnn)
      cmd.CommandType = CommandType.StoredProcedure
      Dim parm As SqlParameter = cmd.Parameters.Add("@ItemTotal", SqlDbType.Int)
      parm.Direction =ParameterDirection.Output
      cnn.Open()
      cmd.ExecuteNonQuery()
 
      Now you must write additional code to access the output parameter.
      Which code segment should you use?

      A. MessageBox.Show("Total is: " & cmd.Parameters("@Output").Value.ToString())
      B. MessageBox.Show("Total is: " & cmd.Parameters("@Output").ToString())
      C. MessageBox.Show("Total is: " & cmd.Parameters("@ItemTotal").Value.ToString())
      D. MessageBox.Show("Total is: " & cmd.Parameters("@ItemTotal").ToString())

      Answer: C

    Note: Verified.  The @ItemTotal parameter is declared as an output parameter with SQL
      Server data type INT. We use the Value property of the SQLParameter class
      to retrieve the value of this parameter. We must also convert the INT
      value to a string value with the ToString method. We then supply this
      string to the MessageBox.Show method.

    80. You develop a Windows-based application that includes several menus. 
    Every top-level menu contains several menu items and certain munus contain
    items that are mutually exclusive.  You decide to distinguish the single most
    important item in each menu by changing its caption text to bold type.
    What should you do?

    A. Set the Text property to "<b>True</b>".
    B. Set the DefalutItem property to True.
    C. Set the Checked property to True.
    D. Set the OwnerDraw property to True.

    Answer: B

    Note: Verified.

    81. You use Visual Studio .NET to develop a Windows-based application. Your
    application includes a form named InformationForm, which enables users to edit
    information stored in a database.  All user changes to this information must
    be saved in the database.
    You need to write code that will prevent InformationForm from closing if any
    database changes are left unsaved. 
    What should you do?

    A. Include Me.Activate in the Closing event handler of InformationForm.
    B. Include Me.Activate in the Closed event handler of InformationForm.
    C. Include Me.Activate in the Leave event handler of InformationForm.
    D. Change a property of the System.ComponentModel.CancelEventArgs parameter
       in the Closing event handler of InformationForm.
    E. Change a property of the System.EventArgs parameter in the Closed event
       handler of InformationForm.
    F. Change a property of the System.EventArgs parameter in the Leave event
       handler of InformationForm.

    Answer: D

    82. You develop an application that will be sold commercially.  You create a
    Visual Studio .NET setup project to distribute the application.  You must ensure
    that each user accepts your license agreement before installation occurs.
    What should you do?

    A. Add a launch condition to your setup project.
       Add your license agreement to the Message property of the launch condition.
    B. Open the user interface designer for you setup project.
       Select the Welcome dialog box from the Start object and add your license agreement to the
         CopyrightWarning property.
    C. Save your license agreement in Rich Text Format and add the file to your setup project.
       Open the property pages for the setup project and set the Certificate to the name of your Rich Text file.
    D. Save your license agreement in Rich Text Format and add the file to your setup project.
       Open the user interface designer for the setup object.
       From the Start object, select the License Agreement dialog box and set the LicenseFile property to the
       name of your Rich Text file.

    Answer: D

    83. You develop a Windows-based application by using Visual Studio .Net.  You use the companies intranet to
    deploy the application to client computers.  You use the security configuration of the .Net Framework to
    configure security for your application at the enterprise policy level.
    Virus attacks cause the IT manager, at the company, to crap his pants then to tighten security, at the machine
    level.  Users report that they can no longer execute your application. Imagne that, the IT manager screwed things
    up again.  How should you, the hero programmer who was blamed for the problem, correct the problem?

    A. Include the LevelFinal attribute in the intranet code group policy at the enterprise level by using the
       Permission View tool (Permview.exe).
    B. Include the Exclusive attribute in the intranet code group policy at the enterprise level by using the
       Permission View tool (Permview.exe).
    C. Include the LevelFinal attribute in the intranet code group policy at the enterprise level by using the
       Code Access Security Policy tool (Caspol.exe).
    D. Include the Exclusive attributes in the intranet code group policy at the enterprise level by using the
       Code Access Security Policy tool (Caspol.exe).

    Answer: C

    Note:  This question was modified slightly to interject a bit of jockularity into an intense time.  The changes actually
    reflect reality, in a better sense.  My changes, in no way effect the answer, so go forth and prosper.

    84. You need to add several pairs of controls to Form1.  You must fulfill the following requirements:
        * Each pair of controls must represent one column in the Table.
        * Each pair must consist of a TextBox control and a Label control.
        * The LostFocus event of each TextBox control must call a procedure named UpdateDatabase.
        * Additional forms simular to Form1 must be created for other tables in the database.
        * Application performance must be optimized.
        * The amount of necessary code must be minimized.
    What should you do?

    A. Create and select a TextBox control and a Label control.
       Write the appropriate code in the LostFocus event of the TextBox control.
       Repeatedly copy and paste the controls into Form1 until every column in Table 1 has a pair of controls.
       Repeat this process for the other forms.
    B. Add a TextBox control and a Label controls to Form1.
       Write the appropriate code in the LostFocus event of the TextBox control.
       Create a control array from the TextBox control and the Label control.
       At run time, add additional pairs of controls to the control array until every column in Table1 has a pair
       of controls.
    C. Create a new user control that includes a TextBox control and a Label control.
       Write the appropriate code in the LostFocus event of the TextBox control.
       For each column in Table1, add one instance of the user control to the Form1.
       Repeat this process for the other forms.
    D. Create a new ActiveX control that includes a TextBox control and a Label control.
       For each column in Table1, add one instance of the ActiveX control to Form1.
       Repeat this process for the other forms.

    Answer: C

    85. You use Visual Studio .Net to create a Windows-based accounting application.  Your application will be
        deployed on computers running Windows 98, Windows 2000 Professional and Windows XP Professional.
        You must ensure that your application records information about errors raised from calls to a procedure named
        UpdateData.  To do so, you plan to implement logging features.
        Which code segment should you use?

    A. Dim oLog As New EventLog()
       Dim oType As EventLogEnterType
       Try
         UpdateData()
       Catch eEx As Exception
         If Not EventLog.SourceExists("AccountingApp") Then
            EventLog.CreateEventSource("AccountingApp", "Application")
         End If
         oLog.Source = "AccountingApp"
         oLog.Log = "Application"
         oType = EventLogEntryType.Error
         oLog.WriteEntry("Error details: " & oEx.Message, oType)
       End Try
    B. Dim 1FH As Long
       Try
          UpdateData()
       Catch oEx As Exception
          1PH = FreeFile()
          Open logfilePath For Append As #1FH
          Print #1FH, oEx.Message
          Close #1FH
       End Try
    C. Dim oWriter As New IO.StreamWriter(IO.File.Open(logfilePath, IO.FileMode.Append))
       Dim oListener As New TextWriterTraceListener(oWriter)
       Debug.Listeners.Add(oListener)
       Try
          UpdateData()
       Catch oEx As Exception
          Debug.WriteLine(oEx.Message)
          oWriter.Flush()
          oWriter.Close()
          oWriter = Nothing
       End Try
    D. Dim oWriter As New IO.StreamWriter(IO.File.Open(logfilePath, IO.FileMode.Append))
       Dim oListener As New TextWriterTraceListener(oWriter)
       Trace.Listeners.Add(oListener)
       Try
          UpdateData()
       Catch oEx As Exception
          Trace.WriteLine(oEx.Message)
          Trace.Listeners.Clear()
          oWriter.Close()
          oWriter = Nothing
       End Try

    Answer: D

    Note: Verified.  Please make life easier for yourself and others who work with your code after you, by
      please useing Try/Catch blocks, in your code, whenever possible.  Even if its just to print out a more
      user friendly error message to the user, when something doesnt work.

    86. You develop a Windows-based application that accesses a Microsoft SQL Server database.  The application
        includes a form named CustomerForm, which contains a Button control named SortButton.  The database
        includes a table named Customers.  Data from Customers will be displayed on CustomerForm by means of a
        DataGrid control named DataGrid1.
        The following code segment is used to fill DataGrid1:
        Private Sub FillDataGrid()
           Dim oConn As New SqlConnection(MyConString)
           Dim oDA As New SqlDataAdapter("SELECT CustomerID, CompanyName, ContactName, Phone From Customers", oConn)
           Dim oDS As New DataSet()
           oDA.MissingSchemaAction = MissingSchemaAction.AddWithKey
           oDA.Fill(oDS, "Customers")
           Dim oDV As New DataView(oDS.Tables("Customers"))
           oDV.Sort = "CustomerName ASC, ContactName ASC"
           oDV.ApplyDefaultSort = True
           DataGrid1.DataSource = oDV
        End Sub

        The primary key for Customers is the CustomerID column.  You must ensure that the data will be displayed in
        ascending order by primary key when the user selects SortButton.
        What should you do?

    A. Set the Sort property of the DataView object to an empty string.
    B. Set the ApplyDefaultSort property of the DataView object to False.
    C. Include an ORDER BY clause in the SELECT statement when you create the DataAdapter object.
    D. Set the RowFilter property of the DataView object to CustomerID.

    Answer: A

    Note: Verified.  The initial form shows the data sorted with the DataView when the DataGrid is loaded.
    When the SortButton is clicked, you would then set the sort property of the DataView object to an empty
    string to allow the default sort to occur from sql by primary key. Remember, a primary key causes a physical
    ordering of data, in the database.  This is an excelent example of how to use and fill an SqlDataAdapter. 
    Also a good example of using a DataView for sorting data.

    87. You develop a customer contact application that will enable users to view and update customer data in a
    Windows Form.  Your application uses a DataTable object and a DataAdapter object to manage the data and interact
    with a central database.
    Your application design must fulfill the following requirements:
       * After a user completes a set of updates, the changes must be written in the database.
       * The data stored in the DataTable object must indicate that the database updates are complete.
    What code segment should you use to accomplish this?

    A. DataTable.AcceptChanges()
       DataAdapter.Update(DataTable)
    B. DataAdapter.Update(DataTable)
       DataTable.AcceptChanges()
    C. DataTable.Reset()
       DataAdapter.Update(DataTable)
    D. DataAdapter.Update(DataTable)
       DataTable.Reset()

    Answer: B

    Note: Verified

    88. You develop a Windows-based application that contains a form named Contact.  You need to write code to
    initialize all class-level variables in Contact as soon as Contact is instantiated.  You will place your code
    in a public procedure in the Contact class.
    Which public procedure should you use?

    A. Create
    B. Initialize
    C. Load
    D. New

    Answer: D

    Note: Verified

    89. Your company uses Visual Studio .Net to create a Windows-based application for a hospital.  The application
    is named PatientTracker, and it calls an assembly named Schedule.  Six months pass.  The hospital asks your company
    to develop a new Windows-based application.  The new application will be named PhysicianTracker, and it will also
    call Schedule to serve both applications.  Before you can use Schedule in PhysicianTracker, you need to complete some
    preliminary tasks.
    Which three actions should you take? (Each correct answer represents part of the solution. Choose three)

    A. Create a strong name for Schedule.
    B. Use side-by-side execution to run Schedule.
    C. Install Schedule in the global assembly cache.
    D. Move Schedule to the Windows\System32 folder.
    E. Create a reference in PhysicanTracker to Schedule.
    F. Create a reference in PhysicanTracker to PatientTracker.

    Answer: A, C, E

    Note: Verified.  You should be noticing a trend here reguarding strong naming and the global assembly cache.

    90. You use Visual Studio .Net to develop a Windows-based application that contains a single form.  This form
    contains a Label control named labelValue and a TextBox control named textValue. labelValue displays a caption
    that identifies the purpose of textValue.  You want to write code that enables users to place focus in textValue
    when they press ALT+V.  This key combination should be identified to users in the display of labelValue.
    Which three actions should you take? (Each correct answer represents part of the solution.  Choose three)

    A. Set labelValue.UseMnemonic to True.
    B. Set labelValue.Text to "&Value".
    C. Set labelValue.CausesValidation to True.
    D. Set textValue.CausesValidation to True.
    E. Set textValue.TabIndex to exactly one number less than labelValue.TabIndex.
    F. Set textValue.TabIndex to exactly one number more than labelValue.TabIndex.
    G. Set textValue.Location so that textValue overlaps with labelValue on the screen.
    H. Add the following code to the Load event of MainForm: text.Value.Controls.Add(labelValue);

    Answer: A, B, F

    Note: Verified.

    91. You develop an application, remote, that enables mobile salespeople to look up contact information in a database.
    The salespeople use portable computers running Windows XP Professional.  Because of the large size of the database,
    you want to create a distribution package to distribute your application and the database on a CD-ROM.  However,
    you discover that the total size of the distribution package exceeds the capacity of a 650-MB CD-ROM.  You want to
    reduce the size of the distribution package so it will fit on a single CD-ROM.
    Which two actions should you take? (Each correct answer represents part of the solution.  Choose two)

    A. Exclude the .Net Framework dependency from your distribution package.
    B. Use a third-party compression utility to compress the .Net Framework dependency files.
    C. Set the package files option of your setup project to 'In cabinet file(s)' and set the maximum CAB file size to 650 MB.
    D. Set the Compression property of your setup project to Optimized for size.
    E. Set the Bootstrapper property of you setup project to None.

    Answer: A, D

    Note: Verified.

    92. You develop a new sales analysis application that reuses existing data access components.  One of these components
    returns a DataSet object that contains the data for all customer orders for the previous year.  You want your
    application to display orders for individual product numbers.  Users will specify the appropriate product numbers,
    at run time.
    What should you do?

    A. Use the DataSet.Reset method.
    B. Set the RowFilter property of the DataSet object by using a filter expression.
    C. Create a DataView object and set the RowFilter property by using a filter expression.
    D. Create a DataView object and set the RowStateFilter property by using a filter expression.

    Answer: C

    Note: Verified.

    93. You plan to use Visual Studio .Net to create a class named BusinessRules, which will be used by all
    applications in your company.  BusinessRules defines business rules and performs calculations based on those
    rules.  Other developers in your company must NOT be able to override the functions and subroutines defined in
    BusinessRules with their own definitions.
    Which two actions should you take to create BusinessRules? (Each correct answer represents part of the solution.
    Choose two)

    A. Create a Windows control library project.
    B. Create a class library project.
    C. Create a Windows Service project.
    D. Use the following to define BusinessRules: Protected Class BusinessRules.
    E. Use the following to define BusinessRules: Public Shadows Class BusinessRules.
    F. Use the following to define BusinessRules: Public NotInheritable Class BusinessRules.
    G. Use the following to define BusinessRules: Public MustInherit Class BusinessRules.

    Answer: B, F

    Note: Verified.  A class library is where you would want to create global glasses and Public will make
    it available for anyone to use, while NotInheritable makes it non-overrideable.

    94. You develop a Windows control named FormattedTextBox, which will be used by many developers in your
    company.  FormattedTextBox will be updated frequently.  You create a custom bitmap image named CustomControl.bmp
    to represent FormattedTextBox in the Visual Studio .Net toolbox.  The bitmap contains the current version
    number of the control, and it will be updated each time the control is updated.  The bitmap will be stored in
    the application folder.  If the bitmap is not available, the standard Textbox control bitmap must be displayed
    instead.
    Which class attribute should you add to FormattedTextBox?

    A. <PRE>&lt;ToolboxBitmap(GetType(TextBox))&gt;</PRE> Class FormattedTextBox
    B. <PRE>&lt;ToolboxBitmap("CustomControl.bmp")&gt;</PRE> Class FormattedTextBox
    C. <PRE>&lt;ToolboxBitmap(GetType(TextBox), " CustomControl.bmp")&gt;</PRE> Class FormattedTextBox
    D. <PRE>&lt;ToolboxBitmap(GetType(TextBox))&gt; &lt;ToolboxBitmap("CustomControl.bmp")&gt;</PRE> Class FormattedTextBox

    Answer: C

    Note: Verified.

    95. You use Visual Studio .Net to develop a Windows-based application.  You implement the security classes of
    the .Net Framework.  As users interact with your application, role-based validation will frequently be performed.
    You must ensure that only Verified Windows NT or Windows 2000 domain users are permitted to access your application.
    You add the appropriate Import statements for the System.Security.Principal namespace and the System.Threading namespace.
    Which additional code segment should you use?

    A. AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal)
       Dim principal As WindowsPrincipal = CType(Thread.CurrentPrincipal, WindowsPrincipal)
    B. AppDomain.CurrentDomain.SetThreadPrincipal(PrincipalPolicy.WindowsPrincipal)
       Dim principal As WindowsPrincipal = CType(Thread.CurrentPrincipal, WindowsPrincipal)
    C. Dim identity As WindowsIdenty = WindowsIdentity.GetCurrent()
       Dim principal New WindowsPrincipal(identity)
    D. Dim identity As WindowsIdenty = WindowsIdentity.GetAnonymous()
       Dim principal New WindowsPrincipal(identity)

    Answer: A

    Note: Verified.

    96. You use Visual Studio .Net to create a Windows-based application.  On the main application form, you create a
    TextBox control named textConnectionString.  Users can enter a database connection string in this box to access
    customized data from any database in your company.  You also create a Help file to assist users in creating
    connection strings.  The Help file will reside on your company intranet.  Your application must load the Help file
    in a new browser window when the user presses the F1 key, but only if textConnectionString has focus.  You must
    create this functionality by using the minimum amount of code.
    In which event should you write the code to display the Help file?

    A. textConnectionString_KeyPress
    B. textConnectionString_KeyDown
    C. textConnectionString_KeyUp
    D. textConnectionString_GiveFeedback
    E. textConnectionString_HelpRequested

    Answer: E

    Note: Verified.

    97. You use Visual Studio .Net to develop a Windows-based application that will interact with a Microsoft SQL
    Server database.  Your application will display employee information from a table named Employees.  You use
    ADO.NET to access the data from the database.  To limit the possibility of errors, you must ensure that any
    type of mismatch errors between your application code and the database are caught at compile time rather then
    at run time.
    Which two actions should you take?  (Each correct answer represents part of the solution.  Choose two)

    A. Create an XML schema for Employees.
    B. Create an XML style sheet for Employees.
    C. Create an XML namespace for Employees.
    D. Create a typed DataSet object based on the XML schema.
    E. Create a typed DataSet object based on the XML style sheet.
    F. Create a TypeDelegator class based on the XML namespace.

    Answer: A, D

    Note: Verified.  My friends, you should know this!

    98. You execute a query on your external Oracle database named SalesDate by using an OleDbCommand object.
    The query uses the Average function to return a single value that represents the average price of products in the
    inventory table.  You want to optimize performance when you execute this query.  To execute this query from your
    ADO.NET code, you need to use a method of the OleDbCommand object.
    Which method should you use?

    A. ExecuteNotQuery
    B. ExecuteScalar
    C. ToString
    D. ExecuteReader
   
    Answer: B

    Note: Verified.  For optimum performance, you should always use ExecuteScalar when your retreiving a single value.

    99. You create an assembly by using Visual Studio .Net.  The assembly is responsible for writing and reading order
    entry information to and from an XML data file.  The assembly also writes and reads values to and from the Windows
    registry while it is being consumed.  The assembly will be distributed to client computers by using your company's
    intranet.  All client computers are configured to implement the default .NET security policy. You need to implement
    security in the assembly.
    What should you do?

    A. Implement declarative security and execute the permission demand to allow access to the file system and
       Windows registry.
    B. Implement declarative security and execute the minimum permission request to allow access to the file system
       and Windows registry.
    C. Implement imperative security and execute the permission demand to allow access to the file system and
       Windows registry.
    D. Implement imperative security and execute the minimum permission request to allow access to the file system
       and Windows registry.

    Answer: B

    Note: Verified.  Declarative security checks in the application would be the fastest solution, while the minimum
    permission request allows access to the file system and Windows registry.

    100. You develop a Windows-based application that contains a class named Contact.  Contact uses ADO.NET to interact
    with a Microsoft SQL Server database.  Contact requires an active connection to the database while it is being
    consumed.  You must ensure that all resources used by Contact are properly released, as soon as, the class stops
    being consumed.
    What should you do?

    A. In Contact, create a Sub procedure named Finalize to override System.Object.Finalize.
       Place the appropriate cleanup code in the Finalize procedure and call MyBase.Finalize.
    B. In Contact, create a Sub procedure named Closed.
       Place the appropriate cleanup code in the Closed procedure.
    C. Implement the Dispose method of the IDisposable interface.
       Place the appropriate cleanup code in the implemented Dispose method.
       Call the Dispose method of you form before releasing the reference.
    D. Implement the Finalize method in the System.Windows.Form interface.
       Place the appropriate cleanup code in the implemented Finalize method.
       Call the Dispose method of your form before releasing the reference.

    Answer: C

    Note: Verified.

    101. You develop a Windows-based application that interacts with a Microsoft SQL Server database.  The
    application inserts new rows into the database by calling the following stored procedure.
    (Line numbers are included for reference only.)
    01 ALTER PROCEDURE dbo.sp_UpdatePrice (@category int, @totalprice money OUTPUT)
    02 AS
    03 SET NOCOUNT ON
    04 UPDATE Products SET UnitPrice = UnitPrice * 1.1 WHERE CategoryID = @category
    05 SELECT ProductName FROM Products WHERE CategoryID = @category
    06 RETURN @totalprice
    Your application uses the ExecuteReader method of the SqlCommand object to call the stored procedure and
    create a SqlDataReader object.  After the stored procedure runs, your code must examine the
    SqlDataReader.RecordsAffected property to verify that the correct number of records is successfully updated.
    However, when you execute the stored procedure, the SqlDataReader.RecordsAffected property always returns 1.
    How should you correct this problem.

    A. Change line 3 to SET ROWCOUNT 0
    B. Change line 3 to SET NOCOUNT OFF
    C. Change line 6 to RETURN 0
    D. Change line 6 to RETURN @category

    Answer: B

    102. You develop a Windows-based application for your payroll department.  The application will include a procedure
    named Signin, which must allow users to report that they are present in their offices.  The procedure must also
    allow each user to sign in other users.  The procedure must return a Boolean variable indicating success or failure.
    In most cases, the procedure will be called with no parameters.  When no parameters are passed in, the procedure
    should recognize the user by the information stored in global variables.  When one user signs in another user,
    the procedure should accept a string variable parameter that represents the user name of the user who is signed in.
    You want to define your procedure to present the most efficient contract to the consumer.
    Which two code segments should you use?  (Each correct answer represents part of the solution.  Choose two)

    A. Public Function SignIn() As Boolean.
    B. Public Function SignIn(userName As String) As Boolean
    C. Public Function SignIn(userName As String, Success As Boolean) As Boolean
    D. Public Function SignInWithName(userName As String) As Boolean
    E. Public SignIn(username As String)
    F. Public Sub SignInWithName(userName As String)

    Answer: A, B

    Note: Verified.

    103. You use Visual Studio .Net to develop a data entry form for a Windows-based application.  The form will
    display one record at a time form a database.  The form must include four Button controls.  Each control will be
    used to navigate through the data in the database.  You decide to create one procedure to handle the Click
    event for all four controls.
    What should you do?

    A. Create a control array consisting of four Button controls.
       Your code will inspect the Index argument that is passed into the Click event.
    B. Create a control array consisting of four Button controls.
       Your code will inspect the Index property of the sender parameter of the Click event.
    C. Create four individual Button controls.
       Create a procedure named NavButtons_Click to handle the Click event for all four controls by using the
       AddHandler keyword.
    D. Create four individual Button controls.
       Create a procedure named NavButtons_Click to handle the Click event for all four controls by using the
       Implements keyword.

    Answer: C

    Note: Verified.

    104. You use Visual Studio .Net to develop a Windows-based application.  The application includes several menu
    controls that provide access to most of the application's functionality.  One menu option is named calculateOption. 
    When a user chooses this option, the application will perform a series of calculations based on information
    previously entered by the user.  To provide user assistance, you create a TextBox control named UserHelp.  The
    corresponding text box must display help information when the user pauses on the menu option with a mouse or
    navigates to the option by using the arrow keys.  You need to add the following code segment:
    UserHelp.Text = "This menu option calculates the result..";
    In which event should you add this coed segment?

    A. calculateOption_Click
    B. calculateOption_Popup
    C. calculateOption_Select
    D. calculateOption_DrawItem
    E. calculateOption_MeasureItem

    Answer: C

    Note: Verified.  If you've done any development with .Net you are aware of the different events that fire
    in code behind and when you need to use them.  The _Select event is fired in this instance.

    105. You create a Visual Studio .NET setup project to distribute an application.  You add a SQL script named
    appDB.SQL.  You must ensure that the SQL script is executed during the installation process. 
    What should you do?

    A. Add a custom action to your setup project.  Select appDB.SQL as the source path.
    B. Add a batch file to your setup procject to execute appDB.SQL.  Add a launch condition to to setup project.
       Set the Condition property to the batch file.
    C. Create a new Visual Studio .Net project that executes appDB.SQL.  Include the new project with your setup project.
       Add a custom action that launches the new project during installation.
    D. Add a launch condition to your setup project.  Set the Condition property to appDB.SQL.

    Answer: A

    Note: Verified.

    106. You use Visual Studio .Net to create a custom control named Stats.  Stats will operate by periodically polling
    your network and updating the network statistics displayed to each user.  Stats contains a Timer control named Timer1.
    You set the control's Interval property to 500 milliseconds.  You write code in the Tick event handler for Timer1 to
    poll the network status.  You also create a procedure named RedrawControl to update the statistics displayed in
    Stats.  When the form that contains Stats is minimized or hidden behind another window, the control should not
    consume unnecessary resources by updating the display.  You must ensure that this condition is met.  In addition,
    you want to write the minimum amount of code needed to finish developing Stats.
    Which two actions should you take? (Each correct answer represents part of the solution.  Choose two)

    A. Place the following code segment in the Tick event handler for Timer1: RedrawControl()
    B. Place the following code segment in the Tick event handler for Timer1: Me.Invalidate()
    C. Place the following code segment in the Paint event handler for Timer1: If Me.Visible = True Then Me.Invalidate()
    D. Place the following code segment in the Tick event handler for Timer1: If Me.Visible = True Then Me.Invalidate()
    E. Place the following code segment in the Paint event handler for Stats: RedrawControl(1)
    F. Place the following code segment in the Paint event handler for Stats: Me.Invalidate

    Answer: D, E

    Note: Verified.

    107. You create an assembly by using Visual Studio .Net.  The assembly is consumed by other .Net applications to
    manage the creation and deletion of XML data files.  The assembly includes a method named DeleteXMLFile that uses
    the Win32 API to delete the XML data files.  A security exception is thrown when DeleteXMLFile is called from
    another .Net application.  You must modify DeleteXMLFile to ensure that this method can execute functions exposed
    by the Win32 API.  To do so, you create a SecurityPermission object that represents the right to call unmanaged code.
    Which method of the SecurityPermission object should you call?

    A. Assert
    B. Demand
    C. PermitOnly
    D. RevertDeny
   
    Answer: A
   
    Note: Verified.

    108. You develop a Windows-based application that will retrieve employee vacation data and display it in a
    DataGrid control.  The data is managed locally in a DataSet object named employeeDataSet.  You need to write
    code that will enable users to sort data by department.
    Which code segment should you use?

    A. Dim dvDept As New DataView()
       dvDept.Table = employeeDataSet.Tables(0)
       dvDept.Sort = "ASC"
       DataGrid1.DataSource = dvDept
    B. Dim dvDept As New DataView()
       dvDept.Table = employeeDataSet.Tables(0)
       dvDept.Sort = "Department"
       DataGrid1.DataSource = dvDept
    C. Dim dvDept As New DataView()
       dvDept.Table = employeeDataSet.Tables(0)
       dvDept.ApplyDefaultSort = True
       DataGrid1.DataSource = dvDept
    D. Dim dvDept As New DataView()
       dvDept.Table = employeeDataSet.Tables(0)
       dvDept.ApplyDefaultSort = False
       DataGrid1.DataSource = dvDept

    Answer: B
   
    Note: Verified.

    109. You develop a Windows-based application that stores and retrieves data in a Microsoft SQL Server database
    called Sales.  Your application uses ADO.NET and the SqlClient managed provider.  You need to identify the security
    level of all errors returned from SQL Server. 
    What should your error-handling code do?

    A. Catch the SqlException that is thrown when the error occurs and access the Source property.
    B. Catch the SqlException that is thrown when the error occurs and access the Class property.
    C. Examine the State property of the SqlConnection object for the status of the connection after the error occurs.
    D. Examine the DataSource property of the SqlConnection object for the status of the connection after the error
       occurs.

    Answer: B

    Note: Verified.

    110. You develop a Windows-based application by using Visual Studio .Net.  The application tracks information about
    customers, orders and shipping.  Ten users will use the application on the client computers running Windows 2000
    Professional.  You deploy the application by copying the contents of the project's \bin folder to the client
    computers.  Nine users report that the application runs as expected.  One user receives the following error message
    when the application is first exectuted:
    "The dynamic link library mscoree.dll could not be found in the specified path C:\Program File\Orders
    App;.;C:\WINN\System32;C:\WINNT\System;C:\WINNT\System32;C:\WINNT;C:\WINNT\System32\Wbem."
    You need to correct this problem on the client computer.
    What should you do?

    A. Install MDAC 2.7.
    B. Install Internet Explorer 6.
    C. Install the redistribute package for the .NET Framework.
    D. Recopy the contents of the \bin folder.

    Answer: C

    Note: Verified.

    111. You use Visual Studio .Net to create a data entry form.  The form enables users to edit personal information
    such as address and telephone number.  The form contains a text box named textPhoneNumber.  If a user enters an
    invalid telephone number, the form must notify the user of the error.  You create a function named ValidPhone that
    validates the telephone number entered.  You include an ErrorProvider control named ErrorProvider1 in your form.
    Which additional code segment should you use?

    A. Private Sub textPhone_Validating (ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) _
       Handles textPhoneNumber.Validating
          If ValidPhone() = False then ErrorProvider1.SetError(textPhone, "Invalid Phone. ")
       End Sub
    B. Private Sub textPhone_Verified (ByVal sender As Object, ByVal e As System.EventArgs) _
       Handles textPhoneNumber.Verified
          If ValidPhone() = False then ErrorProvider1.SetError(textPhone, "Invalid Phone. ")
       End Sub
    C. Private Sub textPhone_Validating (ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) _
       Handles textPhoneNumber.Validating
          If ValidPhone() = False then ErrorProvider1.GetError(textPhone, "Invalid Phone. ")
       End Sub
    D. Private Sub textPhone_Verified (ByVal sender As Object, ByVal e As System.EventArgs) _
       Handles textPhoneNumber.Verified
          If ValidPhone() = False then ErrorProvider1.GetError(textPhone)
       End Sub
    E. Private Sub textPhone_Validating (ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) _
       Handles textPhoneNumber.Validating
          If ValidPhone() = False then ErrorProvider1.UpdateBinding()
       End Sub
    F. Private Sub textPhone_Verified (ByVal sender As Object, ByVal e As System.EventArgs) _
       Handles textPhoneNumber.Verified
          If ValidPhone() = False then ErrorProvider1.UpdateBinding()
       End Sub

    Answer: A

    Note: Verified. Use setError, not GetError!  Use Validating, not Verified!

    112. You develop a Windows-based application that enables users to update customer contact information.  Your
    application uses a DataSet object to maintain the customer data while users are reviewing and editing it.  When a
    user finishes updating the data, your application uses the DataSet.WriteXml method to create an XML data file.
    The tag name of the root element of the XML data file must be: CustomerInfo
    You need to add code to your application to ensure that this tag name is set correctly.
    Which code segment should you use?

    A. dsCustomer.Namespace = "CustomerInfo".
    B. dsCustomer = New DataSet("CustomerInfo").
    C. dsCustomer.Prefix = "CustomerInfo".
    D. dsCustomer.WriteXml("CustomerInfo").

    Answer: A

    Note: Verified.

    113. You are preparing a localized version of a Windows Form.  Users of this form speak a language that prints text
    from right to left.  User interface elements on the form need to conform to this alignment.  You must ensure that
    all user interface elements are properly formatted when the localized Windows Form runs.  You must also ensure that
    the form is easy to update and maintain.
    What should you do?

    A. Set the RightToLeft property on each control on the form to Yes.
    B. Set the RightToLeft property of the form to Yes.
    C. Set the Language property of the form to the appropriate language.
    D. Set the Localizable property of the form to True.

    Answer: B

    114. You use Visual Studio .NET to develop a Windows-based application that interacts with a Microsoft SQL Server
    database.  Your application contains a form named CustomerForm.  You add the following design-time components to
    the form:
    * SqlConnection object named NorthwindConnection.
    * SqlDataAdapter object named NorthwindDataAdapter.
    * DatSet object named NorthwindDataSet.
    * Five TetBox controls to hold the values exposed by NorthwindDataSet.
    At design time, you set the DataBindings properties of each TextBox control to the appropriate column in the
    DataTable object of NorthwindDataSet.  When you test the application, you can successfully connect to the database.
    However, no data is displayed in any text boxes.  You need to modify your application code to ensure that data is
    displayed appropriately.  Which behavior should occur while the CustomerForm.Load event handler is running?
   
    A. Execute the Add method of the TextBoxes DataBindings collection and pass in NorthwindDataSet.
    B. Execute the BeginInit method of NorthwindDataSet.
    C. Execute the Open method of NorthwindConnection.
    D. Execute the FillSchema method of NorthwindDataAdapter and pass in NorthwindDataSet.
    E. Execute the Fill method of NorthwindDataAdapter and pass in NorthwindDataSet.

    Answer: E

      Note: Verified.  Dataset is a container; therefore, you need to fill it with data. You can populate a dataset by
    calling the Fill method of a data adapter.

    115. You use Visual Studio .Net to create a Windows Service application.  You compile a debug version and install
    it on your computer, which runs Windows 2000 Server.  You start the application from the Windows 2000 Service
    Control Manager.  Now you need to begin debugging it within Visual Studio .Net. 
    What should you do?

    A. Add a reference to the application within Visual Studio .Net.  Add breakpoints to the code.  Invoke the breakpoints
       by sending Stop, Pause and Continue commands from the Service Control Manager.
    B. Select Processes from the Debug menu and attach the debugger to your application.
    C. Place a breakpoint in the OnStart method of the application and then run it.
    D. Place a breakpoint in the Main procedure of the application and then run it.

    Answer: B

    Note: Verified.