42
70-482 Number : 000-000 Passing Score : 800 Time Limit : 120 min File Version : 1.0 http://www.gratisexam.com/

Microsoft.PracticeTest.70-482.v2013-04-07.by.Anonymous · 7/4/2013 · The presentation layer utility class provides functions for the controls on the forms. You need to ensure that

Embed Size (px)

Citation preview

70-482

Number: 000-000Passing Score: 800Time Limit: 120 minFile Version: 1.0

http://www.gratisexam.com/

Exam A

QUESTION 1You are creating a Windows application by using the .NET Framework 3.5. You plan to develop utility classesfor the application. The classes will provide a data access layer, a business logic layer, and a presentationlayer. The presentation layer utility class provides functions for the controls on the forms. You need to ensurethat the utility classes can be reused in other applications. You want to achieve this goal by using minimumpossible development effort. What should you do?

A. Create a Web service that references the utility classes.B. Create a utility class for the data access layer, business logic layer, and the presentation layer as a class

library.C. Create a utility class for the data access layer and the business logic layer as a class library. Create a

separate utility class for the presentation layer as an executable.D. Create a utility class as a Windows Presentation Foundation (WPF) control for the data access layer and

the business logic layer. Create a separate utility class for the presentation layer as a console application.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 2You are creating a Windows application by using the .NET Framework 3.5. The application will be used fortelephone directory management. The application has the following specifications:

* It stores data in a Microsoft SQL Server 2008 database instance.* It uses the LINQ to SQL model.It stores the photograph of each directory member in the Picture column of theDirectoryEntry table.* It displays the directory information in a DataGridView control.* It supports expansion of rows of the DataGridView control to display the complete photograph of the directorymember. The application is frequently used across remote or slow database connections.

You need to implement the lazy load technique to load the photographs from the database. You also need toensure that the implementation has minimum effect on the database connection. What should you do?

A. Configure the Picture property of the DirectoryEntry entity in the LINQ to SQL model.Set the Delay Loadedproperty to True.

B. Identify the DataGridView column that contains the photograph. Set the Visible property of the column toFalse.Identify the DataGridView column that contains the photograph. Set the Visible property of the columnto True when the row that contains the photograph is expanded.

C. Create a DataLoadOptions object in the method that is used to execute the LINQ query.Call the LoadWithmethod of the object along with the de => de.Picture statement.Use the DataLoadOptions object whenthe statement is executed.

D. Modify the method that executes the LINQ query to accept a Boolean parameter which indicates whether aphotograph is to be loaded.Include a data-shaping clause to exclude the Picture column from the list ofcolumns that are returned if the Boolean parameter is False.Execute the method initially by setting theBoolean parameter to True.Repeat the method execution by setting the Boolean parameter to False whenthe DataGridView row is expanded.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 3You are creating a Windows application by using the .NET Framework 3.5. The application contains a form toenter user details. The application must capture the preferred search engine as part of input data. You discoverthat the preferred search engine can be a known search engine or an unknown one. You need to allowthe user to select a value for the preferred search engine from a list of search engines. You also need to allowthe user to enter a value for the search engine in the same list. Which control should you use?

A. A ListBox control that has the SelectionMode property set to 1B. A TextBox control that has the AutoCompleteSource property set to CustomC. A ComboBox control that has the DropDownStyle property set to DropDownD. A ComboBox control that has the DropDownStyle property set to DropDownList

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 4You are creating a Windows application by using the .NET Framework 3.5. The application must meet thefollowing requirements:

* It records the details of the users who modify sensitive information.* It requires a context-related stack dump for the details.* It is executed by using the local user account without administrative privileges.

You need to ensure that the requirements are met by using minimum possible development effort. What shouldyou do?

A. Store the user details to a text file when a user modifies sensitive information.B. Store the user details as a log entry to the Windows application log when a user modifies sensitive

information.C. Use the Trace.WriteLine method to generate trace information when a user modifies sensitive information.

Configure the TraceListener object to save the trace information.D. Add performance counters to the application for each set of sensitive information. Write a code segment to

record the details of users who modify sensitive information.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 5You create a Windows application by using the .NET Framework 3.5. You plan to deploy an application byusing the ClickOnce deployment method. The application has the following specifications:

* It contains multiple components.* It is based on the .NET Framework 3.5.* The .NET Framework 3.5 is not installed on all the client computers.

You need to install the .NET Framework 3.5 on the client computers during the application deployment process.What should you do?

A. Use the bootstrapping feature of the ClickOnce deployment method.B. Include the .NET Framework 3.5 in the platform dependencies of the ClickOnce deployment method.C. Change the method for deployment to the Microsoft Windows Installer (MSI) packages and disable the

bootstrapping feature.D. Use registration-free Component Object Model (COM) components for deployment and set the Isolated

property to TRUE.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 6You are creating a Windows application by using the .NET Framework 3.5. The application uses multiplethreads. You need to ensure that any exceptions that occur while executing the application are reported to thecommon exception handler. You want to achieve the goal by using minimum development effort. What shouldyou do?

http://www.gratisexam.com/

A. Place a TRY CATCH statement around every method in the application.Report any exceptions to thecommon handler.

B. Place a TRY CATCH statement inside the Form_Load event in the main form, and report any exceptions tothe common handler.Handle the Application.ThreadExit event, and report any exceptions to the commonhandler.

C. Place a TRY CATCH statement around the call to the Application.Run method, and report any exceptions tothe common handler.Handle the Application.ThreadException event, and report any exceptions to thecommon handler.

D. Place a TRY CATCH statement around every call to the System.Threading.Thread.Start method in theapplication.Report any System.Threading.Thread.ThreadStateException to the common handler.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 7You create a Windows application by using the .NET Framework 3.5. The application is named APP1. APP1has the following specifications:

* It merges information from text files.* It reads each text file as a string.* It runs on a server computer named Server1.

Another application named APP2 also runs on Server1. You discover that when a function is used to merge the

text files, APP1 consumes additional memory. This additional memory consumption affects the operations of APP2.

You need to modify the design of APP1 to ensure minimum effect on APP2. What should you do?

A. Use the + operator for the merge process.B. Use the StringBuilder.Append method for the merge process.C. Write a code segment to perform the merge process on a new thread.D. Write a code segment in a separate project to perform the merge process. Configure the project to start the

merge operation as a new process.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 8You are creating a Windows application by using the .NET Framework 3.5. The application will be used toretrieve information about the technical skills of the employees. The data will be retrieved from the followingrelated tables on a Microsoft SQL Server 2008 database instance by using LINQ to SQL:

* EmployeeSkills table* TechnicalSkills table

The application must retrieve data from the TechnicalSkills table only when the correspondingEmployeeSkillsrating value is 3. In addition, the application must minimize data returned and prevent duplicate information from being returned.

You need to meet the outlined requirements in one roundtrip to the database.What should you do?

A. Use a LINQ query to join EmployeeSkills data to TechnicalSkills data based on the skill rating level.B. Use a LINQ query along with a Where clause to select EmployeeSkills records only when the skills rating

value is equal to 3.C. Set the DataContext. DeferredLoadingEnabled setting to False. Allow the records to be accessed by the

caller on demand.D. Set the DataContext. DeferredLoadingEnabled setting to True. Use the

DataContext.DataLoadOptions.AssociateWith method to associate EmployeeSkills data with TechnicalSkills data based on the skill rating value.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 9You are creating a Windows application by using the .NET Framework 3.5. The application has to beconfigured for deployment to client computers. You need to ensure that the application meets the followingrequirements:

* The application state is stored for each instance.* The administrator can configure the general look and feel of the application from a single location.

What should you do?

A. Serialize and de-serialize a formatter object.B. Save the application state in the App.config file.C. Save the application state in a central database.D. Save the application state in the registry key under HKEY_CURRENT_USER.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 10You are creating a Windows application by using the .NET Framework 3.5. The application connects to adatabase within the corporate network. It retrieves data from a read-only database. The database contains atable named Customers. An XML file that contains new customer data is periodically provided to theapplication. The XML file has the following specifications:

* It has the same schema as that of the Customers table.* It will be integrated into the Customers table.* It will be removed after data integration.

The application requires data from the Customers table and the XML file to bind to a DataGridView control.

You need to ensure that data can be retrieved together from the two data sources by using minimumdevelopment effort. What should you do?

A. Load data from the two data sources into DataSet objects. Merge the data present in the DataSet objects.B. Read data from the Customers table as an XML object. Use the XSLT style sheet to merge data with the

original XML file.C. Load data from the Customers table into a new XML file. Open the XmlReader object to read the two XML

files. Merge the XML files.D. Create a temporary table in the database. Load data from the XML file into the temporary table. Retrieve

data simultaneously from the temporary table and the Customers table.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 11You are creating a Windows application by using the .NET Framework 3.5. The application will be deployed byusing the ClickOnce deployment. The application must support offline use. The application must also haveminimum dependency on external components. You need to choose the most secure data storage tool for yourapplication. Which data storage tool should you use?

A. XML fileB. Microsoft Office Access 2007 databaseC. Microsoft SQL Server 2008 Express Edition databaseD. Microsoft SQL Server 2008 Compact Edition database

Correct Answer: D

Section: (none)Explanation

Explanation/Reference:

QUESTION 12You create a windows application by using the .NET Framework 3.5. The application has a business layer anda data access layer class library. You create a Web UI by using ASP.NET for the application. You discoverexcessive code repetition on the flow of the application between the Windows Forms UI and the Web UI. Youneed to increase code reuse between the applications. What should you do?

A. Create a single class library for the business layer and the data access layer.B. Create a UI Process layer as a class library.C. Compile the Windows Forms application as a class library to reference the ASP.NET Web application.D. Create a service layer to shield the business layer and the data access layer.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 13You are creating a Windows application by using the .NET Framework 3.5. The application stores customerdetails in a database within the corporate network. The application has a form that contains a TextBox controlto capture the customer name. The auto-complete feature must be used in the TextBox control to display thecustomer names entered since the application started.You need to ensure that the application meets thefollowing requirements:

* It is available in the offline mode.* It provides the fastest response time for the auto-complete feature.

What should you do?

A. Implement one-level caching by caching all customer records within a DataSet object in the application.B. Implement one-level caching by caching all customer records within a Microsoft SQL Server 2008 Express

Edition database.C. Implement two-level caching. First, cache all customer records within a DataSet object in the application.

Then, cache the customer names entered in the TextBox control to a Microsoft SQL Server 2008 CompactEdition database.

D. Implement two-level caching. First, cache all customer records within a Microsoft SQL Server 2008Compact Edition database. Then, cache the customer names entered in the TextBox control within aList<T> object in the application.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 14You create a Windows application by using the .NET Framework 3.5. You plan to use ClickOnce deployment.The application will run in a partial trust environment. You need to store user preferences for the application.What should you do?

A. Save data to isolated storage.B. Save data to the application folder.C. Save data to a network file share.D. Save data to the Windows Temporary Files folder.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 15You are creating a Windows application by using the .NET Framework 3.5. The application uses Microsoft SQLServer 2008 authentication to connect to a relational database. You need to devise a storage strategy for theconnection string to prevent unauthorized users from accessing the information. What should you do?

A. Embed the connection string in the application code.B. Store the connection string in a protected configuration section.C. Store the connection string by using the isolated storage mechanism.D. Store the connection string to a location in the %LOCALAPPDATA% folder of the application.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 16You create a Windows application by using the .NET Framework 3.5. The application is used by the employeesand managers of a bank. You plan to implement role-based security for the application by using the Identity andPrincipal features provided by the .NET Framework 3.5. You need to ensure that application meets the following requirements:

* All users are authenticated against credentials stored in the application database.* Only the managers can access certain features in the application.

What should you do?

A. Manage roles as group accounts in Windows, and use the WindowsIdentity and WindowsPrincipal classesin the application.

B. Manage roles in the database, and use the WindowsIdentity and WindowsPrincipal classes in theapplication.

C. Manage roles as group accounts in Windows, and use the GenericIdentity and WindowsPrincipal classes inthe application.

D. Manage roles in the database, and use the GenericIdentity and GenericPrincipal classes in the application.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 17You are creating a Windows application by using the .NET Framework 3.5. The application uses a Web Serviceto allow managers to retrieve employee performance data. The application allowsmanagers to access andmodify data offline. The employee performance data is sensitive and must be protected. You need toimplement an offline storage strategy. What should you do?

A. Save a local XML file that contains the data for the employees selected in Isolated Storage.B. Save a local XML file that contains the data for the employees selected in the home directory of the

application.C. Use the System.Security.Cryptography.MD5CryptoServiceProvider to encrypt a local XML file that contains

only the data for the employees selected.D. Use the System.Security.Cryptography.TripleDESCryptoServiceProvider to encrypt a local XML file that

contains only the data for the employees selected.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 18You are creating a Windows application by using the .NET Framework 3.5. The application will be used by theshipping department of your company. The application contains a form named SchedulingForm. You plan todesign a strategy to ensure the following accessibility criteria:

* SchedulingForm is accessible only to users logged on by using a particular Windows account.* The Windows account belongs to a local group named Managers.

You need to implement the strategy by using the minimum amount of development effort. Which two actionsshould you perform? (Each correct answer presents part of the solution. Choose two.)

A. Create custom components that implement the IIdentity and IPrincipal classes.B. Call the AppDomain.CurrentDomain.SetPrincipalPolicy method that has the PrincipalPolicy enumeration

value set to WindowsPrincipal.C. Create a GenericIdentity object that has the current user and the role membership information. Attach the

object to the current thread.D. Create a GenericIdentity object that has the current user and the role membership information. Attach the

object to the current thread.E. Use the Thread.CurrentPrincipal.IsInRole method to test the role membership. If the user does not belong

to the Managers group, hide access to SchedulingForm.

Correct Answer: BESection: (none)Explanation

Explanation/Reference:

QUESTION 19You create Windows Forms applications by using the .NET Framework 3.5. You plan to deploy a newapplication. 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?

A. Deploy the application to a central network server.Access the application by using the Remote DesktopConnection tool.

B. Deploy the application by using the ClickOnce technology.Use the Mage.exe tool to set the Online Onlyoption in the deployment manifest.

C. Deploy the application by using the ClickOnce technology.Set the Install attribute of the deployment tag totrue in the deployment manifest.

D. Deploy the application to a CD-ROM by using the ClickOnce technology.Execute the application from theCD-ROM.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 20You create Windows Forms applications by using the .NET Framework 3.5. You create a new application forWindows Vista client computers. The application requires elevated access to read files from the local filesystem. You need to ensure that the application requires elevated permissions on execution. What should you do?

A. Create a new certificate trust list (CTL). Use the CertMgr.exe tool to install the CTL on the local computer.B. Create a new certificate trust list (CTL). Install the CTL on the server that has the ClickOnce application

published.C. Create a manifest that includes the <requestedExecutionLevel level=”asInvoker”/> tag. Add the manifest to

the executable file of the application.D. Create a manifest that includes the <requestedExecutionLevel level=”requireAdministrator”/> tag. Add the

manifest to the executable file of the application.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 21You create Windows Forms applications by using the .NET Framework 3.5. You plan to use the WindowsInstaller 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?

A. Create a single MSI file.Add a launch condition that is set to Version NT64.B. Create a single MSI file.Add a launch condition that is set to NOT Version NT64.C. Create an MSI file that is targeted to 64-bit platforms.Create an MSI file that is targeted to 32-bit platforms.D. Create a single MSI file.Create a merge module that contains the 32-bit and 64-bit code.

Correct Answer: CSection: (none)

Explanation

Explanation/Reference:

QUESTION 22You are creating a Windows Forms application that has the print functionality by using the .NET Framework3.5. You implement the PrintPage page event for the form. You associate an instance of the PrintDocumentcontrol 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 byadding a code segment to the Click event of the button on the form. Which code segment should you use?

A. prevDialog1.Width = Screen.PrimaryScreen.Bounds.Width; prevDialog1.Height = Screen.PrimaryScreen.Bounds.Height; prevDialog1.ShowDialog();

B. prevDialog1.Width = 1024; prevDialog1.Height = 768; prevDialog1.ShowDialog();

C. prevDialog1.Width = prevDialog1.PrintPreviewControl.Width; prevDialog1.Height = prevDialog1.PrintPreviewControl.Height; prevDialog1.ShowDialog();

D. prevDialog1.Width = prevDialog1.PrintPreviewControl.Width; prevDialog1.Height = prevDialog1.PrintPreviewControl.Height; prevDialog1.Update();

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 23You are creating a Windows application by using the .NET Framework 3.5. The application processes a largenumber of records. The records are processed on a separate thread. Occasionally, the record processing takesa long time. You add a Cancel button to the form. You also add an AutoResetEvent object on the user interface thread, and set the default value of the object to false. You plan to perform the following steps insequence:

* After every record is processed, read the value of the AutoResetEvent object by using theAutoResetEvent.WaitOne method.* When the value of the AutoResetEvent object is True, discontinue the record processing.

You need to modify the Click event handler of the Cancel button to change the value of the AutoResetEventobject. What should you do?

A. Call the EndInvoke method.B. Call the Thread.Abort method.C. Call the Set method of the AutoResetEvent object.D. Call the Reset method of the AutoResetEvent object.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 24You are creating a Windows Forms application by using the .NET Framework 3.5. You have implemented thePrintPage event to send the page output to the printer. The users must select the printer and the page rangebefore 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?

A. PageSetupDialog pageSetupDialog1 = new PageSetupDialog(); pageSetupDialog1.Document = printDocument1; DialogResult result = pageSetupDialog1.ShowDialog(); if(result == DialogResult.OK) { printDocument1.Print(); }

B. PageSetupDialog pageSetupDialog1 = new PageSetupDialog(); pageSetupDialog1.Document = printDocument1; DialogResult result = pageSetupDialog1.ShowDialog(); if (result == DialogResult.Yes) { printDocument1.Print(); }

C. PrintDialog printDialog1 = new PrintDialog(); printDialog1.AllowSomePages = true; printDialog1.Document = printDocument1; DialogResult result = printDialog1.ShowDialog(); if (result == DialogResult.OK) { printDocument1.Print(); }

D. PrintDialog printDialog1 = new PrintDialog(); printDialog1.AllowSomePages = true; printDialog1.Document = printDocument1; DialogResult result = printDialog1.ShowDialog(); if (result == DialogResult.Yes) { printDocument1.Print(); }

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 25You are creating a Windows application for graphical image processing by using the .NET Framework 3.5. Youcreate an image processing function and a delegate. You plan to invoke the image processing function by usingthe 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?

A. Call the Invoke method of the delegate.B. Call the BeginInvoke and EndInvoke methods of the delegate in the calling thread.C. Call the BeginInvoke method by specifying a callback method to be executed when the delegate is

complete. Call the EndInvoke method in the callback method.D. Call the BeginInvoke method by specifying a callback method to be executed when the delegate is

complete. Call the EndInvoke method of the delegate in the calling thread.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 26You are creating a Windows application by using the .NET Framework 3.5. You plan to create a form that mightresult in a time-consuming operation. You use the QueueUserWorkItem method and a Label control namedlblResult. You need to update the users by using the lblResult control when the process has completed the operation. Which code segment should you use?

A. private void DoWork(object myParameter){ // thread work this.Invoke(new MethodInvoker(ReportProgress)); } private void ReportProgress() { this.lblResult.Text = “Finished Thread”; }

B. private void DoWork(object myParameter) { // thread work this.lblResult.Text = “Finishe Thread”; }

C. private void DoWork(object myParameter) { // thread work System.Threading.Monitor.Enter(this); this.lblResult.Text = “Finished Thread”; System.Threading.Monitor.Exit(this); }

D. private void DoWork(object myParameter) { // thread work System.Threading.Monitor.TryEnter(this); ReportProgress(); } private void ReportProgress(){ this.lblResult.Text = “Finishe Thread”; }

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 27You are creating a Windows application by using the .NET Framework 3.5. You add a BackgroundWorkercomponent 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?

A. Set the DoWorkEventArgs.Cancel property to False in the DoWork event handler of BackgroundWorker.B. Call the BackgroundWorker.CancelAsync() method from the OnClick event handler of the Cancel button.C. Call the BackgroundWorker.CancelAsync() method from the DoWork event handler of the

BackgroundWorker.D. Stop the process in the OnClick event handler of the Cancel button if the

BackgroundWorker.CancellationPending property is True.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 28You are creating a Windows application by using the .NET Framework 3.5. You create an instance of theBackgroundWorker component named backgroundWorker1 to asynchronously process time-consumingreports in the application. You write the following code segment in the application. (Line numbers are included for reference only.)

01 private voidbackgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)02 {0304 }

You need to write a code segment that reports to the application when the background process detects any ofthe following actions:

* An exception is thrown.* The process is cancelled.* The process is successfully completed.

Which code segment should you insert at line 03?

A. if (e.Cancelled == null) MessageBox.Show(“Report Cancelled”); else MessageBox.Show(“Report Completed”);

B. if (e.Result == “Cancelled” || e.Result == “Error”) MessageBox.Show(“Report Cancelled”); else MessageBox.Show(“Report Completed”);

C. if (backgroundWorker1.CancellationPending) MessageBox.Show(“Report Cancelled”); Else MessageBox.Show(“Report Completed”);

D. if (e.Error != null) MessageBox.Show(e.Error.Message); else if (e.Cancelled) MessageBox.Show(“Report Cancelled”); else MessageBox.Show(“Report Completed”);

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 29You are creating a Windows Forms application by using the .NET Framework 3.5. You need to populate a listbox control along with category names by using a DataReader control. Which code segment should you use?

A. OleDbDataReader reader; OleDbConnection cnnNorthwind = new OleDbConnection( connectionString); cnnNorthwind.Open(); OleDbCommand cmdCategory = new OleDbCommand( “SELECT * FROM Categories”, cnnNorthwind); reader = cmdCategory.ExecuteReader(); while (reader.Read()) { lbCategories.Items.Add(reader["CategoryName"]); } cnnNorthwind.close();

B. OleDbDataReader reader; OleDbConnection cnnNorthwind = new OleDbConnection connectionString); cnnNorthwind.Open(); OleDbCommand cmdCategory = new OleDbCommand “SELECT * FROM Orders”, cnnNorthwind); reader = cmdCategory.ExecuteReader(); while (reader.NextResult()) { lbCategories.Items.Add(reader["CategoryName"]); } cnnNorthwind.close();

C. OleDbDataReader reader; OleDbConnection cnnNorthwind = new OleDbConnection( connectionString); cnnNorthwind.Open(); OleDbCommand cmdCategory = new OleDbCommand( “SELECT * FROM Orders”, cnnNorthwind);reader = cmdCategory.ExecuteReader(); cnnNorthwind.Close(); while (reader.Read()) { lbCategories.Items.Add(reader["CategoryName"]); } cnnNorthwind.close();

D. OleDbDataReader reader; using (OleDbConnection cnnNorthwind = new OleDbConnection( connectionString)) { cnnNorthwind.Open(); OleDbCommand cmdCategory = new OleDbCommand( “SELECT * FROM Orders”, cnnNorthwind);reader = cmdCategory.ExecuteReader(); } while (reader.Read()) { lbCategories.Items.Add(reader["CategoryName"]); } cnnNorthwind.close();

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 30You are creating a Windows Forms application by using the .NET Framework 3.5. You plan to modify a list oforders within a DataGridView control in the application. You need to ensure that a value is required in the firstcolumn of the grid control. Which code segment should you use?

A. private void dataGridOrders_CellValidated( object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0) { var cellValue = dataGridOrders[e.ColumnIndex, e.RowIndex].Value; if (cellValue == null || string.IsNullOrEmpty(cellValue.ToString())) { dataGridOrders.EndEdit(); } } }

B. private void dataGridOrders_Validated( object sender, EventArgs e) { if (dataGridOrders.CurrentCell.ColumnIndex == 0) { var cellValue = dataGridOrders.Text; if (cellValue == null || string.IsNullOrEmpty(cellValue.ToString())) { dataGridOrders.EndEdit(); } } }

C. private void dataGridOrders_Validating( object sender, CancelEventArgs e) { if (dataGridOrders.CurrentCell.ColumnIndex == 0) { var cellValue = dataGridOrders.Text; if (cellValue == null || string.IsNullOrEmpty(cellValue.ToString())) { e.Cancel = true; } } }

D. private void dataGridOrders_CellValidating( object sender, DataGridViewCellValidatingEventArgs e) { if (e.ColumnIndex == 0) { if (e.FormattedValue == null || string.IsNullOrEmpty(e.FormattedValue.ToString())) { e.Cancel = true; } } }

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 31You are creating a Windows Forms application that has the print functionality by using the .NET Framework3.5. You implement the PrintPage page event for the form. You associate an instance of the PrintDocumentcontrol 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?

A. prevDialog1.Width = Screen.PrimaryScreen.Bounds.Width; prevDialog1.Height = Screen.PrimaryScreen.Bounds.Height; prevDialog1.ShowDialog();

B. prevDialog1.Width = 1024; prevDialog1.Height = 768; prevDialog1.ShowDialog();

C. prevDialog1.Width = prevDialog1.PrintPreviewControl.Width; prevDialog1.Height = prevDialog1.PrintPreviewControl.Height; prevDialog1.ShowDialog();

D. prevDialog1.Width = prevDialog1.PrintPreviewControl.Width; prevDialog1.Height = prevDialog1.PrintPreviewControl.Height; prevDialog1.Update();

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 32You are creating a Windows application by using the .NET Framework 3.5. The application processes a largenumber of records. The records are processed on a separate thread. Occasionally, the record processing takesa long time. You add a Cancel button to the form. You also add an AutoResetEvent object on the user interface thread, and set the default value of the object to false. You plan to perform the following steps insequence:

* After every record is processed, read the value of the AutoResetEvent object by using theAutoResetEvent.WaitOne method.* When the value of the AutoResetEvent object is True, discontinue the record processing.

You need to modify the Click event handler of the Cancel button to change the value of the AutoResetEventobject. What should you do?

A. Call the EndInvoke method.B. Call the Thread.Abort method.C. Call the Set method of the AutoResetEvent object.D. Call the Reset method of the AutoResetEvent object.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 33You are creating a Windows application by using the .NET Framework 3.5. You plan to create a form that mightresult in a time-consuming operation. You use the QueueUserWorkItem method and a Label control namedlblResult. You need to update the users by using the lblResult control when the process has completed the operation. Which code segment should you use?

A. private void DoWork(object myParameter){ // thread work this.Invoke(new MethodInvoker(ReportProgress));

} private void ReportProgress() { this.lblResult.Text = “Finished Thread”; }

B. private void DoWork(object myParameter) { // thread work this.lblResult.Text = “Finishe Thread”; }

C. private void DoWork(object myParameter) { // thread work System.Threading.Monitor.Enter(this); this.lblResult.Text = “Finished Thread”; System.Threading.Monitor.Exit(this); }

D. private void DoWork(object myParameter) { // thread work System.Threading.Monitor.TryEnter(this); ReportProgress(); } private void ReportProgress(){ this.lblResult.Text = “Finishe Thread”; }

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 34You are creating a Windows application by using the .NET Framework 3.5. You add a BackgroundWorkercomponent 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 youdo?

A. Set the DoWorkEventArgs.Cancel property to False in the DoWork event handler of BackgroundWorker.B. Call the BackgroundWorker.CancelAsync() method from the OnClick event handler of the Cancel button.C. Call the BackgroundWorker.CancelAsync() method from the DoWork event handler of the

BackgroundWorker.D. Stop the process in the OnClick event handler of the Cancel button if the

BackgroundWorker.CancellationPending property is True.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 35You are creating a Windows Forms application by using the .NET Framework 3.5. You write a code segment toconnect to a Microsoft Access database and populate a DataSet. You need to ensure that the applicationmeets the following requirements:

* It displays all database exceptions.* It logs all other exceptions by using the LogExceptionToFile.Which code segment should you use?

A. try{ categoryDataAdapter.Fill(dsCategory); }catch (SqlException ex){ MessageBox.Show(ex.Message, “Exception”); LogExceptionToFile(ex.Message); }

B. try{ categoryDataAdapter.Fill(dsCategory); }catch (SqlException ex){ MessageBox.Show(ex.Message, “Exception”); }catch (Exception ex){ LogExceptionToFile(ex.Message);}

C. try{ categoryDataAdapter.Fill(dsCategory); }catch (OleDbException ex){ MessageBox.Show(ex.Message, “Exception”); }catch (Exception ex){ LogExceptionToFile(ex.Message);}

D. try{ categoryDataAdapter.Fill(dsCategory); }catch (OleDbException ex){ MessageBox.Show(ex.Message, “Exception”); LogExceptionToFile(ex.Message);}

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 36You create a Windows application by using the .NET Framework 3.5. The application is used by employees tosubmit timesheets and to generate reports. The application must contain a Managers role and an Employeesrole. You have the following security requirements:

* Members of the Managers role can approve the timesheets.* Members of the Employees role can generate reports only if they are a member of the local administratorsgroup.* Members of the Managers role can access the application from untrusted domains.

You need to design a security model to meet the design requirements. What should you do ?

A. Define the Managers and Employees roles as custom roles in the database.B. Define the Managers and Employees roles as local system roles.C. Define the Employees role as a custom role in the database and the Managers role as a local system role.D. Define the Managers role as a custom role in the database and the Employees role as a local system role.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 37You are creating a Windows application by using the .NET Framework 3.5. The application is used to manageemployee information. The application meets the following specifications:

* A main form named EmployeeList contains a list control that displays a list of all employees.* The menu items help simultaneously display various detail forms for each employee selected from the listcontrol.* Each detail form for a selected employee contains a different set of information about the employee.

You need to ensure that when a user switches from one employee to another, the open detail forms areupdated to the corresponding employee information. What should you do?

A. Implement the INotifyPropertyChanging interface on the EmployeeList form.Add a static constructor to alldetail forms and instantiate a PropertyChangingEventHandler delegate in all the static constructors.

B. Add a public event named SelectEmployeeChanged to the EmployeeList form. Raise the event whenanother employee is selected from the list control.Subscribe to the SelectEmployeeChanged event in theconstructor of all the detail forms along with a method that updates the information displayed on the form.

C. Add a public static property named EmployeeId to all the detail forms.Implement theINotifyPropertyChanging interface on the EmployeeList form.Implement the INotifyPropertyChanginginterface on each detail form.

D. Add a public delegate named UpdateEmployee of the type EventHandler to the EmployeeList form.Create amethod named UpdateInformation in all the detail forms.When a detail form is loaded, instantiate a newEventHandler delegate and point it to the UpdateInformation method. Assign this delegate to theUpdateEmployee delegate of the EmployeeList form.Invoke the UpdateEmployee delegate when anotheremployee is selected from the list control.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 38You are creating a Windows application to manage customer relationships by using the .NET Framework 3.5.Users of the application access a form named FrmMain to view a list of contacts. When the user double-clicksthe contact, the item details for the contact can be viewed on another form named FrmDetails. You need to ensure that the application meets the following requirements:

* A user can compare the details of multiple customers simultaneously.* A user can rearrange all the open instances of the FrmDetails forms as a cascade or a tile in the FrmMainform.

What should you do?

A. Create a new instance of the FrmDetails form for each contact. Call the ShowDialog method. Set theTopMost property of FrmMain to False.

B. Create a new instance of the FrmDetails form for each contact. Call the Show method. Set the TopMostproperty of FrmMain to True.

C. Set the IsMdiContainer property of the FrmMain form to True. Set the MdiParent property of the FrmDetailsform to FrmMain.

D. Set the IsMdiContainer property of the FrmDetails form to True. Set the MdiParent property of FrmMain toFrmDetails.

Correct Answer: CSection: (none)

Explanation

Explanation/Reference:

QUESTION 39You create a Windows application by using the .NET Framework 3.5. You create a Windows user control in theapplication. The application contains the following code segment. (Line numbers are included for referenceonly.)

01 public struct FullName02 {03 public string FirstName { get; set; }04 public string LastName { get; set; }05 }

The user control has a property named UserName of the FullName type. You add the user control to aWindows form. During the design phase, the UserName property must be allowed to update the FirstName andLastName properties as comma-delimited values in the property window.You need to ensure that the properties in the FullName structure are represented as string values. What shouldyou do?

A. Create a TypeConverter class for the FullName structure.B. Override the ToString method for the FullName structure.C. Implement the IFormattable interface for the FullName structure.D. Implement the IConvertible interface for the FullName structure.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 40You create a Windows application by using the .NET Framework 3.5. The application is used in a corporateenvironment to maintain the contact information of all employees. You create a Windows client application tobrowse through employee contacts information. All data is stored on a central Microsoft SQL Server 2008 database, and smart clients are deployed on each computer. You discover that users often browse through thesame contacts data several times. You need to prevent unnecessary round trips to bind the data from theserver. What should you do?

A. Use DataSet class to bind and store data in the client applicationB. Use BindingNavigator.BindingSource class to navigate through data.C. Use BindingSource.CurrentChanged event to retrieve the updated data.D. Use System.Web.Caching.Cache class to temporarily store on a network file share.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 41You are creating a Windows application by using the .NET Framework 3.5. The application is used to browsethrough purchase orders. The purchase order data is stored in a file on the localcomputer. The application

synchronizes purchase order data with a central database by using a Web service. You discover that other applications on the computer can access the purchase order data. You need to ensure that the purchase orderdata can be accessed only by the Windows application. What should you do?

A. Use the ZipPackage class to store the purchase order dataB. Use the RijndaelManaged class to encrypt the purchase order data.C. Use the IsolatedStorageFileStream class to store the purchase order data.D. Add the PrincipalPermission class to the method that reads the purchase order data.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 42You create a Windows application by using the .NET Framework 3.5. The application is used by employees tosubmit timesheets and to generate reports. The application must contain a Managers role and an Employeesrole. You have the following security requirements:

* Members of the Managers role can approve the timesheets.* Members of the Employees role can generate reports only if they are a member of the local administratorsgroup.* Members of the Managers role can access the application from untrusted domains.

You need to design a security model to meet the design requirements. What should you do ?

A. Define the Managers and Employees roles as custom roles in the database.B. Define the Managers and Employees roles as local system roles.C. Define the Employees role as a custom role in the database and the Managers role as a local system role.D. Define the Managers role as a custom role in the database and the Employees role as a local system role.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 43You are creating a Windows application by using the .NET Framework 3.5. Your company has an existingASP.NET Web application that uses a Microsoft SQL Server 2008 data source. The application authenticatesusers by using the SqlRoleProvider and SqlMembershipProvider classes. You plan to design a strategy to authenticate users to the Windows application by using the same SQL Server 2008 data source. You need toimplement the strategy by using minimum possible code. What should you do?

A. Implement a custom Web service that replicates the authentication services. Authenticate the users to theWeb service.

B. Collect the user login credentials, and authenticate the users directly against the database. Use the logincredentials to construct a principal used for authentication.

C. Use the HttpWebRequest class to post form data to the login page of the Web application. Create aprincipal by using the cookies that are returned. Use the principal for authentication.

D. Enable client application services. Set an authentication service location and a membership servicelocation. Authenticate the users by calling the Membership.ValidateUser method.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 44You create a Windows Forms application by using the .NET Framework 3.5. The application is used for audio/video management. The application provides the following features:

* Usage license for music or video can be purchased from an online store.* Backup of music and video for disaster recovery can be done.* Custom playlists can be created to organize downloaded content.

The application has the following requirements:* A license file is required to play local music or video.* Users can access previously-purchased content from any computer that runs the application.* User theme settings for the UI might only be customized for each computer.

http://www.gratisexam.com/

You need to design a state and data management strategy that meets the requirements.What should you do?

A. Store license files in the User.config file.Store content files on the online store database.Store customplaylists in the User.config file.Store theme settings on the online store database.

B. Store license files in the User.config file.Store content files in the local user isolated storage.Store customplaylists in the local user isolated storage.Store theme settings in the User.config file.

C. Store license files in the local user isolated storage and on the online store database.Store content files inthe local user isolated storage.Store custom playlists in the User.config file.Store theme settings on theonline store database.

D. Store license files in the local user isolated storage and on the online store database.Store content files inthe local user isolated storage.Store custom playlists in the local user isolated storage.Store theme settingsin the User.config file.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 45You are creating a Windows application by using the .NET Framework 3.5. The application is used to retrieveinformation about musicians. The application uses LINQ to SQL to return an Artist object, and related Albumobjects for each artist. You plan to add a method named FindArtists. The method has parameters namedArtistName of type string and IncludeAlbums of type boolean. The FindArtists method must meet the followingrequirements: If the IncludeAlbums parameter is set to True, then all the Album objects of the returned Artistobject are populated. If the IncludeAlbums parameter is set to False, then all the Album objects of the returnedArtist object are not populated. No duplicated data is returned. Data returned does not require additionalprocessing on the client application. You need to ensure that changes to the client application are minimal.What should you do?

A. Utilize LINQ join operations to pre-fetch artist and album data. Combine them into a single result set.B. Modify the DataContext.DeferredLoadingEnabled property to match the IncludeAlbums parameter.C. Modify and use the LoadWith and AssociateWith methods of the DataContext. LoadOptions.

DataLoadOptions property if the IncludeAlbums parameter is set to True.D. Modify the return value of your method to return a multi-dimensional array of artists and albums. Iterate

through the Artist object and populate the second dimension with album data.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 46You are creating a Windows application by using the .NET Framework 3.5. The application is deployed by usingthe XCopy command. Updates to the application are made available through a Web site. The number of usersof the application increases. You need to ensure that all users use the same version of the application. Whatshould you do?

A. Change the application to use the ClickOnce deployment methodB. Run the application from a universal naming convention (UNC) path.C. Create a Microsoft Windows Installer (MSI) package for the application.D. Write a bootstrap code that ascertains the availability of a new version of the application.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 47You are creating a Windows application by using the .NET Framework 3.5.The application makes function callsto an unmanaged library to control the operation of a robot. You create a class that consumes significantmemory during function calls to the unmanaged library. You discover that memory consumption increases overtime. You need to ensure that the application consistentlyconsumes minimum memory. What should you do?

A. Use the Finalize method.B. Use the GC.Collect method.C. Use the IDisposable interface.D. Use the GC.SuppressFinalize method.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 48You are creating a Windows application by using the .NET Framework 3.5. The application will be used tomanage records of patients at the hospital. Each application form contains a TreeView control that displays ahierarchical list of patients. Items from the TreeView controls can be dragged to other controls on the form.Each form has a different layout. You discover that items from the TreeView controls of 10 forms cannot bedragged to other forms. You need to ensure that the TreeView controls across all forms in the application

function appropriately. You want to achieve this goal by using minimum development effort. What should youdo?

A. Create a user control that contains the TreeView control.Replace the TreeView control on each form in theapplication with the TreeView user control.

B. Create a single base form that inherits the System.Windows.Forms.Form class.Add a TreeView control tothe base form.Modify each form in the application to inherit the base form.

C. Create a static class that contains a single method to create and return a TreeView control.Modify eachform in the application to call the method.Add the TreeView control that is returned by the method to thecontrols collection of the forms.

D. Use the Singleton pattern to create a class that contains all events to be raised by each TreeView control inthe application.Modify each application form to subscribe to the events on the Singleton class instead of theTreeView controls.Set the TreeView controls to use the Singleton class to raise events.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 49You are creating a Windows application by using the .NET Framework 3.5. The application must meet thefollowing requirements:

* It records the details of the users who modify sensitive information.* It requires a context-related stack dump for the details.* It is executed by using the local user account without administrative privileges.

You need to ensure that the requirements are met by using minimum possible development effort. What shouldyou do?

A. Store the user details to a text file when a user modifies sensitive information.B. Store the user details as a log entry to the Windows application log when a user modifies sensitive

information.C. Use the Trace.WriteLine method to generate trace information when a user modifies sensitive information.

Configure the TraceListener object to save the trace information.D. Add performance counters to the application for each set of sensitive information. Write a code segment to

record the details of users who modify sensitive information.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 50You create a Windows application by using the .NET Framework 3.5. You plan to test the application by using5,000 records in a limited test environment. The application will process 1 million records in a productionenvironment. You need to test the application to identify potential problems that might occur when theapplication is moved to the production environment. Which two actions should you perform? (Each correctanswer presents part of the solution. Choose two.)

A. Test the thread pool usage.B. Test the collection type usage.

C. Test the language resource files.D. Test the type of log file encoding.E. Test the number of Microsoft Windows Installer (MSI) files used for deployment.

Correct Answer: ABSection: (none)Explanation

Explanation/Reference:

QUESTION 51You are creating a Windows application by using the .NET Framework 3.5. The application contains a form toenter user details. The application must capture the preferred search engine as part of input data. You discoverthat the preferred search engine can be a known search engine or an unknown one. You need to allowthe user to select a value for the preferred search engine from a list of search engines. You also need to allowthe user to enter a value for the search engine in the same list. Which control should you use?

A. A ListBox control that has the SelectionMode property set to 1B. A TextBox control that has the AutoCompleteSource property set to CustomC. A ComboBox control that has the DropDownStyle property set to DropDownD. A ComboBox control that has the DropDownStyle property set to DropDownList

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 52You are creating a Windows application by using the .NET Framework 3.5. The application uses a Web Serviceto allow managers to retrieve employee performance data. The application allowsmanagers to access andmodify data offline. The employee performance data is sensitive and must be protected. You need toimplement an offline storage strategy. What should you do?

A. Save a local XML file that contains the data for the employees selected in Isolated Storage.B. Save a local XML file that contains the data for the employees selected in the home directory of the

application.C. Use the System.Security.Cryptography.MD5CryptoServiceProvider to encrypt a local XML file that contains

only the data for the employees selected.D. Use the System.Security.Cryptography.TripleDESCryptoServiceProvider to encrypt a local XML file that

contains only the data for the employees selected.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 53You are creating a Windows Forms application by using the .NET Framework 3.5. You create a new form in theapplication. You add a ContextMenuStrip control named ctxMenu to the form. You have a user-defined classnamed CustomControl. You write the following code segment in the application. (Line numbers are included forreference 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 thectxMenu control. Which code segment should you add at line 02?

A. ToolStripControlHost host = new ToolStripControlHost(myControl);ctxMenu.Items.Add(host);B. ToolStripPanel panel = new ToolStripPanel();panel.Controls.Add(myControl);ctxMenu.Controls.Add(panel);C. ToolStripContentPanel panel = new ToolStripContentPanel();panel.Controls.Add

(myControl);ctxMenu.Controls.Add(panel);D. ToolStripMenuItem menuItem = new ToolStripMenuItem();

ToolStripControlHost host = new ToolStripControlHost(myControl); menuItem.DropDownItems.Add(host);ctxMenu.Items.Add(menuItem);

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 54You are creating a Windows Forms application by using the .NET Framework 3.5.You write the following codesegment 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 FROMCategories ORDER BYCategoryName”, cnnNorthwind);03 OleDbDataAdapter daCategory = newOleDbDataAdapter(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?

A. ddlCategory.DataSource = dsCategory; ddlCategory.DisplayMember = “CategoryName”; ddlCategory.ValueMember = “CategoryID”;

B. ddlCategory.DataSource = dsCategory.Tables[0]; ddlCategory.DisplayMember = “CategoryName”; ddlCategory.ValueMember = “CategoryID”;

C. ddlCategory.DataBindings.Add(“DisplayMember”, dsCategory “CategoryName”); ddlCategory.DataBindings.Add(“ValueMember”, dsCategory, “CategoryID”);

D. ddlCategory.DataBindings.Add(“DisplayMember”, dsCategory.Tables[0], “CategoryName”); ddlCategory.DataBindings.Add(“ValueMember”, dsCategory.Tables[0], “CategoryID”);

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 55

You create a Windows Forms application by using the .NET Framework 3.5. The application is used for audio/video management. The application provides the following features:

* Usage license for music or video can be purchased from an online store.* Backup of music and video for disaster recovery can be done.* Custom playlists can be created to organize downloaded content.

The application has the following requirements:* A license file is required to play local music or video.* Users can access previously-purchased content from any computer that runs the application.* User theme settings for the UI might only be customized for each computer.

You need to design a state and data management strategy that meets the requirements.What should you do?

A. Store license files in the User.config file.Store content files on the online store database.Store customplaylists in the User.config file.Store theme settings on the online store database.

B. Store license files in the User.config file.Store content files in the local user isolated storage.Store customplaylists in the local user isolated storage.Store theme settings in the User.config file.

C. Store license files in the local user isolated storage and on the online store database.Store content files inthe local user isolated storage.Store custom playlists in the User.config file.Store theme settings on theonline store database.

D. Store license files in the local user isolated storage and on the online store database.Store content files inthe local user isolated storage.Store custom playlists in the local user isolated storage.Store theme settingsin the User.config file.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 56You are creating a Windows application by using the .NET Framework 3.5. The application will be used toretrieve information about the technical skills of the employees. The data will be retrieved from the followingrelated tables on a Microsoft SQL Server 2008 database instance by using LINQ to SQL:

* EmployeeSkills table* TechnicalSkills table

The application must retrieve data from the TechnicalSkills table only when the correspondingEmployeeSkillsrating value is 3. In addition, the application must minimize data returned and prevent duplicate information from being returned.

You need to meet the outlined requirements in one roundtrip to the database.What should you do?

A. Use a LINQ query to join EmployeeSkills data to TechnicalSkills data based on the skill rating level.B. Use a LINQ query along with a Where clause to select EmployeeSkills records only when the skills rating

value is equal to 3.C. Set the DataContext. DeferredLoadingEnabled setting to False. Allow the records to be accessed by the

caller on demand.D. Set the DataContext. DeferredLoadingEnabled setting to True. Use the

DataContext.DataLoadOptions.AssociateWith method to associate EmployeeSkills data with TechnicalSkills data based on the skill rating value.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 57You are creating a Windows application by using the .NET Framework 3.5. The application connects to adatabase within the corporate network. It retrieves data from a read-only database. The database contains atable named Customers. An XML file that contains new customer data is periodically provided to theapplication. The XML file has the following specifications:

* It has the same schema as that of the Customers table.* It will be integrated into the Customers table.* It will be removed after data integration.

The application requires data from the Customers table and the XML file to bind to a DataGridView control.

You need to ensure that data can be retrieved together from the two data sources by using minimumdevelopment effort. What should you do?

A. Load data from the two data sources into DataSet objects. Merge the data present in the DataSet objects.B. Read data from the Customers table as an XML object. Use the XSLT style sheet to merge data with the

original XML file.C. Load data from the Customers table into a new XML file. Open the XmlReader object to read the two XML

files. Merge the XML files.D. Create a temporary table in the database. Load data from the XML file into the temporary table. Retrieve

data simultaneously from the temporary table and the Customers table.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 58You are creating a Windows application by using the .NET Framework 3.5. The application stores customerdetails in a database within the corporate network. The application has a form that contains a TextBox controlto capture the customer name. The auto-complete feature must be used in the TextBox control to display thecustomer names entered since the application started.You need to ensure that the application meets thefollowing requirements:

* It is available in the offline mode.* It provides the fastest response time for the auto-complete feature.

What should you do?

A. Implement one-level caching by caching all customer records within a DataSet object in the application.B. Implement one-level caching by caching all customer records within a Microsoft SQL Server 2008 Express

Edition database.C. Implement two-level caching. First, cache all customer records within a DataSet object in the application.

Then, cache the customer names entered in the TextBox control to a Microsoft SQL Server 2008 CompactEdition database.

D. Implement two-level caching. First, cache all customer records within a Microsoft SQL Server 2008Compact Edition database. Then, cache the customer names entered in the TextBox control within aList<T> object in the application.

Correct Answer: DSection: (none)

Explanation

Explanation/Reference:

QUESTION 59You create a Windows application by using the .NET Framework 3.5. The application is used by employees tosubmit timesheets and to generate reports. The application must contain a Managers role and an Employeesrole. You have the following security requirements:

* Members of the Managers role can approve the timesheets.* Members of the Employees role can generate reports only if they are a member of the local administratorsgroup.* Members of the Managers role can access the application from untrusted domains.

You need to design a security model to meet the design requirements. What should you do ?

A. Define the Managers and Employees roles as custom roles in the database.B. Define the Managers and Employees roles as local system roles.C. Define the Employees role as a custom role in the database and the Managers role as a local system role.D. Define the Managers role as a custom role in the database and the Employees role as a local system role.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 60You are creating a Windows application by using the .NET Framework 3.5.The application makes function callsto an unmanaged library to control the operation of a robot. You create a class that consumes significantmemory during function calls to the unmanaged library. You discover that memory consumption increases overtime. You need to ensure that the application consistentlyconsumes minimum memory. What should you do?

A. Use the Finalize method.B. Use the GC.Collect method.C. Use the IDisposable interface.D. Use the GC.SuppressFinalize method.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 61You are creating a Windows application by using the .NET Framework 3.5. The application uses Microsoft SQLServer 2008 authentication to connect to a relational database. You need to devise a storage strategy for theconnection string to prevent unauthorized users from accessing the information. What should you do?

A. Embed the connection string in the application code.B. Store the connection string in a protected configuration section.C. Store the connection string by using the isolated storage mechanism.D. Store the connection string to a location in the %LOCALAPPDATA% folder of the application.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 62You are creating a Windows application by using the .NET Framework 3.5. The application will be used by theshipping department of your company. The application contains a form named SchedulingForm. You plan todesign a strategy to ensure the following accessibility criteria:

* SchedulingForm is accessible only to users logged on by using a particular Windows account.* The Windows account belongs to a local group named Managers.

You need to implement the strategy by using the minimum amount of development effort. Which two actionsshould you perform? (Each correct answer presents part of the solution. Choose two.)

A. Create custom components that implement the IIdentity and IPrincipal classes.B. Call the AppDomain.CurrentDomain.SetPrincipalPolicy method that has the PrincipalPolicy enumeration

value set to WindowsPrincipal.C. Create a GenericIdentity object that has the current user and the role membership information. Attach the

object to the current thread.D. Create a GenericIdentity object that has the current user and the role membership information. Attach the

object to the current thread.E. Use the Thread.CurrentPrincipal.IsInRole method to test the role membership. If the user does not belong

to the Managers group, hide access to SchedulingForm.

Correct Answer: BESection: (none)Explanation

Explanation/Reference:

QUESTION 63You create Windows Forms applications by using the .NET Framework 3.5. You plan to use the WindowsInstaller 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?

A. Create a single MSI file.Add a launch condition that is set to Version NT64.B. Create a single MSI file.Add a launch condition that is set to NOT Version NT64.C. Create an MSI file that is targeted to 64-bit platforms.Create an MSI file that is targeted to 32-bit platforms.D. Create a single MSI file.Create a merge module that contains the 32-bit and 64-bit code.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 64You are creating a Windows Forms application by using the .NET Framework 3.5. You write the following codesegment to update multiple databases on a SQL Server 2008 database. (Line numbers are included forreference only.)

01 string connectionStringCustomer = @”DataSource=CUSTOMER;Integrated Security= SSPI;”;02 string connectionStringOrders = @”Data Source=ORDER;Integrated Security= SSPI;”;03 SqlCommand cmdCustomer = new SqlCommand();04 SqlCommand cmdOrders = new SqlCommand();05 SqlConnection cnnCustomer =new SqlConnection(connectionStringCustomer);06 SqlConnection cnnOrders =new SqlConnection(connectionStringOrders);07

You need to ensure that all database updates are included in a single distributed transaction.Which codefragment should you add on Line 07?

A. cnnCustomer.Open();cnnOrders.Open(); …cmdOrders.ExecuteNonQuery(); …cmdCustomer.ExecuteNonQuery(); cnnOrders.Close(); cnnCustomer.Close();

B. TransactionScope scope = new TransactionScope(); cnnCustomer.Open(); cnnOrders.Open(); …cmdOrders.ExecuteNonQuery(); …cmdCustomer.ExecuteNonQuery(); cnnOrders.Close(); cnnCustomer.Close(); scope.Complete();

C. TransactionScope customerScope = new TransactionScope() { using (SqlConnection cnnCustomer = new SqlConnection (connectionStringCustomer)) { } customerScope.Complete(); } using (TransactionScope ordersScope = new TransactionScope()) { using (SqlConnection cnnOrders = new SqlConnection(connectionStringOrders)) { } ordersScope.Complete(); }

D. try { cmdOrders.Transaction = cnnOrders.BeginTransaction(); … cmdOrders.ExecuteNonQuery(); … cmdCustomer.Transaction = cnnCustomer.BeginTransaction(); … cmdCustomer.ExecuteNonQuery(); cmdCustomer.Transaction.Commit(); cmdOrders.Transaction.Commit();}catch { cmdCustomer.Transaction.Rollback(); cmdOrders.Transaction.Rollback();}

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 65You are creating a Windows Forms application by using the .NET Framework 3.5.You write the following codesegment 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 FROMCategories ORDER BYCategoryName”, cnnNorthwind);03 OleDbDataAdapter daCategory = newOleDbDataAdapter(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?

A. ddlCategory.DataSource = dsCategory; ddlCategory.DisplayMember = “CategoryName”; ddlCategory.ValueMember = “CategoryID”;

B. ddlCategory.DataSource = dsCategory.Tables[0]; ddlCategory.DisplayMember = “CategoryName”; ddlCategory.ValueMember = “CategoryID”;

C. ddlCategory.DataBindings.Add(“DisplayMember”, dsCategory “CategoryName”); ddlCategory.DataBindings.Add(“ValueMember”, dsCategory, “CategoryID”);

D. ddlCategory.DataBindings.Add(“DisplayMember”, dsCategory.Tables[0], “CategoryName”); ddlCategory.DataBindings.Add(“ValueMember”, dsCategory.Tables[0], “CategoryID”);

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 66You are creating a Windows Forms application by using the .NET Framework 3.5. You write a code segment toconnect to a Microsoft Access database and populate a DataSet. You need to ensure that the applicationmeets the following requirements:

* It displays all database exceptions.* It logs all other exceptions by using the LogExceptionToFile.Which code segment should you use?

A. try{ categoryDataAdapter.Fill(dsCategory); }catch (SqlException ex){ MessageBox.Show(ex.Message, “Exception”); LogExceptionToFile(ex.Message); }

B. try{ categoryDataAdapter.Fill(dsCategory); }catch (SqlException ex){ MessageBox.Show(ex.Message, “Exception”); }catch (Exception ex){ LogExceptionToFile(ex.Message);}

C. try{ categoryDataAdapter.Fill(dsCategory); }catch (OleDbException ex){ MessageBox.Show(ex.Message, “Exception”); }catch (Exception ex){ LogExceptionToFile(ex.Message);}

D. try{ categoryDataAdapter.Fill(dsCategory); }catch (OleDbException ex){ MessageBox.Show(ex.Message, “Exception”); LogExceptionToFile(ex.Message);}

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 67You are creating a Windows application by using the .NET Framework 3.5. The application is used to scheduleappointments. The application contains a scheduling component that will perform the following tasks:

* Return available appointments.* Add a new appointment to a calendar.* The initial implementation of the scheduling component must be deployed.

You need to recommend a strategy to allow replacement of the scheduling component without changingcompiled code. Which three actions should yourecommend? (Each correct answer presents part of the solution. Choose three.)

A. Use reflection to load the configured type dynamically.B. Specify the implementation type and its assembly in configuration.C. Create an interface that describes the service properties and methods. Create types that implement this

interface.D. Create an attribute for the service, and apply this attribute to all types that provide an implementation.E. Create an attribute for the service. Dynamically discover and load all types by using the attribute.F. Define a generic class that implements the service properties and methods. Create types that inherit from

this generic class, and provide a type parameter.

Correct Answer: ABCSection: (none)Explanation

Explanation/Reference:

QUESTION 68You are creating a Windows Forms application by using the .NET Framework 3.5. You create a new form inyour 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) {0506 }07

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 operationis cancelled.

*Print operations are logged whether or not the user has print access.

What should you do?

A. Add the following code segment at line 05. pntDoc.BeginPrint -= new PrintEventHandler(PrintDoc_BeginPrint); pntDoc.BeginPrint += new PrintEventHandler((obj, args) => args.Cancel = true); Add the following code segment at line 07. pntDoc.BeginPrint += new PrintEventHandler((obj1, args1) => LogPrintOperation());

B. Add the following code segment at line 05. pntDoc.BeginPrint += new PrintEventHandler(delegate(object obj, PrintEventArgs args){}); Add the following code segment at line 07. pntDoc.BeginPrint -= new PrintEventHandler(PrintDoc_BeginPrint); pntDoc.BeginPrint += new PrintEventHandler((obj1, args1) => LogPrintOperation());

C. Add the following code segment at line 05. pntDoc.BeginPrint -= new PrintEventHandler(PrintDoc_BeginPrint); pntDoc.BeginPrint -= new PrintEventHandler(delegate(object obj, PrintEventArgs args){}); Add the following code segment at line 07. pntDoc.BeginPrint -= new PrintEventHandler((obj1, args1) => LogPrintOperation());

D. Add the following code segment at line 05. pntDoc.BeginPrint -= new PrintEventHandler((obj, args) => args.Cancel = true); Add the following code segment at line 07. pntDoc.BeginPrint += new PrintEventHandler(PrintDoc_BeginPrint); pntDoc.BeginPrint -= new PrintEventHandler((obj1, args1) => LogPrintOperation());

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 69You are creating a Windows Forms application by using the .NET Framework 3.5. You create a new form in theapplication. You add a ContextMenuStrip control named ctxMenu to the form. You have a user-defined classnamed CustomControl. You write the following code segment in the application. (Line numbers are included forreference 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 thectxMenu control. Which code segment should you add at line 02?

A. ToolStripControlHost host = new ToolStripControlHost(myControl);ctxMenu.Items.Add(host);B. ToolStripPanel panel = new ToolStripPanel();panel.Controls.Add(myControl);ctxMenu.Controls.Add(panel);C. ToolStripContentPanel panel = new ToolStripContentPanel();panel.Controls.Add

(myControl);ctxMenu.Controls.Add(panel);D. ToolStripMenuItem menuItem = new ToolStripMenuItem();

ToolStripControlHost host = new ToolStripControlHost(myControl); menuItem.DropDownItems.Add(host);ctxMenu.Items.Add(menuItem);

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 70You are creating a Windows Forms application by using the .NET Framework 3.5. The application requires aform to display a clock. You need to create a circular form to display the clock. Which code segment should youuse?

A. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath(); path.AddEllipse(0, 0, this.Width, this.Height); Region reg = new Region();this.Region = reg;

B. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath(); path.AddEllipse(0, 0, this.Width, this.Height); Region reg = new Region(path); this.Region = reg;

C. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath(); path.AddEllipse(0, 0, this.Width, this.Height); Region reg = new Region(path); this.Region = reg;

D. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath(); path.AddEllipse(0, 0, this.Width, this.Height); Region reg = new Region(); this.Region = reg;

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 71You are creating a Windows Forms application by using the .NET Framework 3.5. You plan to deploy theapplication in multiple countries and languages. You need to ensure that the application meets the globalizationrequirements. Which two actions should you perform? (Each correct answer presents part of the solution.Choose two.)

A. Handle server names and URLs as ASCII data.B. Use Unicode strings throughout the application.C. Use the NumberFormatInfo class for numeric formatting.D. Handle strings as a series of individual characters instead of entire strings.E. Avoid usage of the SortKey class and the CompareInfo class for sorting purposes.

Correct Answer: BCSection: (none)Explanation

Explanation/Reference:

QUESTION 72You are creating a Windows Forms application for a courier company by using the .NET Framework 3.5. Youcreate 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?

A. private void txtTN_Validating(object sender, CancelEventArgs e) { if (!ValidTrackingNumber(txtTN.Text)) { errorProvider1.SetError(txtTN, “Invalid Tracking Number”); e.Cancel = true; } else errorProvider1.SetError(txtTN, “”); }

B. private void txtTN_Validating(object sender, CancelEventArgs e) { if (!ValidTrackingNumber(txtTN.Text)) errorProvider1.SetError(txtTN, “Invalid Tracking Number”); else { errorProvider1.SetError(txtTN, “”); e.Cancel = true; } }

C. private void txtTN_Validated(object sender, EventArgs e) { If (!ValidTrackingNumber(txtTN.Text)) errorProvider1.SetError(txtTN, “Invalid Tracking Number”); else { errorProvider1.SetError(txtTN, “”); txtTN.Focus(); } }

D. private void txtTN_Validated(object sender, EventArgs e) { if (!ValidTrackingNumber(txtTN.Text)) { errorProvider1.SetError(txtTN, “Invalid Tracking Number”); txtTN.Focus(); } else errorProvider1.SetError(txtTN, “”); }

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 73ou are creating a multiple-document interface (MDI) application by using the .NET Framework 3.5. Youconfigure the frmParent form to be an MDI parent. You write the following code segment. (Line numbers areincluded 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 youadd at line 03?

A. frmChild.MdiParent = frmParent;frmChild.ShowDialog();B. frmChild.MdiParent = frmParent;frmChild.Show();C. frmChild.IsMdiContainer = true;frmChild.ShowDialog();D. frmChild.IsMdiContainer = true; frmChild.Show();

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 74You are creating a Windows application by using the .NET Framework 3.5. The application retrieves individualproduct details from a database within the network. The product details frequently change. The product detailsavailable to the application can be up to one hour old. The details of a single product can be retrieved multiple times during a single execution of the application. You need to design a caching strategy that uses theminimum amount of network bandwidth. What should you do?

A. Cache all product details in the memory.Retrieve the product details from the cache.Refresh the cacheevery hour.

B. Cache all product details in the memory.Retrieve the product details from the cache.Remove the productdetails from the cache every hour.

C. Retrieve the product details from the cache if they are available in the cache.Retrieve the product detailsfrom the database if they are unavailable in the cache. Then, add the product details to the cache.Refreshthe cache every hour.

D. Retrieve the product details from the cache if they are available in the cache.Retrieve the product detailsfrom the database if they are unavailable in the cache. Then, add the product details to the cache by settingan individual time-out for each product details set.Remove the product details from the cache on time-out.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 75You are creating a Windows application by using the .NET Framework 3.5. The application creates lookupfields by using data from a database within the corporate network. You use the DataAdapter object to retrievedata as a DataSet from the database. You need to reduce the network bandwidth that is used by theapplication. What should you do?

A. Use a DataReader object instead of the DataAdapter object to retrieve data.B. Use a LINQ to SQL query to retrieve data. Defer loading the data until required.C. Create a local database cache in the application by using a Microsoft SQL Server 2008 Compact 3.5

database.D. Create a Windows Communication Foundation (WCF) service to return the data. Use the service from the

application.

Correct Answer: C

Section: (none)Explanation

Explanation/Reference:

QUESTION 76You are creating a Windows application by using the .NET Framework 3.5. The application will retrieve andsave data that is located on the network. The application will be deployed to client computers that retrieve andsave data from a shared location. You need to ensure reliable storage of data. Which data storage mechanismshould you use?

A. XML file in a network file shareB. Microsoft Office Access 2007 database on a network file shareC. Microsoft SQL Server 2008 Express Edition database within the networkD. Microsoft SQL Server 2008 Compact Edition database on a network file share

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 77You create a Windows application by using the .NET Framework 3.5. The application uses a Microsoft SQLServer 2008 database. You discover that the application is non-responsive and performs slowly at certain timesduring the day. Twenty-five additional users are added to the application to meet a deadline. You need toensure that all users experience a consistent level of high application performance throughout the day. Youwant to achieve this goal by using minimum development effort. Which two actions should you perform? (Eachcorrect answer presents part of the solution. Choose two.)

A. Use the CommandBehavior.CloseConnection option and the DataReader objects.B. Perform a stress test on all the components. Change all the components to inherit from the

System.EnterpriseServices.ServicedComponent class.C. Create a Test Harness application to test the serialization of DataSet objects. Serialize multiple versions of

the DataSet objects whenever possible.D. Use the SQL Server Profiler tool to identify functions that call stored procedures in the database. Divide

these functions into multiple queries.E. Create a Test Harness application to test the performance of remoting proxies. Change the remoting

proxies to use the TcpChannel class instead of the HttpChannel class.

Correct Answer: AESection: (none)Explanation

Explanation/Reference:

QUESTION 78You are creating a Windows application by using the .NET Framework 3.5. The application stores data in aMicrosoft SQL Server 2008 database. You discover the following performance issues:

* The application takes a long time to respond.* The application consumes over 900 MB of RAM.

You need to ascertain the reason for the poor performance of the application.What should you do?

A. Use the .NET CLR Profiler tool to identify the objects that cause performance issues.B. Capture information about execution of the application by using the Trace.Write method to identify the

objects that cause performance issues.C. Use the Performance Monitor tool and add the appropriate performance counters to the .NET CLR Memory

performance object.D. Add the debugger display attribute to the functions that access the SQL Server 2008 database. Set a

breakpoint in the application to step through the code.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 79You are creating a Windows application by using the .NET Framework 3.5. An existing application usesfunctionality provided by an unmanaged dynamic-link library (DLL) to validate user inputs. The applicationcontains a wrapper class that uses Platform Invoke to access the required DLL functions. The application hasthe following deployment and security requirements:

* ClickOnce deployment is used to publish the application to an Internet Web site.* The application is available online only.* The application does not require protected storage.* Users can access the application without requiring the elevated permission.

You need to ensure that the deployment and security requirements are met without affecting the applicationvalidation performance. What should you do?

A. Sign the ClickOnce manifest by using a valid Authenticode certificate.B. Eliminate the wrapper class and migrate the code in the DLL to managed code.C. Apply the SuppressUnmanagedCodeSecurityAttribute attribute to the wrapper class.D. Apply the AllowPartiallyTrustedCallersAttribute attribute to the assembly that contains the wrapper class.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 80You create a Windows application by using the .NET Framework 3.5. The application is used for data entrypurposes. The application has the following features:

* Data is read from a shared Microsoft SQL Server 2008 database instance.* Data entered and saved by the users is temporarily stored in a local SQL Server 2008 Compact editiondatabase instance.* When the users log off from the application, new records from the local database instance are synchronizedto the shared database.* You discover that the performance of the application is affected when multiple users log off from theapplication at the same time.

You need to design a performance improvement strategy for the application by using minimum amount of cost,time, and development effort. What should you do?

A. Upgrade the local database to Microsoft SQL Server 2008 Express edition.B. Modify the application to synchronize data into the shared database as soon as the users save their work.C. Write a Web service that synchronizes data to the shared database. Call the service when the users log off

from the application.D. Store the data entered by the users temporarily in an XML file. Merge the new records from the local XML

file to the shared database when the users log off from the application.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 81You create a Windows application by using the .NET Framework 3.5. You review the design for a Windowsapplication that has the following features:

* The data layer sends and receives data updates by using Microsoft Messaging Queue (MSMQ) 4.0.* Data is stored in a Microsoft SQL Server 2008 server database instance.* Data from a DataSet object is displayed in a DataGrid control.* The application is deployed to portable computers that can access the corporate network only when pluggedon to it.* The data must be most securely stored when the computer is in offline mode.

You need to ensure that the portable computers can update data even when offline. What should you do?

A. Change the data layer to use a local XML file instead of MSMQ.B. Change the data layer to use a local data cache along with Microsoft Sync Services instead of MSMQ.C. Create an ASP.NET Web service to receive data updates from the portable computers.D. Create a Windows Communication Foundation (WCF) service to send and receive data updates from the

portable computers.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 82You create a Windows application by using the .NET Framework 3.5. You plan to test the application by using5,000 records in a limited test environment. The application will process 1 million records in a productionenvironment. You need to test the application to identify potential problems that might occur when theapplication is moved to the production environment. Which two actions should you perform? (Each correctanswer presents part of the solution. Choose two.)

A. Test the thread pool usage.B. Test the collection type usage.C. Test the language resource files.D. Test the type of log file encoding.E. Test the number of Microsoft Windows Installer (MSI) files used for deployment.

Correct Answer: AB

Section: (none)Explanation

Explanation/Reference:

QUESTION 83You have developed a console application by using the Microsoft .NET Framework 1.1. The console applicationuses a set of assemblies for the business logic and the data layer. You plan to convert the console applicationto a Windows Forms application. You need to design a conversion strategy by using minimum amount of timeand development effort. What should you do?

A. Convert the console application and all the data layer assemblies to the .NET Framework 3.5.B. Convert the console application to the .NET Framework 3.5 by using the conversion wizard of Microsoft

Visual Studio .NET 2008.C. Upgrade the business logic and the data layer assemblies to the .NET Framework 3.5. Convert the console

application to Windows Forms.D. Retain the business logic and the data layer assemblies as the .NET Framework 1.1 assemblies. Convert

the console application to Windows Forms.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

http://www.gratisexam.com/