Searching for "he"

Q:

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an
application. The application connects to a Microsoft SQL Server database. The application has two DataTable objects that reference the Customers and Orders tables in the database. The application contains the following code segment. (Line numbers are included for reference only.)


01DataSet customerOrders = new DataSet();
02customerOrders.EnforceConstraints = true;
03ForeignKeyConstraint ordersFK = new ForeignKeyConstraint("ordersFK",
04customerOrders.Tables["Customers"].Columns["CustomerID"],
05customerOrders.Tables["Orders"].Columns["CustomerID"]);
06
07customerOrders.Tables["Orders"].Constraints.Add(ordersFK);


You need to ensure that an exception is thrown when you attempt to delete Customer records that have related Order records. Which code segment should you insert at line 06?

A) ordersFK.DeleteRule = Rule.SetNull; B) ordersFK.DeleteRule = Rule.None;
C) ordersFK.DeleteRule = Rule.SetDefault; D) ordersFK.DeleteRule = Rule.Cascade;
 
Answer & Explanation Answer: B) ordersFK.DeleteRule = Rule.None;

Explanation:
Report Error

View Answer Report Error Discuss

Q:

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application uses the ADO.NET Entity Framework to model entities. The application allows users to make changes to entities while disconnected from the central data store.

 

You need to ensure that when the user connects to the central data store and retrieves new data, the application meets the following requirements:

  • Changes made to the local data store in disconnected mode are preserved.
  • Entities that have already been loaded into the local data store, but have not been modified by the user, are updated with the latest data.

What should you do?

A) Call the query's Execute method by using the MergeOptions.AppendOnly option. B) Call the query's Execute method by using the MergeOptions.OverwriteChanges option.
C) Call the Refresh method of ObjectContext by using the RefreshMode.StoreWins option. D) Call the Refresh method of ObjectContext by using the RefreshMode.ClientWins method.
 
Answer & Explanation Answer: D) Call the Refresh method of ObjectContext by using the RefreshMode.ClientWins method.

Explanation:
Report Error

View Answer Report Error Discuss

Q:

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Communication Foundation (WCF) Data Services service. You discover that when an application submits a PUT or DELETE request to the Data Services service, it receives an error. You need to ensure that the application can access the service. Which header and request type should you use in the application?

A) an X-HTTP-Method header as part of a POST request B) an X-HTTP-Method header as part of a GET request
C) an HTTP ContentType header as part of a POST request D) an HTTP ContentType header as part of a GET request
 
Answer & Explanation Answer: A) an X-HTTP-Method header as part of a POST request

Explanation:
Report Error

View Answer Report Error Discuss

Q:

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an
application. The application connects to a Microsoft SQL Server 2008 database. The database includes a table named dbo.


Documents that contains a column with large binary dat a. You are creating the Data Access Layer (DAL). You add the following code segment to query the dbo.Documents table. (Line numbers are included for reference only.)


01public void LoadDocuments(DbConnection cnx)
02{
03var cmd = cnx.CreateCommand();
04cmd.CommandText = "SELECT * FROM dbo.Documents";
05...
06cnx.Open();
07
08ReadDocument(reader); }


You need to ensure that data can be read as a stream. Which code segment should you insert at line 07?

A) var reader = cmd.ExecuteReader(CommandBehavior.Default); B) var reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly);
C) var reader = cmd.ExecuteReader(CommandBehavior.KeyInfo); D) var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess);
 
Answer & Explanation Answer: D) var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess);

Explanation:
Report Error

View Answer Report Error Discuss

Q:

You plan to deploy your ASP.NET application over XYZ’s intranet. The application uses data retrieved from a Microsoft SQL Server database. You want to use SQL Server connection pooling to optimize performance. You also need to protect confidential data stored on the server while minimizing administrative costs.

 

You need to configure security for your application. What should you do?

A) Use Microsoft Windows authentication in the application. Enable impersonation for users to access the SQL Server database from your application. B) Use Microsoft Windows authentication in the application. Use a single Windows account for users to access the SQL Server database from your application.
C) Use form-based authentication in the application. Use the system administrator (sa) SQL Server login for users to access the SQL Server database from your application. D) Use form-based authentication in the application. Assign each user a separate SQL Server login to use to access the SQL Server database from your application.
 
Answer & Explanation Answer: B) Use Microsoft Windows authentication in the application. Use a single Windows account for users to access the SQL Server database from your application.

Explanation:

We should only use one account to access the SQL Server database. This ensures that connection pooling is optimized.

 

Incorrect Answers:

A: We should only use a single account to access the SQL Server database.

C: Form-based authentication is less secure. Furthermore, running as the System Administrator with the sa login would compromise security.

D: Form-based authentication is less secure. Furthermore, creating a separate SQL Server login for each user is a daunting administrative task.

Report Error

View Answer Report Error Discuss

Q:

You create English, French, and German versions of a test engine ASP.NET application you are developing for XYZ Inc. You have separate resource files for each language version.You need to deploy the appropriate resource file based on the language settings of the server. What should you do?

A) Create an installer and set the Installer.Context property for each version of your application. B) Create an installer that has a launch condition to verify the locale settings.
C) Create an installer that has a custom action to install only location-specific files. D) Create an installer that has an MsiConfigureProduct function to install the appropriate version.
 
Answer & Explanation Answer: C) Create an installer that has a custom action to install only location-specific files.

Explanation:

Custom actions are a Windows Installer feature that allows you to run code at the end of an installation to perform actions that cannot be handled during installation. This is an appropriate solution for this scenario as we only want to deploy the resource files on the server. 

 

Incorrect Answers:

 

A: We just want to deploy the resource files. We do not need to set the Context property in the application.

 

B: We don’t need any launch conditions. We just want to deploy the resource files.

 

D: We just want to deploy the resource files.

Report Error

View Answer Report Error Discuss

Q:

You are creating an ASP.NET application for XYZ. The company data is stored in a Microsoft SQL Server 6.5 database. Your application generates accounting summary reports based on transaction tables that contain million of rows.


You want your application to return each summary report as quickly as possible. You need to configure your application to connect to the database and retrieve the data in a away that achieves this goal.


What should you do?

A) Use a SqlConnection object to connect to the database, and use a SqlCommand object to run a stored procedure that returns the data. B) Use an OleDbConnection object to connect to the database, and use an OleDbCommand object to run a stored procedure that returns the data.
C) Configure SQL Server to support HTTP access, and create an XML template to run a stored procedure that returns the data in XML format. D) Use COM interop to create an ADODB.Connection object, and use an ADODB.Command object to run a SQL statement that returns the data.
 
Answer & Explanation Answer: B) Use an OleDbConnection object to connect to the database, and use an OleDbCommand object to run a stored procedure that returns the data.

Explanation:

We need to use an OleDBConnection to connect to SQL Server Version 6.5 (or earlier). 

 

Incorrect Answers:

 

A: We could use a SqlConnection object only if the SQL Server were SQL Server 7.0, 2000 or later.

 

C: HTTP functionality is not required in this scenario. It would introduce unnecessary overhead.

 

D: ADODB is a legacy standard and should not be used here

Report Error

View Answer Report Error Discuss

Q:

You create an ASP.NET page that uses images to identify areas where a user can click to initiate actions. The users of the application use Internet Explorer.


You want to provide a pop-up window when the user moves the mouse pointer over an image. You want the pop-up window to display text that identifies the action that will be taken if the user clicks the image.


What should you do?

A) For each image, set the AlternateText property to specify the text you want to display, and set the ToolTip property to True. B) For each image, set the ToolTip property to specify the text you want to display.
C) In the onmouseover event handler for each image, add code that calls the RaiseBubbleEvent() method of the System.Web.UI.WebControls.Image class. D) In the onmouseover event handler for each image, add code that calls the ToString() method of the System.Web.UI.WebControls.Image class.
 
Answer & Explanation Answer: B) For each image, set the ToolTip property to specify the text you want to display.

Explanation:

WebControl.ToolTip property gets or sets the text displayed when the mouse pointer hovers over the Web server control. The use of the ToolTip property meets the requirement of this scenario.

 

Incorrect Answers:

A: The AlternateText property is used to specify the text to display if the image is not available.


C: The RaiseBubbleEvent is not useful here. ASP.NET server controls such as the Repeater, DataList and DataGrid Web controls can contain child controls that raise events. Rather than each button raising an event individually, events from the nested controls are "bubbled"—that is, they are sent to the control's parent.


D: The ToStringMethod() would not by itself provide the functionality required.

Report Error

View Answer Report Error Discuss