The Secret of 70-516 blog

Microsoft Microsoft certification is regarded since one of the most extremely demanded certifications around the globe. Inside the field associated with IT, Microsoft 70-516 certification is something everyone is eager to own. When you try to get promotion or even change task, you will have the advantage over various other workmates or candidates should you have a Microsoft Microsoft certification in hand.

2021 Jan 70-516 ebook pdf:

Q1. - (Topic 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. 

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:

Explanation: 

DataLoadOptions Class Provides for immediate loading and filtering of related data. 

DataLoadOptions.LoadWith(LambdaExpression) Retrieves specified data related to the 

main target by using a lambda expression. 

You can retrieve many objects in one query by using LoadWith. 

DataLoadOptions.AssociateWith(LambdaExpression) Filters the objects retrieved for a 

particular relationship. 

Use the AssociateWith method to specify sub-queries to limit the amount of retrieved data. 

DataLoadOptions Class 

(http://msdn.microsoft.com/en-us/library/system.data.linq.dataloadoptions.aspx) 

How to: Retrieve Many Objects At Once (LINQ to SQL) 

(http://msdn.microsoft.com/en-us/library/Bb386917(v=vs.90).aspx) 

How to: Filter Related Data (LINQ to SQL) 

(http://msdn.microsoft.com/en-us/library/Bb882678(v=vs.100).aspx) 


Q2. - (Topic 1) 

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:

Explanation: 

How to: Copy Model and Mapping Files to the Output Directory (Entity Data Model Tools) (http://msdn.microsoft.com/en-us/library/cc716709.aspx) 


Q3. - (Topic 1) 

You use Microsoft .NET Framework 4 to develop an application. You use the XmlReader class to load XML from a location that you do not control. 

You need to ensure that loading the XML will not load external resources that are referenced in the XML. 

Which code segment should you use? 

A. XmlReaderSettings settings = new XmlReaderSettings(); 

settings.ValidationType = ValidationType.None; 

XmlReader reader = XmlReader.Create("data.xml", settings); 

B. XmlReaderSettings settings = new XmlReaderSettings(); 

settings.CheckCharacters = true; 

XmlReader reader = XmlReader.Create("data.xml", settings); 

C. XmlReaderSettings settings = new XmlReaderSettings(); 

settings.XmlResolver = null; 

XmlReader reader = XmlReader.Create("data.xml", settings); 

D. XmlReaderSettings settings = new XmlReaderSettings(); 

settings.ConformanceLevel = ConformanceLevel.Auto; 

XmlReader reader = XmlReader.Create("data.xml", settings); 

Answer:

Explanation: 

CheckCharacters Gets or sets a value indicating whether to do character checking. 

ConformanceLevel Gets or sets the level of conformance which the XmlReader will comply. 

ValidationType Gets or sets a value indicating whether the XmlReader will perform 

validation or type assignment when reading. 

XmlResolver Sets the XmlResolver used to access external documents. 

XmlReaderSettings Class 

(http://msdn.microsoft.com/en-us/library/system.xml.xmlreadersettings.aspx) 

http://stackoverflow.com/questions/215854/prevent-dtd-download-when-parsing-xml 

http://msdn.microsoft.com/en-us/library/x1h1125x.aspx 


Q4. - (Topic 1) 

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Communication Foundation (WCF) Data Services service. You deploy the service to the following URL: http://contoso.com/ Northwind.svc. 

You want to query the WCF Data Services service to retrieve a list of customer objects. 

You need to ensure that the query meets the following requirements: 

"Only customers that match the following filter criteria are retrieved: City="Seattle" AND Level > 200. 

"Data is sorted in ascending order by the ContactName and Address properties. 

Which URL should you use for the query? 

A. http: //contoso.com/Northwind.svc/Customers?City=Seattle & Level gt 200 & $orderby=ContactName, Address 

B. http: //contoso.com/Northwind.svc/Customers?City=Seattle & Level gt 200 & $orderby=ContactName and Address 

C. http: //contoso.com/Northwind.svc/Customers?$filter=City eq 'Seattle' and Level gt 200 & $orderby=ContactName,Address 

D. http: //contoso.com/Northwind.svc/Customers?$filter=City eq 'Seattle' and Level gt 200 & $orderby=ContactName and Address 

Answer:

Explanation: 

CHAPTER 7 WCF Data Services 

Lesson 1: What Is WCF Data Services? 

Working with Filters (page 474) 

Accessing the Service from a Web Browser (WCF Data Services Quickstart) 

(http://msdn.microsoft.com/en-us/library/dd728279.aspx) 

Accessing Data Service Resources (WCF Data Services) 

(http://msdn.microsoft.com/en-us/library/dd728283.aspx) 


Q5. - (Topic 1) 

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? 

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. 

Answer:

Explanation: 

Entity Reference (Of Entity) Represents a related end of an association with a multiplicity of zero or one. 


Replace 70-516 questions:

Q6. - (Topic 1) 

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 create a DataSet object in the application. You add two DataTable objects named App_Products and App_Categories to the DataSet. You add the following code segment to populate the DataSet object. (Line numbers are included for reference only.) 

01 public void Fill(SqlConnection cnx, DataSet ds) { 

03 var cmd = cnx.CreateCommand(); 

04 cmd.CommandText = "SELECT * FROM dbo.Products; " + "SELECT * FROM dbo.Categories"; 

05 var adapter = new SqlDataAdapter(cmd); 

07 } 

You need to ensure that App_Products and App_Categories are populated from the dbo.Products and dbo. Categories database tables. Which code segment should you insert at line 06? 

A. adapter.Fill(ds, "Products"); adapter.Fill(ds, "Categories"); 

B. adapter.Fill(ds.Tables["App_Products"]); adapter.Fill(ds.Tables["App_Categories"]); 

C. adapter.TableMappings.Add("Table", "App_Products"); adapter.TableMappings.Add("Table1", "App_Categories"); adapter.Fill(ds); 

D. adapter.TableMappings.Add("Products", "App_Products"); adapter.TableMappings.Add("Categories", "App_Categories"); adapter.Fill(ds); 

Answer:

Explanation: Table Mapping in ADO.NET (http://msdn.microsoft.com/en-us/library/ms810286.aspx) 


Q7. - (Topic 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 Entity Framework to model entities. 

The database includes objects based on the exhibit. (Click the Exhibit button.) 

The application includes the following code segment. (Line numbers are included for reference only.) 

01 Using advWorksContext As New AdventureWorksEntities() 

03 End Using 

You need to retrieve a list of all Products from todays sales orders for a specified customer. 

You also need to ensure that the application uses the minimum amount of memory when retrieving the list. 

Which code segment should you insert at line 02? 

A. Dim customer As Contact = context.Contact.Where("it.ContactID = @customerId", New ObjectParameter("customerId", customerId)).First() customer.SalesOrderHeader.Load() For Each order As SalesOrderHeader In customer.SalesOrderHeader order.SalesOrderDetail.Load() If order.OrderDate.[Date] = DateTime.Today.[Date] Then For Each item As SalesOrderDetail In order.SalesOrderDetail Console.WriteLine([String].Format("Product: {0} ", item.ProductID)) Next End If Next 

B. Dim customer As Contact = context.Contact.Where("it.ContactID = @customerId", New ObjectParameter("customerId", customerId)).First() customer.SalesOrderHeader.Load() For Each order As SalesOrderHeader In customer.SalesOrderHeader If order.OrderDate = DateTime.Today Then order.SalesOrderDetail.Load() For Each item As SalesOrderDetail In order.SalesOrderDetail Console.WriteLine([String].Format("Product: {0} ", item.ProductID)) Next End If Next 

C. Dim customer As Contact = (From contact In context.Contact.Include("SalesOrderHeader") _ Select contact).FirstOrDefault() For Each order As SalesOrderHeader In customer.SalesOrderHeader order.SalesOrderDetail.Load() If order.OrderDate = DateTime.Today Then For Each item As SalesOrderDetail In order.SalesOrderDetail Console.WriteLine([String].Format("Product: {0} ", item.ProductID)) Next End If Next 

D. Dim customer As Contact = (From contact In context.Contact.Include("SalesOrderHeader.SalesOrderDetail") _ Select contact).FirstOrDefault() For Each order As SalesOrderHeader In customer.SalesOrderHeader If order.OrderDate.[Date] = DateTime.Today.[Date] Then For Each item As SalesOrderDetail In order.SalesOrderDetail Console.WriteLine([String].Format("Product: {0} ", item.ProductID)) Next End If Next 

Answer:

Explanation: 

A & C check the Order date after Order Detail, so we are retrieving more Order details than necessary D is calling a Function (using eager loading) for the First Contact record only, so does not meet the requirements. 


Q8. - (Topic 5) 

How do you define a WCF Data Service query to grab the first 10 records. Options are something like: 

A. DataServiceQuery<Order> selectedOrders = context.Orders.AddQueryOption("$top", "10"); 

B. DataServiceQuery<Order> selectedOrders = context.Orders.AddQueryOption("$filter", "10"); 

C. DataServiceQuery<Order> selectedOrders = context.Orders.AddQueryOption("$select", "10"); 

D. DataServiceQuery<Order> selectedOrders = context.Orders.AddQueryOption("$expand", "10"); 

Answer:

Explanation: 

Accessing Data Service Resources (WCF Data Services) (http://msdn.microsoft.com/en-us/library/dd728283.aspx) DataServiceQuery<TElement>.AddQueryOption Method (http://msdn.microsoft.com/en-us/library/cc646860.aspx) 


Q9. - (Topic 3) 

You use Microsoft .NET Framework 4 to create an application. 

The application connects to a Microsoft SQL Server database. 

The application contains an Entity Framework model that has an entity named Products. 

You need to a write a method that accepts an input parameter named Product. The method 

must delete Product from the SQL Server database by using LINQ to Entities. 

You write the following code: 

Which code segment should you insert at line 04? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:


Q10. - (Topic 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 debit card numbers and PIN codes in the database. 

You need to ensure that PIN codes cannot be extracted from the database. 

Which cryptography provider should you use? 

A. SHA1CryptoServiceProvider 

B. DSACryptoServiceProvider 

C. AesCryptoServiceProvider 

D. MD5CryptoServiceProvider 

Answer:



see more http://www.2passeasy.com/exam/70-516/