70-529 - TS: Microsoft .NET Framework 2.0 - Distributed Application Development

Go back to Microsoft

Example Questions

You are creating a Windows Forms application by using the .NET Framework 3.5. You plan to develop a new control for the application. You need to ensure that the control extends the TreeView control by adding a custom node tag and a highlight color. What should you do You are creating a Windows Forms application for inventory management by using the .NET Framework 3.5. The application provides a form that allows users to maintain stock balances. The form has the following features: A dataset named dsStockBalance to store the stock information A business component named scInventory The scInventory component provides a method named Save. You need to ensure that only the modified stock balances of dsStockBalance are passed to the scInventory.Save method. Which code segment should you use You create Windows Forms applications by using the .NET Framework 3.5. You create a new application for Windows Vista client computers. The application requires elevated access to read files from the local file system. You need to ensure that the application requires elevated permissions on execution. What should you do You are creating a multiple-document interface (MDI) application by using the .NET Framework 3.5. You configure the frmParent form to be an MDI parent. You write the following code segment. (Line numbers are included for reference only.) 01 Form frmChild = new Form(); 02 Form frmParent = this; 03 You need to associate and display the frmChild form and the frmParent form. Which code segment should you add at line 03 You are creating a Windows Forms application by using the .NET Framework 3.5. You plan to develop a custom control for the application. The control will be a composite control. Your need to derive from the class that will create the control by using the minimum amount of development effort. What should you do You are creating a Windows Forms application by using the .NET Framework 3.5. You need to populate a list box control along with category names by using a DataReader control. Which code segment should you use You are creating a Windows Forms application for the design of circuit boards and electronic equipment. You use the .NET Framework 3.5 to create the application. You are creating a custom dialog box that allows designers to preview designs before printing them. The previewed documents must meet the following requirements: The graphics and text are displayed clearly. The full-scale preview is set as default for the documents. The zoom setting of the preview control is adjusted automatically when the form is resized. You need to ensure that the requirements are met when the form that contains the custom print preview control is displayed. Which code segment should you use You are creating a Windows Forms application by using the .NET Framework 3.5. The application requires a thread that accepts a single integer parameter. You write the following code segment. (Line numbers are included for reference only.) 01 Thread myThread = new Thread(new ParameterizedThreadStart(DoWork)); 02 myThread.Start(100); 03 ... You need to declare the method signature of the DoWork method. Which method signature should you use You create Windows Forms applications by using the .NET Framework 3.5. You plan to use the Windows Installer to deploy a new application. The application must meet the following requirements: Support deployment to 32-bit and 64-bit operating systems. Use the 64-bit Program Files folder when deployed to 64-bit platforms. You need to ensure that the application is deployed appropriately. What should you do You are creating a Windows Forms application by using the .NET Framework 3.5. You plan to deploy the application in multiple countries and languages. You need to ensure that the application meets the globalization requirements. Which two actions should you perform (Each correct answer presents part of the solution. Choose two.) You are creating a Windows application by using the .NET Framework 3.5. You create an instance of the BackgroundWorker component named backgroundWorker1 to asynchronously process time-consuming reports in the application. You write the following code segment in the application. (Line numbers are included for reference only.) 01 private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) 02 { 03 04 } You need to write a code segment that reports to the application when the background process detects any of the following actions: An exception is thrown. The process is cancelled. The process is successfully completed. Which code segment should you insert at line 03 You are creating a Windows Forms application by using the .NET Framework 3.5. The application displays employee names by using the TreeView control. You need to implement the drag-and-drop functionality in the TreeView control. Which two actions should you perform (Each correct answer presents part of the solution. Choose two.) You are creating a Windows Forms application that has the print functionality by using the .NET Framework 3.5. You implement the PrintPage page event for the form. You associate an instance of the PrintDocument control along with an instance of the PrintPreviewDialog control named prevDialog1. You want to set the default size of the PrintPreviewDialog class to full screen. You need to provide a print preview for the user by adding a code segment to the Click event of the button on the form. Which code segment should you use You are creating a Windows Forms application by using the .NET Framework 3.5. The application requires a form to display a clock. You need to create a circular form to display the clock. Which code segment should you use: You are creating a Windows Forms application by using the .NET Framework 3.5. You create a new form in your application. You add a SplitContainer control named spcFrame to the form. The SplitContainer control has two SplitterPanel controls named Panel1 and Panel2. You are configuring the SplitContainer control to define the layout of the form. You need to ensure that the following requirements are met: The initial distance from the left edge of the spcFrame splitter is set to 200 pixels. The size of the Panel2 SplitterPanel remains unchanged when the form is resized. Which code segment should you use You are creating a Windows application by using the .NET Framework 3.5. You plan to create a form that might result in a time-consuming operation. You use the QueueUserWorkItem method and a Label control named lblResult. You need to update the users by using the lblResult control when the process has completed the operation. Which code segment should you use You create Windows Forms applications by using the .NET Framework 3.5. You plan to use a setup project to deploy a new Windows Forms application. The application uses a component that requires the Microsoft .NET Framework 1.1. You need to create a launch condition so that the application can be deployed on client computers. What should you do You are creating a Windows Forms application by using the .NET Framework 3.5. You create a new form in your application. You add a PrintDocument control named pntDoc to the form. To support the print functionality, you write the following code segment in the application. (Line numbers are included for reference only.) 01 pntDoc.BeginPrint += new PrintEventHandler(PrintDoc_BeginPrint); 02 ... 03 bool canPrint = CheckPrintAccessControl(); 04 if (!canPrint) { 05 06 } You need to ensure that the following requirements are met: When the user has no print access, font and file stream initializations are not executed and the print operation is cancelled. Print operations are logged whether or not the user has print access. What should you do You are creating a Windows Forms application by using the .NET Framework 3.5. You plan to develop a new control for the application. You need to ensure that the control extends the DataGridView control by allowing the cells to contain multicolored text. What should you do You are creating a Windows Forms application by using the .NET Framework 3.5. You write a code segment to connect to a Microsoft Access database and populate a DataSet. You need to ensure that the application meets the following requirements: It displays all database exceptions. It logs all other exceptions by using the LogExceptionToFile. Which code segment should you use You are creating a Windows Forms application by using the .NET Framework 3.5. You plan to develop a new control for the application. The control will have the same properties as a TextBox control. You need to ensure that the control has a transparent background when it is painted on a form. You want to achieve this goal by using the minimum amount of development effort. What should you do You create Windows Forms applications by using the .NET Framework 3.5. You plan to deploy a new application. You need to ensure that on deployment, the application meets the following requirements: It is executed on the client computer. It is removed from the client computer after the application is closed. It is not displayed in the Add/Remove programs panel on the client computer. What should you do You are creating a Windows Forms application by using the .NET Framework 3.5. You use LINQ expressions to read a list of customers from the following XML file. <customers> <customer id="135" birthDate="4/1/1968"> Paul Koch </customer> <customer id="122" birthDate="7/5/1988"> Bob Kelly </customer> <customer id="044" birthDate="3/24/1990"> Joe Healy </customer> <customer id="982" birthDate="9/15/1974"> Matt Hink </customer> <customer id="325" birthDate="1/7/2004"> Tom Perham </customer> <customer id="134" birthDate="9/23/1946"> Jeff Hay </customer> <customer id="653" birthDate="5/15/1947"> Kim Shane </customer> <customer id="235" birthDate="4/24/1979"> Mike Ray </customer> </customers> You need to obtain a list of names of customers who are 21 years of age or older. Which code segment should you use You create an image processing function and a delegate. You plan to invoke the image processing function by using the delegate. You need to ensure that the calling thread meets the following requirements: It is not blocked when the delegate is running. It is notified when the delegate is complete. What should you do You are creating a Windows application by using the .NET Framework 3.5. You add a BackgroundWorker component to a Windows form to handle a time-consuming operation. You add a Cancel button to the form. You need to ensure that when the Cancel button is pressed, the background task is cancelled. What should you do You are creating a Windows Forms application by using the .NET Framework 3.5. You write the following code segment to bind a list of categories to a drop-down list. (Line numbers are included for reference only.) 01 OleDbConnection cnnNorthwind = new OleDbConnection(connectionString); 02 OleDbCommand cmdCategory = new OleDbCommand("SELECT CategoryID, CategoryName FROM Categories ORDER BY CategoryName", cnnNorthwind); 03 OleDbDataAdapter daCategory = new OleDbDataAdapter(cmdCategory); 04 DataSet dsCategory = new DataSet(); 05 daCategory.Fill(dsCategory); 06 You need to ensure that the drop-down list meets the following requirements: Displays all category names. Uses the category ID as the selected item value. Which code segment should you add at line 06 You are creating a Windows Forms application for a financial service provider by using the .NET Framework 3.5. You have to implement a multiple-document interface (MDI) in the application to allow users to open multiple financial documents simultaneously. You need to ensure that whenever the child MDI form is created, the application displays a message in the title bar of the parent MDI that a child form has received focus. What should you do You are creating a Windows Forms application by using the .NET Framework 3.5. You have resource files in five different languages. You need to test the application in each language. What should you do You are creating a Windows Forms application by using the .NET Framework 3.5. You create a new form in the application. You add a ContextMenuStrip control named ctxMenu to the form. You have a user-defined class named CustomControl. You write the following code segment in the application. (Line numbers are included for reference only.) 01 CustomControl myControl = new CustomControl(); 02 You need to ensure that an instance of CustomControl is displayed on the form as a top-level item of the ctxMenu control. Which code segment should you add at line 02 You create Windows Forms applications by using the .NET Framework 3.5. You plan to deploy a new application by using the ClickOnce technology. During deployment, the application performs the following tasks: Modifies registry keys Modifies the files located in the %PROGRAM FILES% folder Administrative permissions are not granted to users who install the application. You need to ensure that the following requirements are met: The application can be deployed to Windows Vista client computers that are not part of an Active Directory domain. When the application is deployed, users are not prompted to elevate their permissions. What should you do You create Windows Forms applications by using the .NET Framework 3.5. You plan to deploy a new application by using the ClickOnce deployment technology. The application is signed by using a certificate obtained from a trustworthy authority. You need to ensure that the application can be deployed as a trusted application to Windows Vista client computers on a corporate network. What should you do You are creating a Windows Forms application by using the .NET Framework 3.5. You plan to modify a list of orders within a DataGridView control in the application. You need to ensure that a value is required in the first column of the grid control. Which code segment should you use You are creating a Windows Forms application by using the .NET Framework 3.5. The application stores a list of part numbers in an integer-based array as shown in the following code segment. (Line numbers are included for reference only.) 01 var parts = new int[] 02 { 105, 110, 110, 235, 105, 03 135, 137, 205, 105, 100, 100 }; 04 05 foreach (var item in results) { 06 tbResults.Text += item + "\r\n"; 07 } You need to use a LINQ to Objects query to perform the following tasks: Obtain a list of duplicate part numbers. Order the list by part numbers. Provide the part numbers and the total count of part numbers in the results. Which code segment should you insert at line 04 You are creating a Windows Forms application by using the .NET Framework 3.5. The application is used by a financial service provider. You discover that the service provider transfers large amounts of data by using XML. You need to read and validate the XML documents in the most time-efficient manner. Which technology should you use You are creating a Windows Forms application by using the .NET Framework 3.5. You create a new form in your application. You add 100 controls at run time in the Load event handler of the form. Users report that the form takes a long time to get displayed. You need to improve the performance of the form. What should you do You are creating a Windows Forms application by using the .NET Framework 3.5. You have implemented the PrintPage event to send the page output to the printer. The users must select the printer and the page range before printing. You need to ensure that users can print the content of the form by clicking the button control. Which code segment should you use You are creating a Windows Forms application by using the .NET Framework 3.5. The application is configured to use role-based security. You need to ensure that users can print reports only by selecting a printer from the printer dialog box. You want to achieve this goal by using the minimum level of permission. Which code segment should you use You create Windows Forms applications by using the .NET Framework 3.5. You plan to deploy a new Windows Presentation Foundation (WPF) XAML browser application (XBAP). The deployment must meet the following requirements: A shortcut is added to the Start menu. The most recent version of the application is installed and executed on client computers. Users can uninstall the application from the control panel. You need to identify a deployment technology that meets the specified requirements. You want to achieve this goal by using the minimum amount of development effort. Which deployment technology should you use You are creating a Windows Forms application for a courier company by using the .NET Framework 3.5. You create a form that allows customers to track the progress of their shipments. The form contains the following elements: A text box named txtTN that allows users to enter a tracking number An ErrorProvider control named ErrorProvider1 that informs users of an invalid tracking number A function named ValidTrackingNumber that validates tracking numbers You need to ensure that the txtTN text box is validated. Which code segment should you use You write the following code segment in the form. (Line numbers are included for reference only.) 01 string queryString = "SELECT CategoryID, CategoryName FROM Categories"; 02 03 The connection string for the financial services database is stored in the variable named connString. You need to ensure that the form populates a DataGridView control named gridCAT. Which code segment should you add at line 03

Study Guides