MCSD-Microsoft Certified Solutions Developer Questions

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 2731
Q:

You create an ASP.NET application to provide corporate news and information to XYZ’s employees. The application is used by employees in New Zealand.


Default.aspx has a Web Form label control named currentDateLabel. The Page.Load event handler for Default.aspx included the following line of code:
currentDateLabel.Text = DateTime.Now.ToString(“D”)


You need to ensure that the data is displayed correctly for employees in New Zealand. What should you do?

A) In the Web.config file for the application, set the culture attribute of the globalization element to en-NZ. B) In the Web.config file for the application, set the uiCulture attribute of the globalization element to en-NZ.
C) In Visual Studio .NET, set the responseEncoding attribute in the page directive for Default.aspx to UTF-8. D) In Visual Studio .NET, save the Default.aspx page for both versions of the application by selecting Advanced Save Options from the File menu and selecting UTF-8.
 
Answer & Explanation Answer: A) In the Web.config file for the application, set the culture attribute of the globalization element to en-NZ.

Explanation:

The culture attribute of the globalization element specifies the default culture for processing incoming Web requests.

 

Incorrect Answers:

 

B: The uiculture attribute of the globalization specifies the default culture for processing locale dependent resource searches. It does not apply in this scenario.

 

C, D: The UTF8Encoding Class class encodes Unicode characters using UCS Transformation Format, 8-bit form (UTF-8). This encoding supports all Unicode character values and surrogates. However, it does not help in displaying data in New Zealand format.

Report Error

View Answer Report Error Discuss

0 2693
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 2523
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 2495
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 2373
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

0 2298
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 2287
Q:

You are a member of a team of developers creating several ASP.NET applications for XYZ. You want to create a reusable toolbar that will be used in each of the applications. The toolbar will be displayed at the top of each page viewed by the user.


The contents of the toolbar will vary depending on options each user selects when creating a profile.


You want to be able to add the toolbar to the ASP.NET toolbox for each of the developers on your team.What should you do?

A) Create a new Web Control Library project. Create the toolbar within a Web custom control. B) Add a new Web user control to your ASP.NET project. Create the toolbar within the Web user control.
C) Add a new Web Form to your ASP.NET project. Design the toolbar within the Web Form and save the Web Form with an .ascx extension. D) Add a new component class to your ASP.NET project. Design the toolbar within the designer of the component class.
 
Answer & Explanation Answer: A) Create a new Web Control Library project. Create the toolbar within a Web custom control.

Explanation:

Web custom controls are compiled code, which makes them easier to use but more difficult to create. You can add a Web custom control to the Toolbox and display it in a visual designer with full Properties window support and all the other design-time features of ASP.NET server controls. 

 

Incorrect Answers:

B: Web user controls are easy to make, but they can be less convenient to use in advanced scenarios such as this. Because Web user controls are compiled dynamically at run time they cannot be added to the Toolbox


C: A Web form would be inadequate.

 

D: The Component class Provides the base implementation for the IComponent interface and enables object-sharing between applications. It does not fit in this scenario.

Report Error

View Answer Report Error Discuss

2 2188