Free MCSD MCQ Questions and Answers — Questions and Answers
Question 1: To give XYZ's workers company news and information, you develop an ASP.NET application. Employees in New Zealand using the app. <br> <br> CurrentDateLabel is the name of a Web Form label control on Default.aspx. The next piece of code was included in the Default.aspx Page.Load event handler: currentDateLabel. Text equals DateTime.Now. ToString(“D”) <br> <br> For workers in New Zealand, you must make sure that the data is shown accurately. What ought you to do?
- In the Web.config file for the application, set the uiCulture attribute of the globalization element to en-NZ.
- In the Web.config file for the application, set the culture attribute of the globalization element to en-NZ (Correct answer)
- 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.
- In Visual Studio .NET, set the responseEncoding attribute in the page directive for Default.aspx to UTF-8.
Correct answer: In the Web.config file for the application, set the culture attribute of the globalization element to en-NZ
The default culture for handling incoming Web requests is specified by the globalization element's culture property.
Question 2: You use Microsoft Visual Studio 2010 and Microsoft.NET Framework 4 to construct an application. The application accesses a database hosted by Microsoft SQL Server. Credit card information is encrypted and kept in the database by the program. Make sure the database can be used to retrieve credit card numbers. <br> <br> Which cryptography provider should you use?
- SHA1CryptoServiceProvider
- DSACryptoServiceProvider
- AESCryptoServiceProvider (Correct answer)
- MD5CryptoServiceProvider
Correct answer: AESCryptoServiceProvider
AES is a strong symmetric encryption algorithm, so AESCryptoServiceProvider both encrypts and decrypts the credit card numbers, allowing them to be retrieved. SHA1 and MD5 are one-way hash functions (data can't be recovered), and DSA is for digital signatures, not reversible encryption.
Question 3: You use Microsoft Visual Studio 2010 and Microsoft.NET Framework 4 to construct an application. You define a Customer entity using the ADO.NET Entity Data Model (EDM). Without configuring all of the customer's properties, you must add a new Customer to the data store. What ought you to do?
- Call the CreateObject method of the Customer object (Correct answer)
- Call the Create method of the Customer object
- Override the SaveChanges method for the Customer object
- Override the Create method for the Customer object
Correct answer: Call the CreateObject method of the Customer object
In the ADO.NET Entity Data Model, the generated CreateObject (factory) method creates a new entity instance without forcing you to set all of its properties up front. Create/SaveChanges overrides are not the designed way to instantiate a new entity, so they don't satisfy the requirement.
Question 4: To construct an application, you require Microsoft Visual Studio 2010 and Microsoft ADO.NET Framework 4. A database running on Microsoft SQL Server 2008 is connected by the application. To get data out of the database, you utilize the ADO.NET LINQ to SQL paradigm. To return numerous result sets, you employ stored processes. The return of the result sets as strongly typed values must be ensured. What ought you to do?
- Apply the ParameterAttribute to the stored procedure function. Use the GetResult
- Apply the ResultTypeAttribute to the stored procedure function and directly access the strongly typed object from the results collection
- Apply the FunctionAttribute and ParameterAttribute to the stored procedure function and directly access the strongly typed object from the results collection
- Apply the FunctionAttribute and ResultTypeAttribute to the stored procedure function. Use the GetResult (Correct answer)
Correct answer: Apply the FunctionAttribute and ResultTypeAttribute to the stored procedure function. Use the GetResult
Applying FunctionAttribute and ResultTypeAttribute to the stored-procedure method defines its mapping and the strongly typed shape of the returned result sets, and GetResult retrieves each typed set. ParameterAttribute only maps input parameters, and omitting ResultTypeAttribute means the results aren't strongly typed.
Question 5: You are a member of a development team working on several ASP.NET applications for XYZ. You want to create a reusable toolbar that can be applied to all programs. The toolbar will always be visible at the top of every page the user visits. <br> <br> The choices each user makes while establishing a profile will affect the toolbar's options. <br> <br> Each developer on your team needs to be able to add the toolbar to their ASP.NET toolbox. What ought you to do?
- Add a new Web user control to your ASP.NET project. Create the toolbar within the Web user control
- Create a new Web Control Library project. Create the toolbar within a Web custom control (Correct answer)
- Add a new component class to your ASP.NET project. Design the toolbar within the designer of the component class
- 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
Correct answer: Create a new Web Control Library project. Create the toolbar within a Web custom control
To create a reusable control that developers can drop onto the ASP.NET toolbox and share across multiple applications, you build it as a Web custom control in a Web Control Library project, which compiles to a redistributable assembly. A Web user control (.ascx) is tied to a single project and can't be added to the toolbox for reuse the same way.
Question 6: To construct an application, you utilize Microsoft Visual Studio 2010 and Microsoft.NET Framework 4. The ADO.NET Entity Framework is used by the application to maintain customer and associated order records. You add a fresh order for a current client. The Order entity and the Customer entity must be linked. What ought you to do?
- Use the AddObject method of the ObjectContext to add both Order and Customer entities
- Set the Value property of the EntityReference of the Order entity (Correct answer)
- Call the Add method on the EntityCollection of the Order entity
- Use the Attach method of the ObjectContext to add both Order and Customer entities
Correct answer: Set the Value property of the EntityReference of the Order entity
Set the Entity's Value property. An entity reference for the Order.
Question 7: To develop a Windows Communication Foundation (WCF) Data Services service, you utilize Microsoft Visual Studio 2010 and Microsoft.NET Framework 4. You find out that an application encounters an error when it sends a PUT or DELETE request to the Data Services service. Make that the application can connect to the service. What request type and header should you use in the application?
- An HTTP ContentType header as part of a GET request
- An X-HTTP-Method header as part of a POST request (Correct answer)
- An X-HTTP-Method header as part of a GET request
- An HTTP ContentType header as part of a POST request
Correct answer: An X-HTTP-Method header as part of a POST request
Some proxies, firewalls, and older clients block PUT and DELETE verbs, so WCF Data Services supports tunneling them through a POST request using the X-HTTP-Method header to indicate the intended verb. A GET request or a ContentType header would not carry or trigger the PUT/DELETE operation.
To give XYZ's workers company news and information, you develop an ASP.NET application.
Employees in New Zealand using the app.
CurrentDateLabel is the name of a Web Form label control on Default.aspx.
The next piece of code was included in the Default.aspx Page.Load event handler: currentDateLabel.
Text equals DateTime.Now.
ToString(“D”)
For workers in New Zealand, you must make sure that the data is shown accurately.
What ought you to do?