MICROSOFT MCPD 70-516

Document Sample
MICROSOFT MCPD 70-516 Powered By Docstoc
					                          MCPD EXAM 70-516
           TS: Accessing Data with Microsoft .NET Framework 4 (C# and VB)

         http://www.certificationtutorials.com/microsoft/70-516-exam.htm




For interactive and self-paced preparation of exam 70-516, try our practice exams.
Practice exams also include self assessment and reporting features          http://www.certificationtutorials.com
                                                                                                                    1
       Question: 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?

       A. Apply the FunctionAttribute and ResultTypeAttribute to the stored procedure function. Use the
       GetResult<TElement> method to obtain an enumerator of the correct type.
       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<TElement> method to
       obtain an enumerator of the correct type.

                                                                                        Answer: A



       Question: 2.


       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<TElement> method to obtain an enumerator of the correct type.
       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<TElement> method to
       obtain an enumerator of the correct type.

                                                                                        Answer: A




For interactive and self-paced preparation of exam 70-516, try our practice exams.
Practice exams also include self assessment and reporting features          http://www.certificationtutorials.com
                                                                                                                       2
       Question: 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 uses the ADO.NET LINQ to SQL
       model to retrieve data from the database. The application will not modify retrieved data. You need to ensure
       that all the requested data is retrieved. You want to achieve this goal using the minimum amount of
       resources. What should you do?

       A. Set ObjectTrackingEnabled to true on the DataContext class.
       B. Set ObjectTrackingEnabled to false on the DataContext class.
       C. Set DeferredLoadingEnabled to true on the DataContext class.
       D. Set DeferredLoadingEnabled to false on the DataContext class.

                                                                                        Answer: B



       Question: 4.


       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 uses the ADO.NET LINQ to SQL
       model to retrieve data from the database. The application will not modify retrieved data. You need to ensure
       that all the requested data is retrieved. You want to achieve this goal using the minimum amount of
       resources. What should you do?

       A. Set ObjectTrackingEnabled to true on the DataContext class.
       B. Set ObjectTrackingEnabled to false on the DataContext class.
       C. Set DeferredLoadingEnabled to true on the DataContext class.
       D. Set DeferredLoadingEnabled to false on the DataContext class.

                                                                                        Answer: B



       Question: 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. You use the ADO.NET LINQ to SQL model to retrieve
       data from the database. The application contains the Category and Product entities, as shown in the following
       exhibit. You need to ensure that LINQ to SQL executes only a single SQL statement against the database. You
       also need to ensure that the query retrieves the list of categories and the list of products. Which code
       segment should you use?


For interactive and self-paced preparation of exam 70-516, try our practice exams.
Practice exams also include self assessment and reporting features          http://www.certificationtutorials.com
                                                                                                                       3
       A. using (NorthwindDataContext dc = new NorthwindDataContext())
       {
       dc.ObjectTrackingEnabled = false;
       var categories = from c in dc.Categories
       select c;
       foreach (var category in categories)
       {
       Console.WriteLine("{0} has {1} products", category.CategoryName, category.Products.Count);
       }
       }
       B. using (NorthwindDataContext dc = new NorthwindDataContext())
       {
       dc.DeferredLoadingEnabled = false;
       DataLoadOptions dlOptions = new DataLoadOptions();
       dlOptions.LoadWith<Category>(c => c.Products);
       dc.LoadOptions = dlOptions;
       var categories = from c in dc.Categories
       select c;
       foreach (var category in categories)
       {
       Console.WriteLine("{0} has {1} products", category.CategoryName, category.Products.Count);
       }
       }
       C. using (NorthwindDataContext dc = new NorthwindDataContext())
       {
       dc.DeferredLoadingEnabled = false;
       var categories = from c in dc.Categories
       select c;
       foreach (var category in categories)
       {
       Console.WriteLine("{0} has {1} products", category.CategoryName, category.Products.Count);
       }
       }
       D. using (NorthwindDataContext dc = new NorthwindDataContext())
       {
       dc.DeferredLoadingEnabled = false;
       DataLoadOptions dlOptions = new DataLoadOptions();
       dlOptions.AssociateWith<Category>(c => c.Products);
       dc.LoadOptions = dlOptions;
       var categories = from c in dc.Categories
       select c;
       foreach (var category in categories)
       {
       Console.WriteLine("{0} has {1} products", category.CategoryName, category.Products.Count);
       }
       }
                                                                                        Answer: B



For interactive and self-paced preparation of exam 70-516, try our practice exams.
Practice exams also include self assessment and reporting features          http://www.certificationtutorials.com
                                                                                                                    4
       Question: 6.

       You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
       application connects to a Microsoft SQL Server database. You use the ADO.NET LINQ to SQL model to retrieve
       data from the database. The application contains the Category and Product entities, as shown in the following
       exhibit. You need to ensure that LINQ to SQL executes only a single SQL statement against the database. You
       also need to ensure that the query retrieves the list of categories and the list of products. Which code
       segment should you use?

       A. Using dc As New NorthwindDataContext()
       dc.ObjectTrackingEnabled = False
       Dim categories As var = From c In dc.Categories _
       Select c
       For Each category As var In categories
       Console.WriteLine("{0} has {1} products", category.CategoryName, category.Products.Count)
       Next
       End Using
       B. Using dc As New NorthwindDataContext()
       dc.DeferredLoadingEnabled = False
       Dim dlOptions As New DataLoadOptions()
       dlOptions.LoadWith(Of Category)(Function(c As ) c.Products)
       dc.LoadOptions = dlOptions
       Dim categories As var = From c In dc.Categories _
       Select c
       For Each category As var In categories
       Console.WriteLine("{0} has {1} products", category. CategoryName, category.Products.Count)
       Next
       End Using
       C. Using dc As New NorthwindDataContext()
       dc.DefferredLoadingEnabled = False
       Dim categories As var = From c In dc.Categories _
       Select c
       For Each category As var In categories
       Console.WriteLine("{0} has {1} products", category.CategoryName, category.Products.Count)
       Next
       End Using
       D. Using dc As New NorthwindDataContext()
       dc.DeferredLoadingEnabled = False
       Dim dlOptions As New DataLoadOptions()
       dlOptions.Asso ciateWith(Of Category)(Function(c As ) c.Products)
       dc.LoadOptions = dlOptions
       Dim categories As var = From c In dc.Categories _
       Select c
       For Each category As var In categories
       Console.WriteLine("{0} has {1} products", category.CategoryName, category.Products.Count)
       Next
       End Using
                                                                                        Answer: B

For interactive and self-paced preparation of exam 70-516, try our practice exams.
Practice exams also include self assessment and reporting features          http://www.certificationtutorials.com
                                                                                                                       5
       Question: 7.


       You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You use the
       ADO.NET Entity Framework to model your entities. You use Plain Old CLR Objects (POCO) entities along with
       snapshot-based change tracking. The code accesses the POCO entities directly. You need to ensure that the
       state manager synchronizes when changes are made to the object graph. Which ObjectContext method
       should you call

       A. Refresh
       B. SaveChanges
       C. DetectChanges
       D. ApplyPropertyChanges

                                                                                        Answer: C



       Question: 8.


       You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You use the
       ADO.NET Entity Framework to model your entities. You use Plain Old CLR Objects (POCO) entities along with
       snapshot-based change tracking. The code accesses the POCO entities directly. You need to ensure that the
       state manager synchronizes when changes are made to the object graph. Which ObjectContext method
       should you call

       A. Refresh
       B. SaveChanges
       C. DetectChanges
       D. ApplyPropertyChanges

                                                                                        Answer: C




For interactive and self-paced preparation of exam 70-516, try our practice exams.
Practice exams also include self assessment and reporting features          http://www.certificationtutorials.com
                                                                                                                    6
       Question: 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 Plain Old CLR Objects (POCO) entities. You create
       a new POCO class. You need to ensure that the class meets the following requirements:
       It can be used by an ObjectContext. It is enabled for change-tracking proxies.
       Which two actions should you perform(Each correct answer presents part of the solution. Choose two.)

       A. Modify each mapped property to contain sealed and protected accessors.
       B. Modify each mapped property to contain non-sealed, public, and virtual accessors.
       C. Configure the navigation property to return a type that implements the ICollection interface.
       D. Configure the navigation property to return a type that implements the IQueryable interface.
       E. Configure the navigation property to return a type that implements the IEntityWithRelationships interface.

                                                                                        Answer: BC



       Question: 10.


       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 Plain Old CLR Objects (POCO) entities. You create
       a new POCO class. You need to ensure that the class meets the following requirements:
       It can be used by an ObjectContext.
       It is enabled for change-tracking proxies.
       Which two actions should you perform(Each correct answer presents part of the solution. Choose two.)

       A. Modify each mapped property to contain sealed and protected accessors.
       B. Modify each mapped property to contain non-sealed, public, and virtual accessors.
       C. Configure the navigation property to return a type that implements the ICollection interface.
       D. Configure the navigation property to return a type that implements the IQueryable interface.
       E. Configure the navigation property to return a type that implements the IEntityWithRelationships interface.

                                                                                       Answer: BD




For interactive and self-paced preparation of exam 70-516, try our practice exams.
Practice exams also include self assessment and reporting features          http://www.certificationtutorials.com
                                                                                                                       7
       Question: 11.


       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. You need to create a database from your
       model. What should you do?

       A. Run the edmgen.exe tool in FullGeneration mode.
       B. Run the edmgen.exe tool in FromSSDLGeneration mode.
       C. Use the Update Model Wizard in Visual Studio.
       D. Use the Generate Database Wizard in Visual Studio. Run the resulting script against a Microsoft SQL Server
       database.

                                                                                        Answer: D



       Question: 12.


       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. You need to create a database from your
       model. What should you do?

       A. Run the edmgen.exe tool in FullGeneration mode.
       B. Run the edmgen.exe tool in FromSSDLGeneration mode.
       C. Use the Update Model Wizard in Visual Studio.
       D. Use the Generate Database Wizard in Visual Studio. Run the resulting script against a Microsoft SQL Server
       database.

                                                                                        Answer: D




For interactive and self-paced preparation of exam 70-516, try our practice exams.
Practice exams also include self assessment and reporting features          http://www.certificationtutorials.com
                                                                                                                       8
       Question: 13.


       You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that uses the
       Entity Framework. You create an Entity Data Model (EDM) named Model. You need to ensure that the Storage
       Schema Definition Language (SSDL) of the EDM can be modified without rebuilding the application. What
       should you do?

       A. Set the Metadata Artifact Processing property to Embed in Output           Assembly and use the following
       connection string.
       metadata=res://*/Model.csdl|res://*/Model.ssdl|
       res://*/Model.msl;
       provider=System.Data.SqlClient;
       provider connection string="& "
       B. Set the Metadata Artifact Processing property to Copy to Output            Directory and use the following
       connection string.
       metadata=res://*/Model.csdl|res://*/Model.ssdl|
       res://*/Model.msl;
       provider=System.Data.SqlClient;
       provider connection string& ="& "
       C. Set the Metadata Artifact Processing property to Embed in Output           Assembly and use the following
       connection string.
       metadata=.\Model.csdl|.\Model.ssdl|.\Model.msl;
       provider=System.Data.SqlClient;
       provider connection string="& "
       D. Set the Metadata Artifact Processing property to Copy to Output            Directory and use the following
       connection string.
       metadata=.\Model.csdl|.\Model.ssdl|.\Model.msl;
       provider=System.Data.SqlClient;
       provider connection string& ="& "

                                                                                         Answer: D




For interactive and self-paced preparation of exam 70-516, try our practice exams.
Practice exams also include self assessment and reporting features          http://www.certificationtutorials.com
                                                                                                                       9
       Question: 14.


       You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that uses the
       Entity Framework. You create an Entity Data Model (EDM) named Model. You need to ensure that the Storage
       Schema Definition Language (SSDL) of the EDM can be modified without rebuilding the application. What
       should you do?

       A. Set the Metadata Artifact Processing property to Embed in Output           Assembly and use the following
       connection string.
       metadata=res://*/Model.csdl|res://*/Model.ssdl|
       res://*/Model.msl;
       provider=System.Data.SqlClient;
       provider connection string="& "
       B. Set the Metadata Artifact Processing property to Copy to Output            Directory and use the following
       connection string.
       metadata=res://*/Model.csdl|res://*/Model.ssdl|
       res://*/Model.msl;
       provider=System.Data.SqlClient;
       provider connection string& ="& "
       C. Set the Metadata Artifact Processing property to Embed in Output           Assembly and use the following
       connection string.
       metadata=.\Model.csdl|.\Model.ssdl|.\Model.msl;
       provider=System.Data.SqlClient;
       provider connection string="& "
       D. Set the Metadata Artifact Processing property to Copy to Output            Directory and use the following
       connection string.
       metadata=.\Model.csdl|.\Model.ssdl|.\Model.msl;
       provider=System.Data.SqlClient;
       provider connection string& ="& "

                                                                                         Answer: A




For interactive and self-paced preparation of exam 70-516, try our practice exams.
Practice exams also include self assessment and reporting features          http://www.certificationtutorials.com
                                                                                                                       10
       Question: 15.


       You use Microsoft Visual Studio 2010 and Microsoft.NET Framework 4 to create an application. The
       application connects to a Microsoft SQL Server database. You use the ADO.NET LINQ to Entities model to
       retrieve data from the database. You need to call a function that is defined in the conceptual model from
       within the LINQ to Entities queries. You create a common language runtime (CLR) method that maps to the
       function. What should you do next?


       A. Declare the method as static.
       B. Declare the method as abstract.
       C. Apply the EdmFunctionAttribute attribute to the method.
       D. Apply the EdmComplexTypeAttribute attribute to the method.

                                                                                        Answer: C




       Question: 16.


       You develop a Microsoft .NET Framework 4 application that uses the Entity Framework to store entities in a
       Microsoft SQLServer2008 database. While the application is disconnected from the database, entities that are
       added or modified are serialized to a local file. The next time the application connects to the database, it
       retrieves a Customer entity from the database by using an object context named context and stores the entity
       in a variable named remoteCustomer. The application then deserializes the Customer entity from the local file
       and stores the entity in a variable named localCustomer. The remoteCustomer and the localCustomer
       variables have the same entity key. You need to ensure that the offline changes to the Customer entity are
       persisted in the database when the ObjectContext.SaveChanges() method is called. Which line of code should
       you use?

       A. context.ApplyOriginalValues("Customers", remoteCustomer)
       B. context.ApplyOriginalValues("Customers", localCustomer)
       C. context.ApplyCurrentValues("Customers", remoteCustomer)
       D. context.ApplyCurrentValues("Customers", localCustomer)

                                                                                        Answer: D




For interactive and self-paced preparation of exam 70-516, try our practice exams.
Practice exams also include self assessment and reporting features          http://www.certificationtutorials.com
                                                                                                                    11
         Thank You For Trying Our Demo




                          MCPD EXAM 70-516
           TS: Accessing Data with Microsoft .NET Framework 4 (C# and VB)

         http://www.certificationtutorials.com/microsoft/70-516-exam.htm



       If you have any questions or difficulties regarding this
       product, feel free to contact Us.


       For interactive and self-paced preparation of exam 70-516, try our
       practice exams. Practice exams also include self assessment and reporting
       features!




For interactive and self-paced preparation of exam 70-516, try our practice exams.
Practice exams also include self assessment and reporting features          http://www.certificationtutorials.com
                                                                                                                    12

				
DOCUMENT INFO
Categories:
Stats:
views:13
posted:9/27/2011
language:English
pages:12
Description: MCPD 70-516 exams questions demo, these are the actual questions possible in MCPD 70-516 exam. All Certification Tutorials products are provided with full technical support and money back guarantee. Visit: certificationtutorials.com for MCPD and other MICROSOFT certification preparation material. Free Demos Available.