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

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

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


You are a developer for a company that provides free software over the Internet. You are developing en email 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 versions 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?   Package a main assembly for source code and the default culture. Package satellite assemblies for the other cultures.
You are a developer for a Gsoft Inc that provides free software over the Internet. You are developing en 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 versions 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?   Package a main assembly for source code and the default culture. Package satellite assemblies for the other cultures.

You are creating a custom exception named BusinessException for your application. Which constructors should you implement for this class? (Select the three best answers.)   public MyOwnCustomException ()
You are creating a custom exception named BusinessException for your application. Which constructors should you implement for this class? (Select the three best answers.)   
public MyOwnCustomException (
string message) : base(message)
You are creating a custom exception named BusinessException for your application. Which constructors should you implement for this class? (Select the three best answers.)   
public MyOwnCustomException(string message,
Exception inner) : base(message, inner)
You are creating a graphics application that will manipulate a variety of image formats. You have created an OpenFileDialog object in your program and have set its Filter property as follows:

ofdPicture.Filter=
"Image Files (BMP, GIF, JPEG, etc.)|" +
"*.bmp;*.gif;*.jpg;*.jpeg;" +
"*.png;*.tif;*.tiff|" +
"BMP Files (*.bmp)|*.bmp|" +
"GIF Files (*.gif)|*.gif|" +
"JPEG Files (*.jpg;*.jpeg)" +
"|*.jpg;*.jpeg|" +
"PNG Files (*.png)|*.png|" +
"TIF Files (*.tif;*.tiff)" +
"|*.tif;*.tiff|" +
"All Files (*.*)|*.*";

You have created a Button control with its Text property set to Open Image.... When you click this button, you display the OpenFileDialog object to allow a selection. You want .bmp files to be the default choice in the dialog box. Which of the following values for the FilterIndex property must you choose to achieve this in the event handler of the Button control's Click event?   2

You are designing a custom control for use in industrial automation. This control will monitor a serial port and raise events based on data sent in through the serial port. This control will be hosted on forms, but it does not require any visual representation at runtime. From which class should you derive this control?   Component
You are designing a file-analysis application that will use heuristic methods to find information in arbitrary files. When the user specifies a disk file, you want to open that file and read it 1 byte at a time. Which .NET class can you use to accomplish this task?   FileStream
You are designing a Windows application that has a variety of controls on its user interface. Some controls will be used infrequently. For these controls, you do not want the user to be able to tab to the control, but the user should still be able to activate the control by clicking it. Which of the following options should you use?   Set the control's TabStop property to false.
You are designing a Windows service that will be used by computers in many countries. The service stores information related to computer uptime and page faults. For storing this information for future analysis, which culture should you use?   The invariant culture.
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 a 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. (Line numbers are included for reference only) 01 public int LineItemInsert(int empID, int projectID, 02 decimal hrs, SqlConnection cnn) 03 { 04 string SQL; 05 int Ret; 06 07 SQL = String.Format( 08 “INSERT INTO TimeEntries (EmpID, ProjectID, Hours) “ 09 + 10 “VALUES ({0}, {1}, {2})”, 11 empID, project ID, hrs); 12 SqlCommand cmd = new SqlCommand(SQL, cnn); 13 14 // Insert new code. 15 } You 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 14?   cnn.Open(); Ret = cmd.ExecuteNonQuery(); cnn.Close(); return Ret;
You are developing an accounting application that includes a class named Transaction. The Transaction class is inherited by subclasses such as DepositTransaction and PaymentTransaction. The Transaction class includes a method named VerifyChecksum(). The VerifyChecksum() method should be available to the Transaction class and to all classes derived from the Transaction class, but it should not be available to any other classes in the application. Which access modifier should you use in the declaration of the VerifyChecksum() method?   protected
You are distributing a .NET component to target computers. This component must be installed in the global assembly cache (GAC) so that it can be shared by every application on the target computer. In addition, you want to allow clients to check the identity of your company via a certificate from a third-party authority. How should you sign this component's code?   Use sn.exe followed by signcode.exe to sign the assembly.
You are invoking a Web service that returns a StreamReader object. Which project requires a reference to the System.IO namespace, where this object is defined?   Both the client project and the Web service project
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 CalculateSales. To test your hypothesis, you place a breakpoint on the following line of code: decTax = CalculateSales(decRate, decSaleAmount); However, when you run the application to create a test invoice, the breakpoint is not invoked. How should you correct this problem?   Select Configuration Manager from the Build menu. Set the Activate Solution Configuration option to Debug. Set the Configuration property of the project to Debug.
You are moving an existing COM-based application to .NET. Part of your existing application depends on a third-party COM-based library to which you do not have the source code. The library is implemented as a set of objects with no user interface. How should you proceed?   Build a runtime callable wrapper (RCW) for the library.
You are performing final acceptance testing on your application prior to shipping it. You have set a breakpoint inside the SelectedIndexChanged event handler for a combo box. However, when you select a new value in this combo box, the code does not stop at the breakpoint. What could be the problem?   You are executing the project by using the default Release configuration.
You are planning to deploy an assembly into the GAC so that it can be used by any application on the target computer. What must you do?   Sign the assembly with a strong name.
You are planning to display invoices on a DataGrid control. The user will specify a customer, and then you'll retrieve from the database all the invoices for that customer. Which database object should you use to retrieve these invoices?   A stored procedure
You are preparing a localized version of a Windows Form named MyLocal. Users of MyLocal 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 MyLocal is easy to update and maintain. What should you do?   Set the RightToLeft property of the form to Yes.
You are responsible for maintaining a COM component that is used by numerous applications throughout your company. You are not yet ready to migrate this COM component to .NET managed code, but you need to make it available to an increasing number of other projects that are being developed under the .NET Framework. What should you do?   Use the Type Library Importer to create and sign an assembly that will use the COM component. Place the COM component in the GAC.
You are shipping a text-editing application to a variety of locales, including the United States, France, Israel, China, and Japan. One feature of the application is that the user can use it to search for text within long text passages. What should you use to perform this search?   CultureInfo.CompareInfo
You are supplying both an application and a help file for the application to your users. The help file is in HTML Help 1.3 format. There is a button on your form that you would like to use to display the table of contents of the help file. What should you use for this task?   Help.ShowHelp() method
You are using the PrintDocument class to print a graphical banner that should span multiple printed pages. However, only the first page of the banner prints. What is the most likely cause of this problem?   You have neglected to set e.HasMorePages to true when more than one page should be printed.
You are using the Installer tool (installutil.exe) to install a set of components. You issue the following command to do so:

installutil Assembly1.exe Assembly2.exe Assembly3.exe

Assembly2 fails to install properly on the target computer. Which assemblies will be installed by the command?   None of the assemblies will be installed.

You company Gsoft 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?   Select each error listed in the Task List window.

You 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?   Enterprise
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 provider implemented by the LicFileLicenseProvider 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 presents part of the solution.)(Choose two)   [LicenseProvider(typeof(LicFileLicenseProvider))]
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 provider implemented by the LicFileLicenseProvider 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 presents part of the solution.)(Choose two)   In the Load event handler for ScrollControl, place the following code segment: License controlLicense; try { controlLicense =LicenseManager.Validate( typeof(ScrollControl), this) ; } catch (Exception exp) { // Insert code to disallow use. }
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 provider implemented by the LicFileLicenseProvider 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 presents part of the solution.)(Choose two)   [LicenseProvider(typeof(LicFileLicenseProvider))]
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 provider implemented by the LicFileLicenseProvider 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 presents part of the solution.)(Choose two)   In the Load event handler for ScrollControl, place the following code segment: Try Dim ControlLicense As License ControlLicense = _ LicenseManager.Validate(GetType(ScrollControl), Me) Catch ex As Exception ‘Insert code to disallow use, End Try
You create a Visual Studio .NET setup project to distribute an application. You add a SQL script named CustomerDB.SQL. You must ensure that the SQL script is executed during the installation process. What should you do?   Add a custom action to your setup project. Select CustomerDB.SQL as the source path.
You create a Visual Studio .NET setup project to distribute an application. You add a SQL script named CustomerDB.SQL. You must ensure that the SQL script is executed during the installation process. What should you do?   Create a new Visual Studio .NET project that executes CustomerDB.SQL. Include the new project with your setup project. Add a custom action that launches the new project during installation.
You create a Windows Form named EmployeeForm. The form enables users to maintain database records in a table named Employee. You need to add several pairs of controls to EmployeeForm. You must fulfill the following requirements: • Each pair of controls must represent one column in the Employee 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 similar to EmployeeForm 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?   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 the Employee table, add one instance of the user control to the EmployeeForm. Repeat this process for the other forms.
You create a Windows Form named GsoftForm. The form enables users to maintain database records in a table named Gsoft.

You need to add several pairs of controls to GsoftForm. You must fulfill the following requirements: • Each pair of controls must represent one column in the Gsoft 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 similar to GsoftForm 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?   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 the Gsoft table, add one instance of the user control to the GsoftForm. Repeat this process for the other forms.

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?   Assert
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 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?   Implement declarative security and execute the minimum permission request to allow access to the file system and Windows registry.
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, Gsoft, 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?   Implement declarative security and execute the minimum permission request to allow access to the file system and Windows registry.

You create the user interface for a Windows-based application. The main form in your application includes an Exit menu item named exitItem and an Exit button named exitCommand. You want the same code to run whether the user clicks the menu item or the button. You want to accomplish this goal by writing the shortest possible code segment. Which code segment should you use?   private void HandleExit( object sender, System.EventArgs e) { // Insert application exit code. } private void MainForm_Load( object sender, System.EventArgs e) { this.exitCommand.Click += new System.EventHandler(HandleExit); this.exitItem.Click += new System.EventHandler(HandleExit); }
You develop a contact management application called Management that will enable users to retrieve information from a central database. After the data is returned to Management, 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. Management 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 presents part of the solution.)(Choose four.)   Create an OleDbDataAdapter object and define the SelectCommand property.
You develop a contact management application called Management that will enable users to retrieve information from a central database. After the data is returned to Management, 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. Management 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 presents part of the solution.)(Choose four.)   Create a DataSet object as a container for the data.
You develop a contact management application called Management that will enable users to retrieve information from a central database. After the data is returned to Management, 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. Management 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 presents part of the solution.)(Choose four.)   Call the DataAdapter.Fill method to populate the DataSet object.
You develop a contact management application called Management that will enable users to retrieve information from a central database. After the data is returned to Management, 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. Management 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 presents part of the solution.)(Choose four.)   Call the DataAdapter.Update method to save changes to the database.
You develop a customer contact application Contact 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?   DataAdapter.Update(DataTable); DataTable.AcceptChanges();
You develop a kiosk application that enables users to register for an e-mail account in your domain. Your application contains two TextBox controls named textName and textEmail. Your application is designed to supply the value of textEmail automatically. When a user enters a name in the textName, an e-mail address is automatically assigned and entered in textEmail. The ReadOnly property of textEmail is set to True. Your database will store each user’s name. It can hold a maximum of 100 characters for each name. However, the database can hold a maximum of only 34 characters for each e-mail address. This limitation allows 14 characters for your domain, @proseware.com, and 20 additional characters for the user’s name. If a user enters a name longer than 20 characters, the resulting e-mail address will contain more characters that the database allows. You cannot many any changes to the database schema. You enter the following in the Leave event handler of textName: textEmail.Text = textName.Replace(“ “,”.”) ? “@proseware.com”; Now you must ensure that the automatic e-mail address is no longer than 34 characters. You want to accomplish this goal by writing the minimum amount of code and without affecting other fields in the database. What should you do?   Set the textName.MaxLenght property to 20.
You develop a kiosk application that enables users to register for an e-mail account in your domain. Your application contains two TextBox controls named textName and textEmail. Your application is designed to supply the value of textEmail automatically. When a user enters a name in the textName, an e-mail address is automatically assigned and entered in textEmail. The ReadOnly property of textEmail is set to True. Your database will store each user’s name. It can hold a maximum of 100 characters for each name. However, the database can hold a maximum of only 34 characters for each e-mail address. This limitation allows 14 characters for your domain, @proseware.com, and 20 additional characters for the user’s name. If a user enters a name longer than 20 characters, the resulting e-mail address will contain more characters that the database allows. You cannot many any changes to the database schema. You enter the following in the Leave event handler of textName: textEmail.Text = textName.Replace(“ “,”.”) ? “@proseware.com”; Now you must ensure that the automatic e-mail address is no longer than 34 characters. You want to accomplish this goal by writing the minimum amount of code and without affecting other fields in the database. What should you do?   Change the code in textName_Leave to ensure that only the first 20 characters of textName.Text are used.
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?   Create a DataView object and set the RowFilter property by using a filter expression.
You develop a Visual Studio .NET application that contains a function named CustomerUpdate. For debugging purposes, you need to add an entry to a log file whenever CustomerUpdate is executed. The log file is named DebugLog.txt. For maximum readability, you must ensure that each entry in DebugLog.txt appears on a separate line. Which code segment should you use?   StreamWriter oWriter = new StreamWriter(File.Open( @”C:\DebugLog.txt”, FileMode.Append)); TextWriterTraceListener oListener = new TextWriterTraceListener(oWriter); Debug.Listeners.Add(oListener); Debug.WriteLine(“CustomerUpdate “ + DateTime.Now.ToString);
You develop a Visual Studio .NET application that contains a function named GsoftUpdate. For debugging purposes, you need to add an entry to a log file whenever GsoftUpdate is executed. The log file is named DebugLog.txt. For maximum readability, you must ensure that each entry in DebugLog.txt appears on a separate line.

Which code segment should you use?   StreamWriter oWriter = new StreamWriter(File.Open( @”C:\DebugLog.txt”, FileMode.Append)); TextWriterTraceListener oListener = new TextWriterTraceListener(oWriter); 070 - 316 - 22 - Debug.Listeners.Add(oListener); Debug.WriteLine(“GsoftUpdate “ + DateTime.Now.ToString);

You develop a Visual Studio .NET application that dynamically adds controls to its form at run time. You include the following statement at the top of your file: using System.Windows.Forms; In addition, you create the following code to add Button controls: Button tempButton = new Button(); tempButton.Text = NewButtonCaption; tempButton.Name = NewButtonName; tempButton.Left = NewButtonLeft; tempButton.Top = NewButtonTop; this.Controls.Add(tempButton); tempButton.Click += new EventHandler(ButtonHandler); Variables are passed into the routine to supply values for the Text, Name, Left, and Top properties. When you compile this code, you receive an error message indicating that ButtonHandler is not declared. You need to add a ButtonHandler routine to handle the Click event for all dynamically added Button controls. Which declaration should you use for ButtonHandler?   public void ButtonHandler(System.Object sender, System.EventArgs e)
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?   [ToolboxBitmap(@”CustomControl.bmp”)] class FormattedTextBox
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?   [ToolboxBitmap(typeof(TextBox), “CustomControl.bmp”)] class FormattedTextBox
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. What should you do?   SetHelpString
You develop a Windows-based application by using Visual Studio .NET. The application consumes an XML Web service named MortgageRate and exposes a method named GetCurrentRate. The application uses GetCurrentRate to obtain the current mortgage interest rate. Six months after you deploy the application, 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 the application consumes the most recent version of MortgageRate. You must achieve this goal in the most direct way possible. What should you do?   Use the Update Web Reference menu item to update the reference to MortgageRate in the application.
You develop a Windows-based application by using Visual Studio .NET. The application includes a form named GsoftForm and a class named Contact. GsoftForm includes a button named cmdCreateContact. You must ensure that your application creates an instance of Contact when a user clicks this button. You want to write the most efficient code possible.

Which code segment should you use?   Contact contact = new Contact();

You develop a Windows-based application by using Visual Studio .NET. The application includes a form named MainForm and a class named Contact. MainForm includes a button named cmdCreateContact. You must ensure that your application creates an instance of Contact when a user clicks this button. You want to write the most efficient code possible. Which code segment should you use?   Contact contact = new Contact;
You develop a Windows-based application by using Visual Studio .NET. The application includes 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?   Install your application on the client computers. Precompile your application by using the Native Image Generator (Ngen.exe).

You develop a Windows-based application by using Visual Studio .NET. The application includes 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?   Install your application on the client computers. Precompile your application by using the Native Image Generator (Ngen.exe).
You develop a Windows-based application by using Visual Studio .NET. The application tracks information about customers, orders, and shipping. Ten users will use this 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 executed: “The dynamic link library mscoree.dll could not be found in the specified path C\Program Files\Orders App;.;C:\WINNT\System32;C:\WINNT\System;C:\WINNT\System32;C:\WINNT;C:\WINNT\System32\W bem.” You need to correct this problem on the client computer. What should you do?   Install the redistribute package for the .NET Framework.
You develop a Windows-based application by using Visual Studio .NET. The application uses a SqlConnection object for database access. You typically run the 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?   Call the Dispose method of the SqlConnection object.
You develop a Windows-based application by using Visual Studio .NET. You use Gsoft’s intranet to deploy the application to client computers. You use the security configuration of the .NET Framework to configure security for you application at the enterprise policy level. Virus attacks cause the IT manager at Gsoftto tighten security at the machine level. Users report that they can no longer execute your application.

How should you correct this problem?   Include the LevelFinal attribute in the intranet code group policy at the enterprise level by using the Code Access Security Policy tool (Caspol.exe).

You develop a Windows-based application by using Visual Studio .NET. You use your company intranet to deploy the application to client computers. You use the security configuration of the .NET Framework to configure security for you application at the enterprise policy level. Virus attacks cause the IT manager at your company to tighten security at the machine level. Users report that they can no longer execute your application. How should you correct this problem?   Include the LevelFinal attribute in the intranet code group policy at the enterprise level by using the Code Access Security Policy tool (Caspol.exe).
You develop a Windows-based application by using Visual Studio .NET. Your application implements ADO.NET objects to call Microsoft SQL Server stored procedures. Your database administrator is responsible for coding and maintaining all stored procedures. Periodically, the administrator modifies the stored procedures. At run time, your application code must discover any changes in the way that values are passed to and returned from the stored procedures. Which ADO.NET object and method should you use?   CommandBuilder.DeriveParameters
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?   Implement an XmlValidatingReader object and code an event handler to process its events.
You develop a Windows-based application called Security by using Visual Studio .NET and Microsoft SQL Server. The application will perform numerous Assert, Deny, and PermitOnly security operations while it is executing. You must ensure that the application is optimized for fast run-time execution. What should you do?   Perform declarative security checks.
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 ServerA 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?   "Data Source= ServerA; Initial Catalog=CustomerService"
You develop a Windows-based application named Invoice that enables users to enter and edit customer orders. Invoice contains a DataSet object named orderEntryDataSet and DataTable object named orderDataTable and orderDetailDataTable. The orderDetailDataTable requires two columns to make a unique primary key. You need to define a primary key for orderDetailDataTable. What should you do?   Set the DataTable.PrimaryKey property to an array of DataColumn objects that reference the columns that make the primary key.
You develop a Windows-based application named Orders. 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?   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.
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?   DataSet ds = new DataSet(“PayrollData”); ds.ReadXml(datafile, XmlReadMode.InferSchema);
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?   Call the DataSet.WriteXml method and specify DiffGram as the XmlWriteMode parameter.
You develop a Windows-Based application that accesses a Microsoft SQL Server database named CustomerData. 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?   to use the same application logon ID and password for every connection to the CustomerData database.
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 void FillDataGrid() { SqlConnection cnn = new SqlConnection(“server=localhost;uid=sa;pwd=;database=Northwind”); SqlDataAdapter da = new SqlDataAdapter(“SELECT CustomerID, ContactName, CITY “ + “FROM Customers”, cnn); DataSet ds = new DataSet(); da.MissingSchemaAction = MissingSchemaAction.AddWithKey; da.Fill(ds, “Customers”); DataView dv = new DataView(ds.Tables[“Customers”]); dv.Sort = “City ASC, ContactName ASC”; dv.ApplyDefaultSort = true; dataGrid1.DataSource = dv; } 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?   Set the Sort property of the DataView object to an empty string.
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?   try { MyConnection.Open(); } catch (SqlException e) { // Insert error-handling code. }
You develop a Windows-based application that contains a class named Contact. Contact used 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 releases as soon as the class stops being consumed. What should you do?   Implement the Dispose method of the IDisposable interface. Place the appropriate cleanup code in the implemented Dispose method. Call the Dispose method of your form before releasing the reference.
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?   Load
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: <employee id=”3” name=”Paul” age=”29” /> You need to write code to specify the format for the XML output. Which code segment should you use?   foreach (DataColumn dc in ds.Tables[“employee”].Columns) { dc.ColumnMapping = MappingType.Attribute; }
You develop a Windows-based application that enables to enter product sales. You add a subroutine named CalculateTax. You discover that CalculateTax sometimes raises an IOException during execution. To address this problem. You create two additional subroutines named LogError and CleanUp. These subroutines are governed by the following rules: • LogError must be called only when CalculateTax raises an exception. • CleanUp must be called whenever CalculateTax is complete. You must ensure that your application adheres to these rules. Which code segment should you use?   try { CalculateTax(); } catch (Exception e) { LogError(e); } finally { CleanUp(); }
You develop a Windows-based application that enables to enter product sales. You add a subroutine named Gsoft.

You discover that Gsoft sometimes raises an IOException during execution. To address this problem you create two additional subroutines named LogError and CleanUp. These subroutines are governed by the following rules: • LogError must be called only when Gsoft raises an exception. • CleanUp must be called whenever Gsoft is complete.

You must ensure that your application adheres to these rules. Which code segment should you use?   try { Gsoft(); } catch (Exception e) { LogError(e); } finally { CleanUp(); }

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?   dsCustomer = New DataSet(“CustomerInfo”)
You develop a Windows-based application that includes the following code segment. (Line numbers are included for reference only.) 01 private void Password_Validating(object sender, 02 System.ComponentModel.CancelEventArgs e) 03 { 04 if (ValidPassword() == false) 05 { 06 //Insert new code. 07 } 08 } 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 6.   e.Cancel = true;
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 02 ( 03 @category int, 04 @totalprice money OUTPUT 05 ) 06 AS 07 SET NOCOUNT ON 08 UPDATE Products SET UnitPrice = UnitPrice * 1.1 WHERE CategoryID = @category 09 SELECT @totalprice = sum(UnitPrice) FROM Products 10 SELECT ProductName FROM Products WHERE CategoryID = @category 11 RETURN @Totalprice You application uses the ExecuteReader method of the SqlCommand object to call the stored procedure and create a SqlDataReader object. After the stored procedure runts, 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?   Change line 7 to SET NOCOUNT OFF
You develop a Windows-based application that processes customer data from a database. Your customer service representatives will use the application to view or edit customer data. One procedure in your application calls a function named ProcessCustomer. You want to add code to your application to record error information and performance data relating to ProcessCustomer. This information must be recorded in a log file named InfoLog.txt on the computer that executes the application. In addition, you want to be able to enable and disable logging without recompiling your application, and you want the option of logging error information only, or of logging both error information and performance data. Which code segment should you use?   FileStream fs = new FileStream( @”C:\InfoLog.txt”, FileMode.Append); StreamWriter oWriter = new StreamWriter(fs); TextWriterTraceListener oListener = new TextWriterTraceListener(oWriter); TraceSwitch oSwitch = new TraceSwitch(“MySwitch”, “My TraceSwitch”); Trace.Listeners.Add(oListener); try { Trace.WriteLineIf(oSwitch.Trace Verbose, “Before ProcessCustomer() “ + Now); ProcessCustomer(); Trace.WriteLineIf(oSwitch.TraceVerbose, “After ProcessCustomer() “ + Now); } catch(Exception oEx) { Trace.WriteLineIf(oSwitch.TraceError, oEx.Message); oWriter.Flush(); oWriter.Close(); }
You develop a Windows-based application that stores and retrieves data in a Microsoft SQL Server database. Your application uses ADO.NET and the SqlClient managed provider. You need to identify the severity level of all errors returned from SQL Server. What should your errorhandling code do?   Catch the SqlException that is thrown when the error occurs and access the Class property.
You develop a Windows-based application that uses a Microsoft SQL Server database to store and retrieve data. You decide to create a central error-handling procedure that processes all data errors that occur in your application. You must ensure that your application displays all error information that is received from the database. How should you write the error-handling procedure?   public void DisplaySqlErrors(SqlException myEx) { foreach(SqlError x in myEx.Errors) { MessageBox.Show(“Error: “ + x.ToString()); } }
You develop a Windows-based application that uses several functions to calculate a given inventory quantity. This quantity is stored in a variable named Quantity. When you test your application, you discover that the value of Quantity 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 Quantity. Which code segment should you use?   Trace.Assert(Quantity >= 0, _ “Inventory cannot be less than zero.”);
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 the data by department. Which code segment should you use?   DataView dvDept = new DataView(); dvDept.Table = employeeDataSet.Tables[0]; dvDept.Sort = “Department”; DataGrid1.DataSource = dvDept;
You develop a Windows-based application to manage business contacts. The application retrieves a list of contacts from a central database. The list is managed locally in a DataSet object named listDataSet, and it is displayed in a DataGrid control. You create a procedure that will conduct a search after you enter a combination of personal name and family name. You application currently includes the following code segment: DataView dv = new DataView(); int i; dv.Table = listDataSet.Tables(0); dv.Sort = “FamilyName, PersonalName”; DataGrid1.DataSource = dv; You need to search for a conduct whose personal name is Fukiko and whose family name is Ogisu. Which code segment should you use?   object[] values = {“Ogisu”, “Fukiko”}; i = dv.Find(values); DataGrid1.CurrentRowIndex = i;
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 then be displayed in a DataGrid control. Which code segment should you use?   DataView dv = new DataView(); dv.Table = contactDataSet.Tables[0]; dv.RowFilter = String.Format(“City = ‘{0}’”, TextBox1.Text); DataGrid1.DataSource = dv;
You develop a Windows-based application to manage inventory. The application calls a Microsoft SQL Server stored procedure named sp_UpdatePrices. sp_UpdatePrices performs a SQL UPDATE statement that increases prices for selected items in an inventory table. It returns an output parameter named @totalprice and a result set that contains all of the records that were updated. @totalprice contains the sum of the prices of all items that were updated. You implement a SqlCommand object that executes sp_UpdatePrices and returns the results to a SqlDataReader object. The SqlDataReader object gives you access to the data in the result set. Which is displayed in a list box on your Windows Form. The value of @totalprice must also be displayed in a text box on your Windows Form. You need to write code that will retrieve this value. Which code segment should you use?   reader.Close(); TextBox1.Text = com.Parameters[“@totalprice”].Value.ToString();
You develop a Windows-based application. Its users will view and edit employee attendance data. The application uses a DataSet object named customerDataSet 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?   DataSet changeDataSet = customDataSet.GetChanges(); myComponent.Validate(changeDataSet);
You develop a Windows-based application. The application uses a DataSet object that contains two DataTable objects. The application will display data from the 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?   Add a DataRelation object to the Relation collection of the DataSet object.
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 presents part of the solution.)(Choose three)   SqlParameter prm = new SqlParameter( “@FamilyName”, SqlDbType.VarChar);
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 presents part of the solution.)(Choose three)   prm.Direction = ParameterDirection.Input;
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 presents part of the solution.)(Choose three)   cmd.Parameters.Add(prm);
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 stores it in a variable named Name. Your application must then submit a Microsoft SQL Server query to the central customer service database. How should you write the query?   SQL = “SELECT” PersonalName, FamilyName FROM “ & _ “Customers WHERE FamilyName LIKE ‘” & Name & “%’”
You develop a Windows-based inventory application. The application will use a SqlDataAdapter object, a SqlCommandBuilder object, and a DataSet object to retrieve data from and manage updates to a Microsoft SQL Server database. You write the following code to set up the objects: SqlConnection cn = new SqlConnection( “server=CONTOSO;database=Inventory”); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter( “SELECT ProductDescription, UnitPrice FROM Products”, cn); SqlCommandBuilder cd = new SqlCommandBuilder(da); When you test the application, you can successfully retrieve data from the DataSet object. However, when you try to send modified data back to the database, your changes are not saved. How should you correct this problem?   Specify an UpdateCommand property for the SqlDataAdapter object.
You develop a Windows-based inventory application. The application will use a SqlDataAdapter object, a SqlCommandBuilder object, and a DataSet object to retrieve data from and manage updates to a Microsoft SQL Server database. You write the following code to set up the objects: SqlConnection cn = new SqlConnection( “server=CONTOSO;database=Inventory”); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter( “SELECT ProductDescription, UnitPrice FROM Products”, cn); SqlCommandBuilder cd = new SqlCommandBuilder(da); When you test the application, you can successfully retrieve data from the DataSet object. However, when you try to send modified data back to the database, your changes are not saved. How should you correct this problem?   Include the primary key field of the Products table in the SELECT query.
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 SPInventory to update rows in the database. SPInventory will run many times during each user session. Your application will use a SqlCommand object to execute SPInventory. You must revise your code so that the use of this object optimizes query performance. What should you do?   Call the SqlCommand.Prepare method before the first call to SqlCommand.ExecuteNonQuery.
You develop a Windows-based order entry application Entry by using Visual Studio .NET. Entry includes a DataSet object. When a customer order exceeds the number of items currently available in stock, Entry 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?   DataSet.Copy
You develop a Windows-based order entry application Entry by using Visual Studio .NET. Entry includes a DataSet object. When a customer order exceeds the number of items currently available in stock, Entry 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?   DataSet.GetChanges
You develop a Windows-based order entry application. The application uses a DataSet object named customerDataSet to manage client data while users edit and update customer records. The DataSet object contains a DataTable object named creditAuthorizationDataTable. This object contains a field named MaxCredit, which specifies the credit limit for each customer. Customer credit limits cannot exceed $20,000. Therefore, your application must verify that users do not enter a larger amount in MaxCredit. If a user does so, the user must be notified, and the error must be corrected, before any changes are stored permanently in the database.

You create a procedure named OnRowChanged. This procedure sets the DataTable.Row.RowError property for each row that includes an incorrect credit limit. You also enable the appropriate event handling so OnRowChanged is called in reaction to the RowChanged event of the DataTable object. OnRowChanged will run each time a user changes data in a row. OnRowChanged contains the following code segment: private sender, DataRowChanged( Object sender, DataRowChangeEventArgs e) { if ((double) e.Row[“MaxCredit”] > 20000) { Row.RowError = “Over credit limit.”; } } Before updating the database, your application must identify and correct all rows that are marked as having an error. Which code segment should you use?   foreach (DataRow myRow in creditAuthorizationDataTable.GetErrors()) { MessageBox.Show( String.Format(“CustID = {0}, Error = {1}”, MyRow[“CustID”], myRow.RowError)); }

You develop a Windows-based time and billing application named Billing. 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 Billing, you frequently receive an exception of type InvalidCastException. What us the cause of this error?   The data that you are trying to load into a column is not the correct data type specified for that column.
You develop an application 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 presents part of the solution.)(Choose two)   Set the Compression property of your setup project to Optimized for size.
You develop an application 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 presents part of the solution.)(Choose two)   Set the Bootstrapper property of your setup project to None.
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 DataTable 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 total 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?   DataColumn totalColumn = new DataColumn(“Total”,Type.GetType(“System.Decimal”)); PODetails.Columns.Add(totalColumn); totalColumn.Expression = “Quantity * UnitPrice”;
You develop an application that generates random numbers to test statistical data. The application uses the following code segment: Random rnd = new Random(); short num1 = Convert.ToInt16(rnd.Next(35000)); short num2 = Convert.ToInt16(rnd.Next(35000)); short num3 = Convert.ToInt16(num1 / num2); When you test the application, you discover that certain exceptions are sometimes raised by this code. You need to write additional code that will handle all such exceptions. You want to accomplish this goal by writing the minimum amount of code. Which code segment should you use?   try { // Existing code goes here. } catch (ArithmeticException e) { // Insert error-handling code. }
You develop an application that includes a Contact Class. The contact class is defined by the following code:

public class Contact{ private string name; public event EventHandler ContactSaved; public string Name { get {return name;} set {name = value;} } public void Save () { // Insert Save code. // Now raise the event. OnSave(); } public virtual void OnSave() { // Raise the event: if (ContactSaved != null) { ContactSaved(this, null); } } } You create a form named GsoftForm. This form must include code to handle the ContactSaved event raised by the Contact object. The Contact object will be initialized by a procedure named CreateContact.

Which code segment should you use?   private void HandleContactSaved( object sender, EventArgs e) { // Insert event handling code. } private void CreateContact() { Contact oContact = new Contact(); oContact.ContactSaved += new EventHandler (HandleContactSaved); oContact.Name = “Gsoft”; oContact.Save(); }

You develop an application that includes a Contact Class. The contact class is defined by the following code: public class Contact{ private string name; public event EventHandler ContactSaved; public string Name { get {return name;} set {name = value;} } public void Save () { // Insert Save code. // Now raise the event. OnSave(); } public virtual void OnSave() { // Raise the event: if (ContactSaved != null) { ContactSaved(this, null); } } } You create a form named MainForm. This form must include code to handle the ContactSaved event raised by the Contact object. The Contact object will be initialized by a procedure named CreateContact. Which code segment should you use?   private void HandleContactSaved( object sender, EventArgs e) { // Insert event handling code. } private void CreateContact() { Contact oContact = new Contact(); oContact.ContactSaved += new EventHandler (HandleContactSaved); oContact.Name = “Bruce”; oContact.Save(); }
You develop an application that invokes a procedure named ProcessRecords. You implement the Trace class to log any errors thrown by ProcessRecords. You direct the Trace output to a local log file named ErrorLog.txt by using the following code segment: StreamWriter oWriter = new StreamWriter( File.Open(logfilePath, FileMode.Append)); TextWriterTraceListener oListener = new TextWriterTraceListener(oWriter); Trace.Listeners.Add(oListener); try { ProcessRecords(); } catch (Exception oEx) { Trace.WriteLine(“Error: “ + oEx.Message; } finally { } Now you need to add code to your finally construct to write all output in the ErrorLog.txt file and then close the file. You want to write the minimum amount of code to achieve this goal. Which code segment should you use?   Trace.Flush(); oWriter.Close();
You develop an application that invokes a procedure named ProcessRecords. You implement the Trace class to log any errors thrown by ProcessRecords. You direct the Trace output to a local log file named ErrorLog.txt by using the following code segment: StreamWriter oWriter = new StreamWriter( File.Open(logfilePath, FileMode.Append)); TextWriterTraceListener oListener = new TextWriterTraceListener(oWriter); Trace.Listeners.Add(oListener); try { ProcessRecords(); } catch (Exception oEx) { Trace.WriteLine(“Error: “ + oEx.Message; } finally { }

Now you need to add code to your finally construct to write all output in the ErrorLog.txt file and then close the file. You want to write the minimum amount of code to achieve this goal.

Which code segment should you use?   Trace.Flush(); oWriter.Close();

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?   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.
You develop an enterprise application that includes a Windows Form 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 component will implement the following objects: SqlConnection cn = new SqlConnection(); SqlTransaction tr; If two users try to update the same data concurrently, inconsistencies such as phantom reads will occur. You must now add code to your component to specify the highest possible level of protection against such inconsistencies. Which code segment should you use?   tr = cn.BeginTransaction(IsolationLevel.Serializable);
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. You application uses a SqlCommand object to run sp_GetDailySales. You write the following code to call sp_GetDailySales: SqlConnection cnn = new SqlConnection(myConnString); SqlCommand cmd = new SqlCommand(“sp_GetDailySales”, cnn); cmd.CommandType = CommandType.StoredProcedure; SqlParameter prm = cmd.Parameters.Add(“@ItemTotal”, SqlDbType.Int); prm.Direction = ParameterDirection.Output; cnn.Open(); cmd.ExecuteNonQuery(); Now you must write additional code to access the output parameter. Which code segment should you use?   MessageBox.Show(“Total is: “ + cmd.Parameters[“@ItemTotal”].Value.ToString());
You develop an inventory management application. The application uses a SqlDataReader object to retrieve a product code list from a database. The list is displayed in a drop-down list box on a Windows Form. The Form_Load procedure contains the following code. (Line numbers are included for reference only) 01 public void ReadMyData (String ConnectionString) 02 { 03 String query = 04 “SELECT CatID, CatName FROM Categories”; 05 SqlConnection cnn = new 06 SqlConnection (ConnectionString); 07 SqlCommand cmd = new SqlCommand(query, cnn); 08 SqlDataReader reader; 09 cnn.Open(); 10 // Insert new code. 11 cnn.Close(); 12 } To enable your application to access data from the SqlDataReader object, you need to insert additional code on line 10. Your insertion must minimize the use of database server resources without adversely affecting application performance. Which code segment should you use?   reader = cmd.ExecuteReader(); while (reader.Read()) { ListBox1.Items.Add(reader.GetString(1)); } reader.Close();
You develop an order entry application. Your application uses a DataSet object named CurrentOrders to maintain data in memory while users modify the data. To CurrentOrders, you add DataTable object named Orders and OrderDetails. OrderDetails contains data about each line item that is included in the order. Users frequently discover that an order contains no entries in OrderDetails. In these situations they delete the order from Orders. You must ensure that users cannot delete any orders that have corresponding entries in OrderDetails. What should you do?   Add a ForeignKeyConstraint object to CurrentOrders.
You development team used Visual Studio .NET to create an accounting application, which contains a class named GsoftAccounts. 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 GsoftAccounts is terminated.

What should you do?   Add a destructor to GsoftAccounts. Add code to the destructor to call the ShutDownObject method of each COM component class.

You development team used 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?   Add a destructor to SupplierAccounts. Add code to the destructor to call the ShutDownObject method of each COM component class.
You execute a query on your relational database 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?   ExecuteScalar
You have created a .NET component that will be used by multiple applications from your company. You want to be sure that this component is always installed in the same place and always has the same Registry settings. What type of installation should you create for the component?   Windows Installer merge module
You have created a DataSet object that contains a single DataTable object named Customers. The Customers object has all the rows and columns from the Customers table in your database. Now you would like to bind only selected columns from the Customers table to a DataGrid control. How should you proceed?>   Create a DataView object that retrieves only the desired tables from the DataTable object. Bind the DataGrid control to the DataView object.
You have created a custom component for your application that monitors a bidirectional parallel port for error messages. This component raises an event named PortError whenever an error message is detected. At that point, you must make the error code available to the control container. How should you do this?   Define a custom PortErrorEventArgs class that inherits from the EventArgs class and pass an instance of the class as a parameter of the PortError event.
You have created an array of Project objects named aProjects. Each Project object has a Name property and a DateDue property. You want to display all the Name property values in a ListBox control named lbProjects. Which code snippet should you use for this purpose?   
lbProjects.DataSource = aProjects;
lbProjects.DisplayMember = "Name";
You have created an ASP.NET Web service project that includes a class named RefLibrary. The RefLibrary class contains this method:

public String Version()
{
Version = "1.0.0.8";
}

You are able to instantiate the RefLibrary class from a Web service client project, but the Version() method is not available. What could be the problem?   You must mark the method with the WebMethod attribute.

You have deployed your .NET application to several computers in the SALES domain that are not used for development. Your own computer is in the DEVELOPMENT domain. There is a two-way trust relationship established between the SALES domain and the DEVELOPMENT domain. Users report problems with the running application. You want to attach to the remote process for debugging, but you are unable to do so. What could be the problem?   The Machine Debug Manager (mdm.exe) is not installed on the computers in the SALES domain.
You have purchased a library of shared communications routines that is delivered as a .NET assembly. You want to make the classes in this assembly available to all your .NET applications. Where should you install the assembly?   In the GAC
You have used Visual C# .NET to develop a process manager application. Your application can identify any process on the system that has a user interface, and it allows you to collect information about the process. Now you want to add code that can shut down the identified process as well. Which method should you use to shut down these processes?   Process.CloseMainWindow()
You Microsoft SQL Server database is installed to use integrated security. You are designing a Windows Forms application that will run on your company intranet to access the database. Your application must fulfill the following requirements: • Only authorized users must be able to access data in the database. • Ongoing security administration must be managed by the network administrator. • Users should supply logon information only once.

What should you do?   Ask the network administrator to add users of your application to a designated Windows domain group. Ask the SQL Server database administrator to assign appropriate database permissions for this group. Use this information to dynamically build your connection string.

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 presents a complete solution. )(Choose two)   OleDbCommand comm = new OleDbCommand(); comm.CommandText = “SELECT * FROM Regions”; comm.Connection = conn;
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 presents a complete solution. )(Choose two)   OleDbCommand comm = new OleDbCommand(“SELECT * FROM Regions”, conn); comm.CommandType = CommandType.Text;
You need to retrieve data from a SQL Server database. Which connection class should you use for maximum performance?   System.Data.SqlClient.SqlConnection
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?   Use classes in the System.Data.SqlClient namespace.
You plan to use objects from the System.Drawing namespace to draw shapes on a form at runtime. You have already determined that you will draw these shapes during the form's Paint event. How should you create the Graphics object required by the System.Drawing classes?   Retrieve the Graphics property of the PaintEventArgs object that is passed to the event.
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 presents part of the solution.)(Choose two)   Create a class library project.
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 presents part of the solution.)(Choose two)   Use the following code segment to define BusinessRules: public sealed class BusinessRules
You responsible for maintaining an application that was written by a former colleague at Gsoft. The application reads from and writes to log files located on the local network. The original author included the following debugging code to facilitate maintenance:

try { Debug.WriteLine(“Inside Try”); throw(new IOException());} catch (IOException e) { Debug.WriteLine (“IOException Caught”);} catch (Exception e) { Debug.WriteLine(“Exception Caught”);} finally { Debug.WriteLine (“Inside Finally”);} Debug.WriteLine (“After End Try”); Which output is produced by thus code?   Inside Try IOException Caught Inside Finally After End Try

You responsible for maintaining an application that was written by a former colleague. The application reads from and writes to log files located on the local network. The original author included the following debugging code to facilitate maintenance: try { Debug.WriteLine(“Inside Try”); throw(new IOException());} catch (IOException e) { Debug.WriteLine (“IOException Caught”);} catch (Exception e) { Debug.WriteLine(“Exception Caught”);} finally { Debug.WriteLine (“Inside Finally”);} Debug.WriteLine (“After End Try”); Which output is produced by thus code?   Inside Try IOException Caught Inside Finally After End Try
You use the .NET Framework to develop a new Windows-based application. The application includes a COM component that you created. Company policy requires you to sign the interop assembly with a strong name. However, issues of company security require that you delay signing the assembly for one month. You need to begin using the application immediately on a pilot basis. You must achieve your goal with the least possible effort. What should you do?   Create the interop assembly by using the Type Library Importer (Tlbimp.exe).
You use Visual .NET to develop a Windows-based application whose project name is GsoftMgmt.

You create an application configuration file that will be installed on the client computer along with GsoftMgmt.

You must ensure that the settings in the application configuration file are applied when GsoftMgmt is executed.

What should you do?   Name the configuration file GsoftMgmt.exe.config and copy it to the application folder.

You use Visual Studio .NET to create a class library project. Another developer named Lilliane uses ASP.NET to create an Internet application for the company’s Web site. Lilliane deploys your class library to the \bin folder of her ASP.NET application on the 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 presents part of the solution.)(Choose three)   Use the Build Configuration Manager to set the Active Solution Configuration option to Debug. Set the Project Configuration to Debug. Build your class library.
You use Visual Studio .NET to create a class library project. Another developer named Lilliane uses ASP.NET to create an Internet application for the company’s Web site. Lilliane deploys your class library to the \bin folder of her ASP.NET application on the 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 presents part of the solution.)(Choose three)   Copy the .dll file from the Debug folder of the class library project to the \bin folder of the ASP.NET application.
You use Visual Studio .NET to create a class library project. Another developer named Lilliane uses ASP.NET to create an Internet application for the company’s Web site. Lilliane deploys your class library to the \bin folder of her ASP.NET application on the 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 presents part of the solution.)(Choose three)   Copy the .pdb file from the Debug folder of the class library project to the \bin folder of the ASP.NET application.
You use Visual Studio .NET to create a component ClShared that will be shared by two client applications. Eventually, you plan to deploy new version of ClShared. However, not all of the new versions will be compatible with both client applications. When you deploy ClShared and the client applications, you must ensure that you can upgrade the ClShared 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 presents a complete solution.) (Choose two)   Deploy each client application to its own folder. Deploy a separate copy of ClShared to each client application folder. When you deploy a new version of ClShared, replace the older version only if the new version remains compatible with the client application in the same folder.
You use Visual Studio .NET to create a component ClShared that will be shared by two client applications. Eventually, you plan to deploy new version of ClShared. However, not all of the new versions will be compatible with both client applications. When you deploy ClShared and the client applications, you must ensure that you can upgrade the ClShared 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 presents a complete solution.) (Choose two)   Create a strong name of ClShared and specify a version number. Compile each client application and bind it to ClShared. Deploy ClShared to the global assembly cache on the client computer. Deploy each client application to its own folder. When you deploy a new version of ClShared, increment its version number.
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?   Use the following code segment in AcceptRequest: this.Validate();

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?   Use the following code segment in AcceptRequest: this.Validate();
You use Visual Studio .NET to create a control that will be used on several forms in your application. It is a custom label control that retrieves and displays your company’s current stock price. The control will be displayed on many forms that have different backgrounds. You want the control to show as much of the underlying form as possible. You want to ensure that only the stock price is visible. The rectangular control itself should not be visible.

You need to add code to the Load event of the control to fulfill these requirements.

Which two code segments should you use (Each correct answer presents part of the solution.)? (Choose two)   this.BackColor = Color.Transparent;

You use Visual Studio .NET to create a control that will be used on several forms in your application. It is a custom label control that retrieves and displays your company’s current stock price. The control will be displayed on many forms that have different backgrounds. You want the control to show as much of the underlying form as possible. You want to ensure that only the stock price is visible. The rectangular control itself should not be visible.

You need to add code to the Load event of the control to fulfill these requirements.

Which two code segments should you use (Each correct answer presents part of the solution.)? (Choose two)   this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);

You use Visual Studio .NET to create a control that will be used on several forms in your application. It is a custom label control that retrieves and displays your company’s current stock price. The control will be displayed on many forms that have different backgrounds. You want the control to show as much of the underlying form as possible. You want to ensure that only the stock price is visible. The rectangular control itself should not be visible. You need to add code to the Load event of the control to fulfill these requirements. Which two code segments should you use? (Each correct answer presents part of the solution.)(Choose two)   this.BackColor = Color.Transparent;
You use Visual Studio .NET to create a control that will be used on several forms in your application. It is a custom label control that retrieves and displays your company’s current stock price. The control will be displayed on many forms that have different backgrounds. You want the control to show as much of the underlying form as possible. You want to ensure that only the stock price is visible. The rectangular control itself should not be visible. You need to add code to the Load event of the control to fulfill these requirements. Which two code segments should you use? (Each correct answer presents part of the solution.)(Choose two)   this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
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 presents part of the solution.)(Choose two)   Place the following code segment in the Tick event handler for Timer1: If (this.Visible = True) this.Invalidate();
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 presents part of the solution.)(Choose two)   Place the following code segment in the Paint event handler for Stats: RedrawControl(1);
You use Visual Studio .NET to create a customer database application for your company. Your application contains the following code segment. (Line numbers are included for reference only) 01 foreach(Customer oCustomer in oCompany.Customers){ 02 decPostage = CalculatePostage(oCustomer); 03 } When you debug your application, you discover that the CalculatePostage function sometimes produces incorrect results. You suspect that a problem in one of the property values of oCustomer might be causing the error. oCustomer includes a property named Region that contains the name of the geographical region where the customer resides. The Customers collection of oCompany is sorted by region. As quickly as possible, you need to step through CalculatePostage each time the Region property of oCustomer changes to a new value. What should you do?   Set a breakpoint on line 2. Set its Condition property to oCustomer.Region and select the has changed option.
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 IsValidPhone that validates the telephone number entered. You include an ErrorProvider control named ErrorProvider1 in your form. Which additional code segment should you use?   private void textPhone_Validating( object sender, System.ComponentModel.CancelEventArgs e) { if [!IsValidPhone()) { errorProvider1.SetError(textPhone, “Invalid Phone.”); } }
You use Visual Studio .NET to create a form that includes a submenu item named helpOption. In the Click event handler for helpOption, you write code to open a Web browser loaded with a context-sensitive Help file. You add a ContextMenu item named ContextMenu1 to the form. ContextMenu1 will be used for all controls on the form. Now you need to add code to the Popup event handler for ContextMenu1. Your code will create a popup menu that offers the same functionality as helpOption. You want to use the minimum amount of code to accomplish this goal. Which two code segments should you use? (Each correct answer presents part of the solution.)(Choose two)   ContextMenu1.MenuItems.Clear();
You use Visual Studio .NET to create a form that includes a submenu item named helpOption. In the Click event handler for helpOption, you write code to open a Web browser loaded with a context-sensitive Help file. You add a ContextMenu item named ContextMenu1 to the form. ContextMenu1 will be used for all controls on the form. Now you need to add code to the Popup event handler for ContextMenu1. Your code will create a popup menu that offers the same functionality as helpOption. You want to use the minimum amount of code to accomplish this goal. Which two code segments should you use? (Each correct answer presents part of the solution.)(Choose two)   ContextMenu1.MenuItems.Add(helpOption.CloneMenu();
You use Visual Studio .NET to create a form that includes a submenu item named helpOption. In the Click event handler for helpOption, you write code to open a Web browser loaded with a context-sensitive Help file. You add a ContextMenu item named ContextMenu1 to the form. ContextMenu1 will be used for all controls on the form. Now you need to add code to the Popup event handler for ContextMenu1. Your code will create a popup menu that offers the same functionality as helpOption. You want to use the minimum amount of code to accomplish this goal. Which two code segments should you use? (Each correct answer presents part of the solution.)(Choose two)   ContextMenu1.MenuItems[0].Click += new System.EventHandler(helpOption_Click)
You use Visual Studio .NET to create a Windows Form named Form1. 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)   Add the following code segment to the ControlAdded event handler for BarGraph: DataBarCount.Text = this.Controls.Count;
You use Visual Studio .NET to create a Windows Form named Form1. 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)   Add the following code segment to the constructor for DataBar: this.Parent.DataBarCount.Text = this.Controls.Count;
You use Visual Studio .NET to create a Windows Form named Form1. 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)   Add the following code segment to the AddDataPoint method of BarGraph: DataBarCount.Text = this.Controls.Count;
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?   Select Processes from the Debug menu and attach the debugger to the application.
You use Visual Studio .NET to create a Windows-based application called Mortage. The main form of the application contains several check boxes that correspond to application settings. One of the CheckBox controls is named advancedCheckBox. The caption for advancedCheckBox is Advanced. You must enable users to select or clear this check box by pressing ALT+A. Which two actions should you take? (Each correct answer presents part of the solution.)(Choose two)   Set advancedCheckBox.AutoCheck to True.
You use Visual Studio .NET to create a Windows-based application called Mortage. The main form of the application contains several check boxes that correspond to application settings. One of the CheckBox controls is named advancedCheckBox. The caption for advancedCheckBox is Advanced. You must enable users to select or clear this check box by pressing ALT+A. Which two actions should you take? (Each correct answer presents part of the solution.)(Choose two)   Set advancedCheckBox.Text to “&Advanced”.
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, Group1 and Group2.

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 Group 2. When the user select 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 four actions should you take (Each correct answer presents part of the solution.)? (Choose four)   Set Group1.ShortCut to “ALT1”. Set Group2.ShortCut to “ALT2”.

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, Group1 and Group2.

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 Group 2. When the user select 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 four actions should you take (Each correct answer presents part of the solution.)? (Choose four)   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;

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, Group1 and Group2.

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 Group 2. When the user select 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 four actions should you take (Each correct answer presents part of the solution.)? (Choose four)   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;

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, Group1 and Group2.

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 Group 2. When the user select 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 four actions should you take (Each correct answer presents part of the solution.)? (Choose four)   Set group1Submenu.RadioCheck to True. Set group2Submenu.RadioCheck to True.

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, Group1 and Group2. 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 Group 2. When the user select 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 four actions should you take? (Each correct answer presents part of the solution.)(Choose four)   Set group1Submenu.Text to “Group &1”. Set group2Submenu.Text to “Group &2”.
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, Group1 and Group2. 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 Group 2. When the user select 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 four actions should you take? (Each correct answer presents part of the solution.)(Choose four)   Set Group1.ShortCut to “ALT1”. Set Group2.ShortCut to “ALT2”.
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, Group1 and Group2. 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 Group 2. When the user select 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 four actions should you take? (Each correct answer presents part of the solution.)(Choose four)   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;
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, Group1 and Group2. 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 Group 2. When the user select 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 four actions should you take? (Each correct answer presents part of the solution.)(Choose four)   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;
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, Group1 and Group2. 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 Group 2. When the user select 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 four actions should you take? (Each correct answer presents part of the solution.)(Choose four)   Set group1Submenu.RadioCheck to True. Set group2Submenu.RadioCheck to True.
You use Visual Studio .NET to create a Windows-based application named CustAccess. CustAccess 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 CustAccess, you must ensure that it uses the smallest possible hard disk space on the client computers. What should you do?   Copy your application to a shared folder on your company intranet. Create a shortcut to your application on the desktop of each client computer.
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 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?   Navigate to the Application 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.
You use Visual Studio .NET to create a Windows-based application that will track camera sales. The application’s main object is named Camera. The camera class is create by the following definition: public class Camera { { You write code that sets properties for the Camera class. This code must be executed as soon as an instance of the Camera class is created. Now you need to create a procedure in which you can place your code. Which code segment should you use?   public Camera()
You use Visual Studio .NET to create a Windows-based application that will track Gsoft sales. The application’s main object is named Gsoft. TheGsoft class is created by the following definition: public class Gsoft

You write code that sets properties for the Gsoft class. This code must be executed as soon as an instance of the Gsoft class is created.

Now you need to create a procedure in which you can place your code. Which code segment should you use?   public Gsoft()

You use Visual Studio .NET to create a Windows-based application. On the main application form, FormMain, 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 F1 key, but only of 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?   textConnectionString HelpRequested
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: 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 presents part of the solution.)(Choose two.)   Set transparentPanel.BackColor to Red.
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: 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 presents part of the solution.)(Choose two.)   Set CameraForm.TransparencyKey to Red.
You use Visual Studio .NET to create a Windows-based application. The application enables users to update customer information that is stored in a database. Your application contains several text boxes. All TextBox controls are validated as soon as focus is transferred to another control. However, your validation code does not function as expected. To debug the application, you place the following line of code in the Enter event handler for the first text box: Trace.WriteLine(“Enter); You repeat the process for the Leave, Validated, Validating, and TextChanged events. In each event, the text is displayed in the output window contains the name of the event being handled. You run the application and enter a value in the first TextBox control. Then you change focus to another control to force the validation routines to run. Which code segment will be displayed in the Visual Studio .NET output windows?   Enter TextChanged Leave Validating Validated
You use Visual Studio .NET to create a Windows-based application. The application includes a form named ConfigurationForm. ConfigurationForm contains 15 controls that enable users to set basic configuration options for the application. You design these controls to dynamically adjust when users resize ConfigurationForm. The controls automatically update their size and position on the form as the form is resized. The initial size of the form should be 650 x 700 pixels. If ConfigurationForm is resized to be smaller than 500 x 600 pixels, the controls will not be displayed correctly. You must ensure that users cannot resize ConfigurationForm to be smaller than 500 x 600 pixels. Which two actions should you take to configure ConfigurationForm? (Each correct answer presents part of the solution.)(Choose two)   Set the MinimumSize property to “500,600”.
You use Visual Studio .NET to create a Windows-based application. The application includes a form named ConfigurationForm. ConfigurationForm contains 15 controls that enable users to set basic configuration options for the application. You design these controls to dynamically adjust when users resize ConfigurationForm. The controls automatically update their size and position on the form as the form is resized. The initial size of the form should be 650 x 700 pixels. If ConfigurationForm is resized to be smaller than 500 x 600 pixels, the controls will not be displayed correctly. You must ensure that users cannot resize ConfigurationForm to be smaller than 500 x 600 pixels. Which two actions should you take to configure ConfigurationForm? (Each correct answer presents part of the solution.)(Choose two)   Set the Size property to “650,700”.
You use Visual Studio .NET to create a Windows-based application. The application includes a form named Form1. You implement print functionality in Form1 by using the native .NET System Class Libraries. Form1 will print a packing list on tractor-fed preprinted forms. The packing list always consists of two pages. The bottom margin of page 2 is different from the bottom margin of page 1. You must ensure that each page is printed within the appropriate margins. What should you do?   When printing page 2, set the bottom margin by using the PrintPageEventArgs object.
You use Visual Studio .NET to create a Windows-based application. The application includes a form named Form1. You implement print functionality in Form1 by using the native .NET System Class Libraries. Form1 will print a packing list on tractor-fed preprinted forms. The packing list always consists of two pages. The bottom margin of page 2 is different from the bottom margin of page 1. You must ensure that each page is printed within the appropriate margins. What should you do?   When printing page 2, set the bottom margin by using the QueryPageSettingEventArgs object.
You use Visual Studio .NET to create a Windows-based application. The application includes a form named GraphForm, which displays statistical date 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 presents part of the solution.)(Choose three)   Set GraphForm.MinimizeBox to False.
You use Visual Studio .NET to create a Windows-based application. The application includes a form named GraphForm, which displays statistical date 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 presents part of the solution.)(Choose three)   Set GraphForm.MaximizeBox to False.
You use Visual Studio .NET to create a Windows-based application. The application includes a form named GraphForm, which displays statistical date 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 presents part of the solution.)(Choose three)   Set GraphForm.FormBorderStyle to one of the Fixed Styles.
You use Visual Studio .NET to create a Windows-based application. The application includes a form named GsoftForm.

GsoftForm contains 15 controls that enable users to set basic configuration options for the application.

You design these controls to dynamically adjust when users resize GsoftForm. The controls automatically update their size and position on the form as the form is resized. The initial size of the form should be 650 x 700 pixels.

If ConfigurationForm is resized to be smaller than 500 x 600 pixels, the controls will not be displayed correctly. You must ensure that users cannot resize ConfigurationForm to be smaller than 500 x 600 pixels.

Which two actions should you take to configure GsoftForm (Each correct answer presents part of the solution.)? (Choose two)   Set the MinimumSize property to “500,600”.

You use Visual Studio .NET to create a Windows-based application. The application includes a form named GsoftForm.

GsoftForm contains 15 controls that enable users to set basic configuration options for the application.

You design these controls to dynamically adjust when users resize GsoftForm. The controls automatically update their size and position on the form as the form is resized. The initial size of the form should be 650 x 700 pixels.

If ConfigurationForm is resized to be smaller than 500 x 600 pixels, the controls will not be displayed correctly. You must ensure that users cannot resize ConfigurationForm to be smaller than 500 x 600 pixels.

Which two actions should you take to configure GsoftForm (Each correct answer presents part of the solution.)? (Choose two)   Set the Size property to “650,700”.

You use Visual Studio .NET to create a Windows-based application. The application includes a form named GsoftProcedures (tP). tP allows users to enter very lengthy text into a database. When users click the Print button located on tP, 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?   In the PrintPage event, set the HasMorePages property of the PrintPageEventArgs object to True.

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?   In the PrintPage event, set the HasMorePages property of the PrintPageEventArgs object to True.

You use Visual Studio .NET to create a Windows-based application. The application includes a form named TestForm, which displays statistical date in graph format. You use a custom graphing control that does not support resizing.

You must ensure that users cannot resize, minimize, or maximize TestForm.

Which three actions should you take (Each answer presents part of the solution.)? (Choose three)   Set TestForm.MinimizeBox to False.

You use Visual Studio .NET to create a Windows-based application. The application includes a form named TestForm, which displays statistical date in graph format. You use a custom graphing control that does not support resizing.

You must ensure that users cannot resize, minimize, or maximize TestForm.

Which three actions should you take (Each answer presents part of the solution.)? (Choose three)   Set TestForm.MaximizeBox to False.

You use Visual Studio .NET to create a Windows-based application. The application includes a form named TestForm, which displays statistical date in graph format. You use a custom graphing control that does not support resizing.

You must ensure that users cannot resize, minimize, or maximize TestForm.

Which three actions should you take (Each answer presents part of the solution.)? (Choose three)   Set TestForm.FormBorderStyle to one of the Fixed Styles.

You use Visual Studio .NET to create a Windows-based application. The application includes a form that contains several controls, including a button named exitButton. After you finish designing the form, you select all controls and then select Lock Controls from the Format menu. Later, you discover that exitButton is too small. You need to enlarge its vertical dimension with the least possible effort, and without disrupting the other controls. First you select exitButton in the Windows Forms Designer. What should you do next?   Set the Size property to the required size.
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?   AccessibleName
You use Visual Studio .NET to create a Windows-based data management application named MyApp. You implement the following code segment: TraceSwitch oSwitch = new TraceSwitch(“MySwitch”, “My TraceSwitch”); StreamWriter oWriter = new StreamWriter(File.Open(@”C:\MyApp.txt”, FileMode.Append)); TextWriterTraceListener oListener = new TextWriterTraceListener(oWriter); Trace.Listeners.Add(oListener); try { CustomerUpdate(); } catch (Exception oEx) { Trace.WriteLineIf(oSwitch.TraceError, “Error: “ + oEx.Message); } finally { Trace.Listeners.Clear(); OWriter.Close(); } 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 message generated by CustomerUpdate. You want to use the minimum amount of administrative effort. What should you do?   Edit your application’s .config file to set the value of MySwitch to 1.
You use Visual Studio .NET to create an accounting application called Accounting, which includes a function named CreditCardValidate. This function contains several dozen variables and objects. To debug CreditCardValidate, you create a breakpoint at the top of the function. You run the accounting application within the Visual Studio .NET IDE and step though the code for CreditCardValidate. You need to examine the contents of the variables and objects in scope on each line of code. 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?   Use the Autos window.
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. One of the variables is named bValidationStatus. You create a breakpoint at the top of CreditCardValidate and run the application within the Visual Studio .NET IDE. As you steep through the code in CreditCardValidate, you need to view the contents of the bValidationStatus variable. However, you want to avoid seeing the contents of the other variables and objects in the function. You also need to complete the debugging process as quickly as possible. What should you do?   Add a watch expression for bValidationStatus.
You use Visual Studio .NET to create an accounting application. Within this application, you are debugging a function named GsoftValidate. This function contains several dozen variables and objects. One of the variables is named bValidationStatus.

You create a breakpoint at the top of GsoftValidate and run the application within the Visual Studio .NET IDE.

As you steep through the code in GsoftValidate, you need to view the contents of the bValidationStatus variable. However, you want to avoid seeing the contents of the other variables and objects in the function. You also need to complete the debugging process as quickly as possible.

What should you do?   Open the QuickWatch dialog box for bValidationStatus.

You use Visual Studio .NET to create an accounting application. Within this application, you are debugging a function named GsoftValidate. This function contains several dozen variables and objects. One of the variables is named bValidationStatus.

You create a breakpoint at the top of GsoftValidate and run the application within the Visual Studio .NET IDE.

As you steep through the code in GsoftValidate, you need to view the contents of the bValidationStatus variable. However, you want to avoid seeing the contents of the other variables and objects in the function. You also need to complete the debugging process as quickly as possible.

What should you do?   Add a watch expression for bValidationStatus.

You use Visual Studio .NET to create an application for 100 users in your customer support department. The users run a variety of operating systems on a variety of hardware. You plan to create a distribution package for your application. Your application includes several Windows Forms with many controls on each. You must ensure that the Windows Forms will launch as quickly as possible on client computers. You must not adversely affect the functionality of the application. What should you do?   Add a custom action to your setup project to precompile your application during installation.
You use Visual Studio .NET to create an application named GsoftClient. Another developer in your company creates a component named GsoftComponent. Your application uses namespaces exposed by GsoftComponent.

You must deploy both GsoftClient and GsoftComponent to several computers in your company’s accounting department. You must also ensure that GsoftComponent can be used by future client applications.

What are three possible ways to achieve your goal (Each correct answer presents a complete solution.) (Choose three)   Deploy GsoftClient and GsoftComponent to a single folder on each client computer. Each time a new client application is developed, place the new application in its own folder and copy GsoftComponent to the new folder.

You use Visual Studio .NET to create an application named GsoftClient. Another developer in your company creates a component named GsoftComponent. Your application uses namespaces exposed by GsoftComponent.

You must deploy both GsoftClient and GsoftComponent to several computers in your company’s accounting department. You must also ensure that GsoftComponent can be used by future client applications.

What are three possible ways to achieve your goal (Each correct answer presents a complete solution.) (Choose three)   Deploy GsoftClient and GsoftComponent to a single folder on each client computer. Each time a new client application is developed, place the new application in its own folder. Edit GsoftClient.exe.config and add a privatePath tag that points to the folder where GsoftComponent is located.

You use Visual Studio .NET to create an application named GsoftClient. Another developer in your company creates a component named GsoftComponent. Your application uses namespaces exposed by GsoftComponent.

You must deploy both GsoftClient and GsoftComponent to several computers in your company’s accounting department. You must also ensure that GsoftComponent can be used by future client applications.

What are three possible ways to achieve your goal (Each correct answer presents a complete solution.) (Choose three)   Deploy GsoftClient and GsoftComponent to separate folders on each client computer. Add GsoftComponent to the global assembly cache.

You use Visual Studio .NET to create an application named MyClient. Another developer in your company creates a component named MyComponent. Your application uses namespaces exposed by MyComponent. You must deploy both MyClient and MyComponent to several computers in your company’s accounting department. You must also ensure that MyComponent can be used by future client applications. What are three possible ways to achieve your goal? (Each correct answer presents a complete solution.)(Choose three)   Deploy MyClient and MyComponent to a single folder on each client computer. Each time a new client application is developed, place the new application in its own folder and copy MyComponent to the new folder.
You use Visual Studio .NET to create an application named MyClient. Another developer in your company creates a component named MyComponent. Your application uses namespaces exposed by MyComponent. You must deploy both MyClient and MyComponent to several computers in your company’s accounting department. You must also ensure that MyComponent can be used by future client applications. What are three possible ways to achieve your goal? (Each correct answer presents a complete solution.)(Choose three)   Deploy MyClient and MyComponent to a single folder on each client computer. Each time a new client application is developed, place the new application in its own folder. Edit MyClient.exe.config and add a privatePath tag that points to the folder where MyComponent is located.
You use Visual Studio .NET to create an application named MyClient. Another developer in your company creates a component named MyComponent. Your application uses namespaces exposed by MyComponent. You must deploy both MyClient and MyComponent to several computers in your company’s accounting department. You must also ensure that MyComponent can be used by future client applications. What are three possible ways to achieve your goal? (Each correct answer presents a complete solution.)(Choose three)   Deploy MyClient and MyComponent to separate folders on each client computer. Each time a new client application is developed, select Add Reference from the Tools menu and add a reference to MyComponent.
You use Visual Studio .NET to create an application named MyClient. Another developer in your company creates a component named MyComponent. Your application uses namespaces exposed by MyComponent. You must deploy both MyClient and MyComponent to several computers in your company’s accounting department. You must also ensure that MyComponent can be used by future client applications. What are three possible ways to achieve your goal? (Each correct answer presents a complete solution.)(Choose three)   Deploy MyClient and MyComponent to separate folders on each client computer. Add MyComponent to the global assembly cache.
You use Visual Studio .NET to create an application that interact 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?   Step into CustOrderDetails by using the Visual Studio .NET Server Explorer.
You use Visual Studio .NET to create an application that tracks support incidents for your technical support department. You implement the Trace class to write information about run-time errors in a local log file. You also implement a TraceSwitch object named MySwitch, which can turn Trace lagging on and off as needed. To maximize application performance, you ensure that MySwitch is disabled by default. You set your Configuration Manager to Release. You compile the application and deploy it to a shared folder on your company intranet. Fifty users access the application from a shortcut on their desktops. One user receives error messages while running the application. You decide to enable verbose trace logging within the application for that user. You must ensure that you do not affect application performance for the other users. Which action or actions should you take? (Choose all that apply)   Copy the deployed version of the application from the shared folder. Deploy it locally on the user’s computer. Create a new desktop shortcut on the user’s desktop to access the local copy of the application.
You use Visual Studio .NET to create an application that tracks support incidents for your technical support department. You implement the Trace class to write information about run-time errors in a local log file. You also implement a TraceSwitch object named MySwitch, which can turn Trace lagging on and off as needed. To maximize application performance, you ensure that MySwitch is disabled by default. You set your Configuration Manager to Release. You compile the application and deploy it to a shared folder on your company intranet. Fifty users access the application from a shortcut on their desktops. One user receives error messages while running the application. You decide to enable verbose trace logging within the application for that user. You must ensure that you do not affect application performance for the other users. Which action or actions should you take? (Choose all that apply)   Edit the .config file for the application on the user’s computer to enable MySwitch with a value of 4.
You use Visual Studio .NET to create an application that tracks support incidents for your technical support department. You implement the Trace class to write information about run-time errors in a local log file. You also implement a TraceSwitch object named MySwitch, which can turn Trace lagging on and off as needed. To maximize application performance, you ensure that MySwitch is disabled by default.

You set your Configuration Manager to Release. You compile the application and deploy it to a shared folder on your company intranet. Fifty users access the application from a shortcut on their desktops.

One user receives error messages while running the application. You decide to enable verbose trace logging within the application for that user. You must ensure that you do not affect application performance for the other users.

Which action or actions should you take? (Choose all that apply)   Copy the deployed version of the application from the shared folder. Deploy it locally on the user’s computer. Create a new desktop shortcut on the user’s desktop to access the local copy of the application.

You use Visual Studio .NET to create an application that tracks support incidents for your technical support department. You implement the Trace class to write information about run-time errors in a local log file. You also implement a TraceSwitch object named MySwitch, which can turn Trace lagging on and off as needed. To maximize application performance, you ensure that MySwitch is disabled by default.

You set your Configuration Manager to Release. You compile the application and deploy it to a shared folder on your company intranet. Fifty users access the application from a shortcut on their desktops.

One user receives error messages while running the application. You decide to enable verbose trace logging within the application for that user. You must ensure that you do not affect application performance for the other users.

Which action or actions should you take? (Choose all that apply)   Edit the .config file for the application on the user’s computer to enable MySwitch with a value of 4.

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 presents part of the solution.) (Choose two)   Create a strong name for the assembly.

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 presents part of the solution.) (Choose two)   Use a deployment project to install the assembly in the global assembly cache.

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 presents part of the solution.)(Choose two)   Create a string name for the assembly.
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 presents part of the solution.)(Choose two)   Use a deployment project to install the assembly in the global assembly cache.
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 the 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?   From the Launch Conditions window, add a search for the registry key. Add a launch condition to evaluate the search results.
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 your Help desk administrator.

Which property of the setup project should you change?   Author

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 virtual void CalculateTax() { 03 // Code to calculate tax goes here. 04 } 05 } 06 public class City:Region { 07 public override void CalculateTax() { 08 // Insert new code. 09 } 10 } 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 08?   base.CalculateTax();
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?   <Assembly: _ PermissionSet(SecurityAction.RequestOptional, _ Unrestricted := False)>

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?   Generate a registry file for the assembly by using the Assembly Registration tool (Regasm.exe). Register the file on the client computer.
You use Visual Studio .NET to create an employee database application for your company. Your application contains the following code segment. (Line numbers are included for reference only. 01 foreach(Employee oEmployee in oCompany.Employees) { 02 bSuccess = RecordsUpdate(oEmployee); 03 } When you debug your application, you discover that RecordsUpdate sometimes returns a value of False. As quickly as possible, you need to debug your application and find all instances where RecordsUpdate returns this value. What should you do?   Set a breakpoint on line 2. Set its Condition property to !bSuccess and select the is true option.
You use Visual Studio .NET to create several applications that will be deployed commercially over the Internet. You must ensure that customers can verify the authenticity of your software. Which action or actions should you take? (Choose all that apply)   Sign your portable executables by using Signcode.exe.
You use Visual Studio .NET to create several applications that will be deployed commercially over the Internet. You must ensure that customers can verify the authenticity of your software. Which action or actions should you take? (Choose all that apply)   Purchase a Software Publisher Certificate from a certificate authority.
You use Visual Studio .NET to create several Windows-based applications. All use a common class library assembly named Customers. You deploy the application to client computers on your company intranet. Later, you modify Customers.Any application that uses version 1.0.0.0 must now user version 2.0.0.0. What should you do?   Modify the Publisher Policy file containing a reference to Customers.
You use Visual Studio .NET to develop a component named CustComponent. You plan to develop several client applications that use CustComponent. You need to deploy CustComponent with each of these applications. You will create a distribution package to be included with each application. Which type of project should you create?   merge module project.
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?   Before calling the Update method, ensure that a row position change occurs in CustomerDataSet.
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 defines by the following code segment: namespace Fabrikam.Buslayer { public class Client { public string GetPhone(int ClientID) { // More code goes here. } // Other methods goes here. } } The client class is invoked from ARA by using the following code segment: Client client = new Client(); TxtPhone.Text = client.GetPhone(426089); 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? (Each correct answer presents a complete solution.)(Choose two)   Fully qualify the Client class with the Fabrikam.BusLayer namespace.
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 defines by the following code segment: namespace Fabrikam.Buslayer { public class Client { public string GetPhone(int ClientID) { // More code goes here. } // Other methods goes here. } } The client class is invoked from ARA by using the following code segment: Client client = new Client(); TxtPhone.Text = client.GetPhone(426089); 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? (Each correct answer presents a complete solution.)(Choose two)   Add a using statement for the Fabrikam.BusLayer namespace in the ClientForm class.
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 to the Hospital domain by suing a generic user accounts. What should you do?   Create a new instance of the WindowsImpersonationContext class by calling the Impersonate method of the WindowsIdentity object and passing the token of the user whom you want to impersonate.
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 presents part of the solution.)(Choose three)   Set labelValue.UseMnemonic to True.
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 presents part of the solution.)(Choose three)   Set labelValue.Text to “&Value”.
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 presents part of the solution.)(Choose three)   Set textValue.TabIndex to exactly one number more than labelValue.TabIndex.
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, which includes the following design-time components: • SqlConnection object named NorthwindConnection. • SqlDataAdapter object named NorthwindDataAdapter. • DataSet object named NorthwindDataSet, based on a database table named Customers. At run time you add a TextBox control named textCompanyName to CustomerForm. You execute the Fill method of NorthwindDataAdapter to populate Customers. Now you want to use data binding to display the CompanyName field exposed by NorthwindDataSet in textCompanyName. Which code segment should you use?   textCompanyName.DataBindings.Add(“Text”, NorthwindDataSet,“Customers.CompanyName”);
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 GsoftConnection. • SqlDataAdapter object named GsoftDataAdapter. • DataSet object named GsoftDataSet. • Five TextBox controls to hold the values exposed by GsoftDataSet.

At design time, you set the DataBindings properties of each TextBox control to the appropriate column in the DataTable object of GsoftDataSet. 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?   Execute the Fill method of GsoftDataAdapter and pass in GsoftDataSet.

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 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?   Execute the Fill method of NorthwindDataAdapter and pass in NorthwindDataSet.
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 than at run time. Which two actions should you take? (Each correct answer presents part of the solution.)(Choose two)   Create an XML schema for Employees.
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 than at run time. Which two actions should you take? (Each correct answer presents part of the solution.)(Choose two)   Create a typed DataSet object based on the XML schema.
You use Visual Studio .NET to develop a Windows-based application that will manager vendor contracts. You create a DataSet object, along with its associated DataTable object and DataView object. The DataSet object contains all data available for a single contract. This data is displayed in a DataGrid control. After all parties sign a contract, the value in a field named ContractApproved is set to True. Business rules prohibit changes to database information about a contract when the ContractApproved value associated with the contract is true. You must ensure that this business rule is enforces by your application code. What should you do?   Set the AllowEdit property of the DataView object to False.
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?   Name the configuration file RetailMgmt.exe.config and copy it to the application folder.
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 textHelp. 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: textHelp.Text = “This menu option calculates the result..”; In which event should you add this code segment?   calculateOption_Select
You use Visual Studio .NET to develop a Windows-based application. The application will implement a role-based authorization scheme that is based on a Microsoft SQL Server database of user names.

Users will enter their user names in a text box named userName and logon screen. You must ensure that all users are assigned the Supervisor rule and the SR role by default.

Which code segment should you use?   GenericIdentity identity = new GenericIdentity(userName.Text); string[] RoleArray = {“Supervisor”, “SR”}; GenericPrincipal principal = new GenericPrincipal(identity, RoleArray);

You use Visual Studio .NET to develop a Windows-based application. The application will implement a role-based authorization scheme that is based on a Microsoft SQL Server database of user names. Users will enter their user names in a text box named userName and logon screen. You must ensure that all users are assigned the Supervisor rule and the Volunteer role by default. Which code segment should you use?   GenericIdentity identity = new GenericIdentity(userName.Text); string[] RoleArray = {“Supervisor”, “Volunteer”}; GenericPrincipal principal = new GenericPrincipal(identity, RoleArray);
You use Visual Studio .NET to develop a Windows-based application. You implement security by using the security classes of the .NET Framework. Your application includes the following procedure. (Line numbers are included for reference only.) 01 public void ApproveVacation 02 string User1, string Role1, 03 string User2, string Role2) 04 { 05 PrincipalPermission principalPerm1 = 06 new PrincipalPermission(User1, Role1); 07 PrincipalPermission principalPerm2 = 08 new PrincipalPermission(User2, Role2); 09 // Insert new code. 10 // Additional procedure code goes here. 11 } You must ensure that both User1 and User2 are members of the same security roles. Which code segment should you insert on line 9?   principalPerm1.IsSubSetOf(principalPerm2);
You use Visual Studio .NET to develop a Windows-based application. You implement security by using the security classes of the .NET Framework. Your application includes the following procedure. (Line numbers are included for reference only.) 01 public void ApproveVacation 02 string User1, string Role1, 03 string User2, string Role2) 04 { 05 PrincipalPermission principalPerm1 = 06 new PrincipalPermission(User1, Role1); 07 PrincipalPermission principalPerm2 = 08 new PrincipalPermission(User2, Role2); 09 // Insert new code. 10 // Additional procedure code goes here. 11 } You must ensure that both User1 and User2 are members of the same security roles. Which code segment should you insert on line 9?   principalPerm1.Intersect(principalPerm2).Demand();
You use Visual Studio .NET to develop a Windows-based application. You implement security classes of the .NET Framework. As users interact with your application, role-based validation will frequently be performed. You must ensure that only validated Windows NT or Windows 2000 domain users are permitted to access your application. You add the appropriate using statements for the System.Security.Principal namespace and the System.Threading namespace. Which additional code segment should you use?   AppDomain.CurrentDomain. SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal); WindowsPrincipal principal =(WindowsPrincipal) Thread.CurrentPrincipal;
You use Visual Studio .NET to develop a Windows-based application. Your application includes a form named InfoForm, 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 InfoForm from closing if any database changes are left unsaved. What should you do?   Change a property of the System.ComponentModel.CancelEventArgs parameter in the Closing event handler of InfoForm.
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 us set to True. How should you implement this functionality?   Set the RowFilter property of the DataView object to “BackOrder=True”.
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 Grid1. Grid1 is bound to a DataView object. Users will be able to edit order information directly in Grid1. You must give users the option of displaying only edited customer orders and updated values in Grid1. What should you do?   Set the RowStateFilter property of the DataView object to DataViewRowState.ModifiedCurrent.
You use Visual Studio .NET to develop a Windows-Bases 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 Gsoft will occur during the execution of PatTrac.

You want PatTrac to log on to the Gsoft domain by using a generic user account.

What should you do?   Create a new instance of the WindowsImpersonationContext class by calling the Impersonate method of the WindowsIdentity object and passing the token of the user whom you want to impersonate.

You use Visual Studio .NET to develop an application that contains 50 forms. You create a procedure named PerformCalculations, which writes the results of several internal calculations to the Debug window. These calculations take more than one minute to execute.

You want to be able to compile two versions of the application, one for debugging and the other for release. The debugging version should execute the calculations. The release version should not include or compile the calculations. You want to accomplish this goal by using the minimum amount of code.

Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two)   Use the following code segment: #if DEBUG // Insert code to perform calculations. #endif

You use Visual Studio .NET to develop an application that contains 50 forms. You create a procedure named PerformCalculations, which writes the results of several internal calculations to the Debug window. These calculations take more than one minute to execute.

You want to be able to compile two versions of the application, one for debugging and the other for release. The debugging version should execute the calculations. The release version should not include or compile the calculations. You want to accomplish this goal by using the minimum amount of code.

Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two)   Ensure that the Conditional Compilation Constants option in the Build pane of the Project Properties dialog box contains the value DEBUG.

You use Visual Studio .NET to develop an application that contains 50 forms. You create a procedure named PerformCalculations, which writes the results of several internal calculations to the Debug window. These calculations take more than one minute to execute. You want to be able to compile two versions of the application, one for debugging and the other for release. The debugging version should execute the calculations. The release version should not include or compile the calculations. You want to accomplish this goal by using the minimum amount of code. Which two actions should you take? (Each correct answer presents part of the solution.)(Choose two)   Use the following code segment: #if DEBUG // Insert code to perform calculations. #endif
You use Visual Studio .NET to develop an application that contains 50 forms. You create a procedure named PerformCalculations, which writes the results of several internal calculations to the Debug window. These calculations take more than one minute to execute. You want to be able to compile two versions of the application, one for debugging and the other for release. The debugging version should execute the calculations. The release version should not include or compile the calculations. You want to accomplish this goal by using the minimum amount of code. Which two actions should you take? (Each correct answer presents part of the solution.)(Choose two)   Ensure that the Conditional Compilation Constants option in the Build pane of the Project Properties dialog box contains the value DEBUG.
You use Visual Studio .NET to develop applications for your human resources department. You create the following interfaces: public interface IEmployee { double Salary(); } public interface IExecutive: IEmployee { double AnnualBonus(); } 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 Manager to represent executives in your company. You want to create this class by using the minimum amount of code. Which code segment or segments should you include in Manager? (Choose all that apply)   public class Manager:IExecutive
You use Visual Studio .NET to develop applications for your human resources department. You create the following interfaces: public interface IEmployee { double Salary(); } public interface IExecutive: IEmployee { double AnnualBonus(); } 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 Manager to represent executives in your company. You want to create this class by using the minimum amount of code. Which code segment or segments should you include in Manager? (Choose all that apply)   public double Salary()
You use Visual Studio .NET to develop applications for your human resources department. You create the following interfaces: public interface IEmployee { double Salary(); } public interface IExecutive: IEmployee { double AnnualBonus(); } 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 Manager to represent executives in your company. You want to create this class by using the minimum amount of code. Which code segment or segments should you include in Manager? (Choose all that apply)   public double AnnualBonus()
You want to display a help button on the title bar of your Windows form. Which property settings should you make?   HelpButton = true, MinButton = false, MaxButton = false
You want to use a Web service that supplies travel weather information in your application. You know the URL of the .asmx file published by the Web service, but you do not know any details of the Web service's interface. What action should you take first?   Run the Web Service Discovery tool.
You want your application to monitor for changes to the HighContrast setting at runtime, so that it can remove a background image from a form if necessary. Which event must you trap?   SystemEvents.UserPreferenceChanged
You work as software developer at Gsoft inc. You need to 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.

What should you do?   SetHelpString

You would like to give the user the ability to customize your application so that it fits in better with his or her company's corporate look and feel. In particular, you want to let the user specify text to appear in the title bar of the main menu form. How should you add this ability to your application?   Make the Text property of the form a dynamic property and provide an XML file that the user can edit to set the value of the property.
You wrote a COM component to accept data from an analog-to-digital converter card and made it available to your analysis program. Now you're moving that analysis program to .NET. The COM component is used nowhere else, and you have not shipped copies of it to anyone else. You want to call the objects in the COM server from your new .NET client. How should you proceed?   Set a direct reference from your .NET client to the COM server.
Your application allows the user to choose between two different sizes of text when printing reports. Users complain that when they choose the small font, there is excessive space between the lines of the report. What should you do to fix this problem?   Call the Font.GetHeight() method to determine the vertical size of the font.
Your application allows you to select any event log on the local computer and monitor that event log for new entries. When a new entry is made to the event log, the application displays the text of the entry. You can then enter an explanatory note, if you like, which is posted back to the event log as another entry.

Now you are adding the capability to work with remote computers as well as the local computer. Which functionality must you disable for remote computers?   Post notes back to the event log.

Your application calls a Web service that retrieves and compares traceroute timing information from multiple servers around the world. Users complain that the user interface of the application is unresponsive while this information is being retrieved. What can you do to fix this problem?   Use asynchronous calls to invoke the Web service.
Your application connects to a SQL Server database by using the System.Data.SqlClient.SqlConnection object. It then runs a stored procedure by using a System.Data.SqlClient.SqlCommand object and retrieves the results into a System.Data.SqlClient.SqlDataReader object. The application reads two fields from each row of data and concatenates their values into a string variable. What can you do to optimize this application?   Replace the string variable with a StringBuilder object.
Your application contains a form, Form1, with its BackColor property set to Red. You add a new form, Form2, to the application by using visual inheritance to derive the new form from Form1. You set Form2 to be the startup object for the application, and you set its BackColor property to Blue. Next, you change the BackColor property of Form1 to Yellow. When you run the application, what is the BackColor of Form2 set to?   Blue
Your application contains the following code:

private void Form1_Load(
System.Object sender, System.EventArgs e)
{
EventLog eventLog = new EventLog(
"Application", ".");
// Add an event handler for
// the EntryWritten event
eventLog.EntryWritten += new
EntryWrittenEventHandler(
eventLog_EntryWritten);
}
private void eventLog_EntryWritten( _
Object source , EntryWrittenEventArgs e)
{
Debug.WriteLine(e.Entry.Message.Trim());
}

After you run this code, no event messages are written to the output window. You have verified that events are being posted to the Application event log. What could be the problem?   Event logs do not raise events.

Your application contains the following resource files that contain string resources:

AppStrings.resx
AppStrings.fr.resx
AppStrings.fr-FR.resx
AppStrings.en.resx
AppStrings.en-US.resx

The user executes the application on a computer that is running French (Canadian) software, so the CurrentUICulture property is set to fr-CA. What is the result?   The resources from AppStrings.fr.resx are used.

Your application contains Unicode strings encoded in the UTF-16 format. You'd like to save a copy of those strings to disk in UTF-7 format. What should you do?   Use the UTF7Encoding.GetBytes() method to perform the conversion.
Your application depends on an assembly from another developer. This assembly isn't signed with an Authenticode key or a strong name, but you have determined that it can be trusted. You want to grant this code permissions by using the .NET Framework Configuration tool. Which type of membership condition should you use to create a code group that contains only this assembly?   Cryptographic hash
Your application displays the distance to various planets in a variety of units. You are beginning to sell this application in multiple countries. How should you ensure that the correct numeric formatting is used in all cases?   Allow the user to select a culture from a list. Create a CultureInfo object based on the user's selection and assign it to the Thread.CurrentThread.CurrentCulture property. Use the ToString() method to format numeric amounts.
Your application executes the following code:

Trace.Listeners.Add(new 
TextWriterTraceListener("TraceLog.txt"));

When your application is running in the default Release configuration, where will messages from the Trace class appear?   They will appear in the output window and in the TraceLog.txt file.

Your application includes a CheckBox control with its ThreeState property set to true. Your form displays this control in the indeterminate state. You want to take an action only if the user checks the CheckBox control. Which code snippet should you use?   
if (chkTriState.CheckState == 
CheckState.Checked)
{
// Take action
}
Your application includes a ListBox control named lbCourses that displays a list of college courses. The DisplayMember property of the ListBox control is bound to the CourseName column of the Courses database table. The ValueMember property of the ListBox control is bound to the CourseNumber column of the Courses database table.

Your form also contains a TextBox control named txtCourseNumber. This control uses simple data binding to display the CourseNumber column from the StudentSchedules table in your database.

When the user selects a course name in the ListBox control, you want to display the corresponding CourseNumber value in the txtCourseNumber control. What should you do?   Use simple data binding to bind the SelectedValue property of the ListBox control to the CourseNumber column of the StudentSchedules table.

Your application includes a SqlDataAdapter object named sqlDataAdapter1 that was created by dragging and dropping the Customers table from a database to your form. Your application also includes a DataSet object named dsCustomers1, that is based on this SqlDataAdapter object. What line of code should you use to load the data from the database into the DataSet object?   
sqlDataAdapter1.Fill(
dsCustomers1, "Customers");
Your application includes a procedure that deletes many records from a database. When this procedure is invoked, you want the user to explicitly confirm his or her intention to delete the records. You have developed a form named frmConfirm to perform the confirmation. This form includes two Button controls, btnOK and btnCancel. The DialogResult property of btnOK is set to OK, and the DialogResult property of btnCancel is set to Cancel.

Which code snippet should you use to display frmConfirm and process the user's choice?   

frmConfirm frm = new frmConfirm();
frm.ShowDialog();
if(frm.DialogResult == DialogResult.OK)
{
// Delete the records
}
Your application is failing when a particular variable equals 17. Unfortunately, you cannot predict when this will happen. Which debugging tool should you use to investigate the problem?   Conditional Breakpoint
Your application is split into two parts: The server is implemented as a Web service, and the client is implemented as a Windows forms application. The server is still under active development, even though you are already shipping the client application. You anticipate that the data returned by the server will continue to change in the near future and that clients will need to adjust their means of working with the Web service to account for these changes. How should you provide user assistance for the client application?   Place the help file on an Internet server that is under your direct control and use a HelpProvider component to display the information.
Your application needs to store a large amount of data in a disk file between program runs. You'd like to store this information without wasting space. The disk file does not need to be easily readable by human beings. Which class should you use to accomplish this task?   BinaryWriter
Your application requires the ability to access OLE DB data sources in order to function properly. Which .NET security feature should you use to ensure that your code has this ability?   Code access security
Your application retrieves data from the Customers and Orders tables in a database by using a view named vwCustOrders. This view is used to set the CommandText property for the SelectCommand property of a DataAdapter object. The application uses the Fill() method of this DataAdapter object to fill a DataSet object that is bound to a DataGrid control.

Users report that changes they make to data displayed on the DataGrid control are not saved to the database. What could be the problem?   Your application does not call the Update() method of the DataAdapter object.

Your application uses a SqlDataReader object to retrieve patient information from a medical records database. When you find a patient who is currently hospitalized, you want to read the names of the patient's caregivers from the same database. You have created a second SqlDataReader object, based on a second SqlCommand object, to retrieve the caregiver information. Calling the ExecuteReader() method of the SqlCommand object is causing an error. What is the most likely cause of this error?   You are using the same SqlConnection object for both of the SqlDataReader objects, and the first SqlDataReader object is still open when you try to execute the SqlCommand object.
Your application uses a graphics library from a third-party developer. This library is implemented as a COM component. You are migrating your application to .NET. What should you do to continue to use the classes and methods within the graphics library?   Obtain a primary interop assembly (PIA) from the developer of the library. Install the PIA in the GAC.
Your application will be used by people who depend on accessibility aids such as screen readers. Which properties should you explicitly set for every control? (Select the two best answers.)   AccessibleName
Your application will be used by people who depend on accessibility aids such as screen readers. Which properties should you explicitly set for every control? (Select the two best answers.)   AccessibleDescription
Your application will use SqlCommand objects to directly manipulate the data in a SQL Server database. One of the tasks that you need to perform is to add a new row to a table in the database. Which SQL keyword should you use for this task?   INSERT
Your application's main form contains two Button controls, named btnA and btnB. When the user clicks either of these controls, or when the user moves the mouse over either of these controls, you want to run code to display a message on the form. The message is identical in all cases. How should you structure your code to fulfill this requirement?   Write two event handlers, the first to handle both Click events and the second to handle both MouseMove events.
Your code uses the Trace class to produce debugging output. In which configuration(s) will this output be enabled?   In both the default Release configuration and the default Debug configuration.
Your code would like file I/O permission, but it can run without this permission. You plan to request the permission and trap the error that occurs if the permission is not granted. Which SecurityAction flag should you use with the FileIoPermission object?   SecurityAction.Optional
Your company assigns you to modify a Visual Studio .NET application that was created by a former colleague. However, when you 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?   Select each error listed in the Task List window.
Your company uses Visual Studio .NET to create a Windows-based application for your company. The application is named CustomerTracker, 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 EmployeeTracker, and it will also call Schedule. Because you anticipate future revisions to this assembly, you want only one copy of Schedule to serve both applications. Before you can use Schedule in EmployeeTracker, you need to complete some preliminary tasks. Which three actions should you take? (Each correct answer presents part of the solution.)(Choose three)   Create a strong name for Schedule.
Your company uses Visual Studio .NET to create a Windows-based application for your company. The application is named CustomerTracker, 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 EmployeeTracker, and it will also call Schedule. Because you anticipate future revisions to this assembly, you want only one copy of Schedule to serve both applications. Before you can use Schedule in EmployeeTracker, you need to complete some preliminary tasks. Which three actions should you take? (Each correct answer presents part of the solution.)(Choose three)   Install Schedule in the global assembly cache.
Your company uses Visual Studio .NET to create a Windows-based application for your company. The application is named CustomerTracker, 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 EmployeeTracker, and it will also call Schedule. Because you anticipate future revisions to this assembly, you want only one copy of Schedule to serve both applications. Before you can use Schedule in EmployeeTracker, you need to complete some preliminary tasks. Which three actions should you take? (Each correct answer presents part of the solution.)(Choose three)   Create a reference in EmployeeTracker to Schedule.
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 at 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?   Place the following code segment in the UserControl_Load event: this.Dock = DockStyle.Bottom
Your corporate counsel insists that the documents generated by your program be printed on legal-sized paper. Unfortunately, users sometimes use the Printer Setup dialog box to switch to letter-sized paper for their own convenience. Which event of the PrintDocument class can you use to check and (if necessary) change the paper tray?   QueryPageSettings
Your department is responsible for maintaining a variety of accounting applications. You've been assigned the task of creating a standard control to represent credit and debit accounts. The control will be made up of a collection of TextBox and ComboBox controls. On which class should you base this control?   UserControl
Your development team is creating a new Windows-based application for your 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?   Generate the proxy class for XML Web service by using Wsdl.exe.
Your development team is creating a Windows-based application for your 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?   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.
Your form allows the user to enter a telephone number into a TextBox control named txtPhone. You use the Validating event of this control to check whether the phone number is in the correct format. If the phone number is in an incorrect format, you do not allow the focus to leave the txtPhone control.

The form also includes a Button control, btnCancel, to cancel the data entry action. The user should be able to click this button any time, even when there is invalid data in the text box. What should you do to ensure that this is the case?   Set the CausesValidation property of the Button control to false.

Your form requires a control that behaves exactly like a TextBox control, except that for certain values you want to display the text in red. From which class should you derive this control?   TextBox
Your form uses Label controls to convey information. When the text in a Label control represents a higher-than-average value, you want to display it in bold type; when the text in the Label control represents a value that requires the user's attention, you want to display it in italic type. If both conditions are true, you want to display the text in bold italic type. How should you set the Italic FontStyle property for the control when the value requires attention so that it adds italic, whether the font is already bold or not?   lblSampleText.Font.Style | FontStyle.Italic
Your graphics application creates and displays a PrintPreviewControl control at runtime. Users complain that the preview image is not sufficiently detailed for them to tell whether the job should be printed. What should you do?   Set the UseAntiAlias property to true.
Your Gsoft 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)   EventLogTraceListener myTraceListener = new EventLogTraceListener(“myEventLogSource”);

Your Gsoft 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)   EventLogTraceListener myDebugListener = new EventLogTraceListener(“myEventLogSource”); Debug.Listeners.Add(myDebugListener);

Your Gsoft 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)   EventLogTraceListener myTraceListener = new EventLogTraceListener(“myEventLogSource”); Debug.Listeners.Add(myTraceListener); Trace.Listeners.Add(myTraceListener);

Your project contains the following API declaration:
[DllImport("kernel32.dll")]
public static extern int GetComputerName(
String buffer, ref uint size);

The project also contains the following code that uses the API to display the computer name:

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

// Call the Win API method
intRet = GetComputerName(
buf, ref intLen);

Console.WriteLine(
"This computer is named " +
buf.ToString());
}

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

Your 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)   EventLogTraceListener myTraceListener = new EventLogTraceListener(“myEventLogSource”);
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)   EventLogTraceListener myDebugListener = new EventLogTraceListener(“myEventLogSource”); Debug.Listeners.Add(myDebugListener);