0
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:   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.

Q:

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You use the ADO.NET Entity Data Model (EDM) to define a Customer entity. You need to add a new Customer to the data store without setting all the customer's properties. What should you do?

A) Call the Create method of the Customer object. B) Call the CreateObject method of the Customer object.
C) Override the Create method for the Customer object. D) Override the SaveChanges method for the Customer object.
 
Answer & Explanation Answer: B) Call the CreateObject method of the Customer object.

Explanation:
Report Error

View Answer Report Error Discuss

0 2370
Q:

You use Microsoft Visual Studio 2010 and Microsoft ADO.NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008 database. You use the ADO.NET LINQ to SQL model to retrieve data from the database. You use stored procedures to return multiple result sets. You need to ensure that the result sets are returned as strongly typed values. What should you do?

A) Apply the FunctionAttribute and ResultTypeAttribute to the stored procedure function. Use the GetResult B) Apply the FunctionAttribute and ParameterAttribute to the stored procedure function and directly access the strongly typed object from the results collection.
C) Apply the ResultTypeAttribute to the stored procedure function and directly access the strongly typed object from the results collection. D) Apply the ParameterAttribute to the stored procedure function. Use the GetResult
 
Answer & Explanation Answer: A) Apply the FunctionAttribute and ResultTypeAttribute to the stored procedure function. Use the GetResult

Explanation:
Report Error

View Answer Report Error Discuss

0 2286
Q:

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an
application. You use the ADO.NET Entity Framework to model entities. You write the following code segment. (Line numbers are included for reference only.)


01AdventureWorksEntities context = New AdventureWorksEntities
02
03var q = from c in context.Customers
04where c.City == "London"
05orderby c.CompanyName
06select c;


You need to ensure that the application meets the following requirements: "Compares the current values of unmodified properties with values returned from the data source". Marks the property as modified when the properties are not the same. Which code segment should you insert at line 02?

A) context.MergeOption = MergeOption.AppendOnly; B) context.MergeOption = MergeOption.PreserveChanges;
C) context.MergeOption = MergeOption.OverwriteChanges; D) context.MergeOption = MergeOption.NoTracking;
 
Answer & Explanation Answer: B) context.MergeOption = MergeOption.PreserveChanges;

Explanation:
Report Error

View Answer Report Error Discuss

0 2730
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 stores encrypted credit card numbers in the database. You need to ensure that credit card numbers can be extracted from the database.
Which cryptography provider should you use?

A) DSACryptoServiceProvider B) AESCryptoServiceProvider
C) MD5CryptoServiceProvider D) SHA1CryptoServiceProvider
 
Answer & Explanation Answer: B) AESCryptoServiceProvider

Explanation:
Report Error

View Answer Report Error Discuss

0 2522
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 2031
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 2044
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

0 2494
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 1962