logo

CuriousTab

CuriousTab

Discussion


Home Certification Microsoft Certification Comments

  • Question
  • 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?


  • Options
  • 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);

  • Correct Answer
  • var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess); 


  • Microsoft Certification problems


    Search Results


    • 1. 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?

    • Options
    • 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.
    • Discuss
    • 2. You create English, French, and German versions of a test engine ASP.NET application you are developing for XYZ Inc. You have separate resource files for each language version.You need to deploy the appropriate resource file based on the language settings of the server. What should you do?

    • Options
    • A. Create an installer and set the Installer.Context property for each version of your application.
    • B. Create an installer that has a launch condition to verify the locale settings.
    • C. Create an installer that has a custom action to install only location-specific files.
    • D. Create an installer that has an MsiConfigureProduct function to install the appropriate version.
    • Discuss
    • 3. 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?

    • Options
    • 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.
    • Discuss
    • 4. 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?

    • Options
    • 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.
    • Discuss
    • 5. 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?

    • Options
    • 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.
    • Discuss
    • 6. 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?

    • Options
    • 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
    • Discuss
    • 7. 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?

    • Options
    • 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.
    • Discuss
    • 8. 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?

    • Options
    • A. ordersFK.DeleteRule = Rule.SetNull;
    • B. ordersFK.DeleteRule = Rule.None;
    • C. ordersFK.DeleteRule = Rule.SetDefault;
    • D. ordersFK.DeleteRule = Rule.Cascade;
    • Discuss
    • 9. 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?

    • Options
    • 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.
    • Discuss
    • 10. 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?

    • Options
    • A. DSACryptoServiceProvider
    • B. AESCryptoServiceProvider
    • C. MD5CryptoServiceProvider
    • D. SHA1CryptoServiceProvider
    • Discuss


    Comments

    There are no comments.

Enter a new Comment