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 2465
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 2315
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 2276
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 2143
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 2143
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 2138
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 2035
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

1 1966