MCSD-Microsoft Certified Solutions Developer Questions

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

0 2264
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 manage customer and related order records. You add a new order for an existing customer. You need to associate the Order entity with the Customer entity. What should you do?

A) Set the Value property of the EntityReference of the Order entity. B) Call the Add method on the EntityCollection of the Order entity.
C) Use the AddObject method of the ObjectContext to add both Order and Customer entities. D) Use the Attach method of the ObjectContext to add both Order and Customer entities.
 
Answer & Explanation Answer: A) Set the Value property of the EntityReference of the Order entity.

Explanation:
Report Error

View Answer Report Error Discuss

0 2190
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

0 2149
Q:

You are creating an ASP.NET page for a travel service. The page contains a CheckBoxList control that contains travel destinations. Customer can select favorite destinations to receive weekly e-mail updates of travel packages.

 

The CheckBoxList control is bound to a database table of possible destinations. Each destination is ranked according to its popularity. You modify the page to sort the destination list by rank, from the most popular to the least popular. The list has three columns.

 

You want the most popular destination to be on the top row of the check box list at run time. Which property setting should you use for the CheckBoxList control?

A) Set the RepeatDirection property to Vertical. B) Set the RepeatDirection property to Horizontal.
C) Set the RepeatLayout property to Flow. D) Set the RepeatLayout property to Table.
 
Answer & Explanation Answer: B) Set the RepeatDirection property to Horizontal.

Explanation:

The DataList.RepeatDirection property is used to get or select whether the DataList control displays vertically or horizontally. If this property is set to RepeatDirection.Horizontal, the items in the list are displayed in rows loaded from left to right, then top to bottom, until all items are rendered.

 

Incorrect Answers:

A: If the DataList.RepeatDirection property is set to RepeatDirection.Vertical, the items in the list are displayed in columns loaded from top to bottom, then left to right, until all items are rendered.


C, D:DataList.RepeatLayout Property gets or sets whether the control is displayed in a table or flow layout. It does not affect the order in which the items are displayed.

Report Error

View Answer Report Error Discuss

0 2057
Q:

You are creating an ASP.NET page for selling movie tickets. Users select a region, and then they select from a list of cities in that region. The site displays the names and locations of movie theaters in the city selected by the user.


Your company, XYZ Brothers, maintains a list of theaters in a database table that includes the city, name, and street address of each theater. You want to minimize the time required to retrieve and display the list of theater names after a user selects the region and city.

 

 What should you do?

A) Modify the connection string to add the packet size property and set its values to 8192. B) Add the following directive to the page: OutputCache VaryByParam=?
C) Add the following directive to the page: OutputCache VaryByControl=?region;city? D) Modify the connection string to keep your database's connection pool as small as possible.
 
Answer & Explanation Answer: B) Add the following directive to the page: OutputCache VaryByParam=?

Explanation:

You can vary user control output to the cache by specifying the user control name and the parameter. We use the VaryByParam attribute of the  OutputCache  

 

Incorrect Answers: 

 

A: The Packet Size property of the Connection string is the size in bytes of the network packets sed to communicate with an instance of data provider. It is not an optimal property to change to optimize data retrieval.

 

C: The company database does not seem to include a region column.

 

D: If we keep the connection pool small we would allow less simulation connections. However, this would not minimize the required to retrieve and display the data.

Report Error

View Answer Report Error Discuss

0 2029
Q:

You ASP.NET application manages order entry data by using a DataSet object named EXorderEntry. The EXorderEntry object includes two DataTable objects named orderNames and OrderDetails. A ForeignKeyConstraint object named orderDetailsKey is defined between the two DataTable objects.


You attempt to delete a row in orderNames while there are related rows in OrderDetails, and an exception is generated.What is the most likely cause of the problem?

A) The current value of OrderDetails.KeyDeleteRule is Rule.Cascade. B) The current value of OrderDetails.KeyDeleteRule is Rule.SetNull.
C) The current value of OrderDetails.KeyDeleteRule is Rule.SetDefault. D) The current value of OrderDetails.KeyDeleteRule is Rule.None.
 
Answer & Explanation Answer: D) The current value of OrderDetails.KeyDeleteRule is Rule.None.

Explanation:

The rule enumeration indicates the action that occurs when a ForeignKeyConstraint is enforced.None specifies that no action will occur, but exceptions are generated. This is what has occurred in this scenario.

 

Incorrect Answers:

 

A: Cascade specifies that all rows containing that value are also deleted.

B: SetNull specifies that values in all child columns are set to null values.

C: SetDefault specifies that all child columns be set to the default value for the column.

Report Error

View Answer Report Error Discuss

0 2004
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

0 1945
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

0 1868