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


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

  • Correct Answer
  • Call the CreateObject method of the Customer object. 


  • Microsoft Certification problems


    Search Results


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

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

    • Options
    • A. context.MergeOption = MergeOption.AppendOnly;
    • B. context.MergeOption = MergeOption.PreserveChanges;
    • C. context.MergeOption = MergeOption.OverwriteChanges;
    • D. context.MergeOption = MergeOption.NoTracking;
    • Discuss
    • 3. 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
    • 4. 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
    • 5. 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
    • 6. You are a developer for a XYZ Inc that provides free software over the Internet. You are developing en e-mail application that users all over the world can download. The application displays text strings in the user interface. At run time, these text strings must appear in the language that is appropriate to the locale setting of the computer running the application. You have resources to develop versions of the application for only four different cultures.You must ensure that your application will also be usable by people of other cultures. How should you prepare the application for deployment?

    • Options
    • A. Package a different assembly for each culture.
    • B. Package a different executable file for each culture.
    • C. Package a main assembly for source code and the default culture. Package satellite assemblies for the other cultures.
    • D. Package a main assembly for source code. Package satellite assemblies for each culture.
    • Discuss
    • 7. You work as software developer at XYZ inc. You need to develop a Windows form that provides online help for users. You want the help functionality to be available when users press the F1 key. Help text will be displayed in a pop-up window for the text box that has focus. To implement this functionality, you need to call a method of the HelpProvider control and pass the text box and the help text. What should you do?

    • Options
    • A. SetShowHelp
    • B. SetHelpString
    • C. SetHelpKeyword
    • D. ToString
    • Discuss
    • 8. You develop a Windows-based application that enables to enter product sales. You add a subroutine named XYZ. You discover that XYZ sometimes raises an IOException during execution. To address this problem you create two additional subroutines named LogError and CleanUp. These subroutines are governed by the following rules: ? LogError must be called only when XYZ raises an exception. ? CleanUp must be called whenever XYZ is complete. You must ensure that your application adheres to these rules. Which code segment should you use?

    • Options
    • A. try { XYZ(); LogError(); } catch (Exception e) { CleanUp(e); }
    • B. try { XYZ(); } catch (Exception e) { LogError(e); CleanUp(); }
    • C. try { XYZ(); } catch (Exception e) { LogError(e); } finally { CleanUp(); }
    • D. try { XYZ(); } catch (Exception e) { CleanUp(e); } finally { LogError(); }
    • Discuss
    • 9. You responsible for maintaining an application that was written by a former colleague at XYZ. The application reads from and writes to log files located on the local network. The original author included the following debugging code to facilitate maintenance: try { Debug.WriteLine(?Inside Try?); throw(new IOException());} catch (IOException e) { Debug.WriteLine (?IOException Caught?);} catch (Exception e) { Debug.WriteLine(?Exception Caught?);}. finally { Debug.WriteLine (?Inside Finally?);} Debug.WriteLine (?After End Try?); Which output is produced by thus code?

    • Options
    • A. Inside Try Exception Caught IOException Caught Inside Finally After End Try
    • B. Inside Try Exception Caught Inside Finally After End Try
    • C. Inside Try IOException Caught Inside Finally After End Try
    • D. Inside Try IOException Caught Inside Finally
    • Discuss
    • 10. You use Visual Studio .NET to create a Windows-based application. The application includes a form named XYZProcedures (EXP). EXP allows users to enter very lengthy text into a database. When users click the Print button located on EXP, this text must be printed by the default printer. You implement the printing functionality by using the native .NET System Class Libraries with all default settings. Users report that only the first page of the text is being printed. How should you correct this problem?

    • Options
    • A. In the BeginPrint event, set the HasMorePages property of the PrintEventArgs object to True.
    • B. In the EndPrint event, set the HasMorePages property of the PrintEventArgs object to True.
    • C. In the PrintPage event, set the HasMorePages property of the PrintPageEventArgs object to True.
    • D. In the QueryPageSettings event, set the HasMorePages property of the QueryPageSettingEventArgs object to True.
    • Discuss


    Comments

    There are no comments.

Enter a new Comment