web analytics

[Pass Ensure VCE Dumps] The Best PassLeader 70-516 Exam Questions With Free VCE Download (101-120)

Posted on December 3, 2015 By

Where To Get The 100 Percent Valid 70-516 Exam Dumps? PassLeader — one famous IT Certification Exam Study Materials Supplier — is offer the 100 percent valid 286q 70-516 exam dumps, which covers all the new 70-516 exam questions with detailed explanation and it has been helped many people passing 70-516 exam easily! Welcome to choose the best 286q 70-516 practice test from passleader.com, both 70-516 PDF dumps and 70-516 VCE dumps are available now!

keywords: 70-516 exam,286q 70-516 exam dumps,286q 70-516 exam questions,70-516 pdf dumps,70-516 vce dumps,70-516 braindumps,70-516 practice tests,70-516 study guide,TS: Accessing Data with Microsoft .NET Framework 4 Exam

QUESTION 101
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the ADO.NET Entity Framework Designer to model entities. You need to create a Plain Old CLR Object (POCO) class that can be used with the ObjectContext.CreateObject method to create a proxy. What should you do?

A.    Create a custom data class that has a Protected constructor that does not have parameters.
B.    Create a custom data class in which all properties and methods are virtual.
C.    Create a custom data class that is abstract.
D.    Create a custom data class that is sealed.

Answer: A
Explanation:
Requirements for Creating POCO Proxies
http://msdn.microsoft.com/en-us/library/dd468057.aspx

QUESTION 102
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an ASP.NET Web application that uses the Entity Framework. The build configuration is set to Release. The application must be published by using Microsoft Visual Studio 2010, with the following requirements:
– The database schema must be created on the destination database server.
– The Entity Framework connection string must be updated so that it refers to the destination database server.
You need to configure the application to meet the requirements. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Generate the DDL from the Entity Framework Designer and include it in the project. Set the action for the DDL to ApplicationDefinition.
B.    Set Items to deploy in the Package/Publish Web tab to All files in this Project Folder for the release configuration.
C.    Use the web.config transform file to modify the connection string for the release configuration.
D.    Include the source database entry in the Package/Publish SQL tab and update the connection string for the destination database.

Answer: CD

QUESTION 103
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the ADO.NET Entity Framework Designer to model entities. You need to retrieve an entity, and you must ensure that the entity is loaded in a detached state. Which MergeOption enumeration value should you use to retrieve the entity?

A.    PreserveChanges
B.    OverwriteChanges
C.    AppendOnly
D.    NoTracking

Answer: D
Explanation:
MergeOption Enumeration
http://msdn.microsoft.com/en-us/library/system.data.objects.mergeoption.aspx

QUESTION 104
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: A
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

QUESTION 105
There are Entities-States Class, Cities class. Deleting of state id raises exception. Which of the following?

A.    EntityException
B.    ConstraintException
C.    UpdateException
D.    EntityUpdateException

Answer: B
Explanation:
ConstraintException Represents the exception that is thrown when attempting an action that violates a constraint.
System.Object
System.Exception
System.SystemException
System.Data.DataException
System.Data.ConstraintException
EntityException Represents Entity Framework-related errors that occur in the EntityClient namespace.
The EntityException is the base class for all Entity Framework exceptions thrown by the EntityClient.
System.Object
System.Exception
System.SystemException
System.Data.DataException
System.Data.EntityException
System.Data.EntityCommandCompilationException
System.Data.EntityCommandExecutionException
System.Data.EntitySqlException
System.Data.MappingException
System.Data.MetadataException
System.Data.ProviderIncompatibleException
UpdateException
The exception that is thrown when modifications to object instances cannot be persisted to the data source.
System.Object
System.Exception
System.SystemException
System.Data.DataException
System.Data.UpdateException
System.Data.OptimisticConcurrencyException
EntityException Class
http://msdn.microsoft.com/en-us/library/system.data.entityexception.aspx
ConstraintException Class
http://msdn.microsoft.com/en-us/library/system.data.constraintexception.aspx
UpdateException Class
http://msdn.microsoft.com/en-us/library/system.data.updateexception.aspx

QUESTION 106
Class Workflow-Has Workstepflow inside. Get workflow data as well as related workstepflow.

A.    context.CreateObjectSet<WorkFlow>(“WorkFlowSteps” .Where(i)WorkFlowSteps == workflow.WorkFlowSteps);
B.    context.LoadProperty(workFlow,”WorkFlow”)
C.    context.CreateObjectSet<WorkFlowSteps>(WorkFlow .Where(i)WorkFlow == workflow);
D.    context.LoadProperty(workflow Function(i)WorkFlowSteps)

Answer: B

QUESTION 107
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application. A file named books.xml contains the following XML.
<bib>
   <book title=”Programming in Unix” year=”1992″>
      <author>Author1</author>
      <author>Author2</author>
      <author> Author 3 </author>
   </book>
</bib>
The application must generate an XML result that contains an XML element named BookTitle for each book. The text content of the element must contain the title of the book. You need to create a query that generates the new XML result. What should you do?

A.    XDocument document = XDocument.Load(“books.xml”);
var query = from node in document.Descendants()
where node.Name.LocalName == “book”
select new XElement(“BookTitle”, node.FirstAttribute.Value);
B.    XDocument document = XDocument.Load(“books.xml”);
var query = from node in document.DescendantNodes()
where node.ToString() == “book”
select new XText(“BookTitle” + node.ToString());
C.    XDocument document = XDocument.Load(“books.xml”);
var query = from node in document.Descendants()
where node.Name.LocalName == “book”
select new XElement(“BookTitle”).Value = node.FirstAttribute.Value;
D.    XDocument document = XDocument.Load(“books.xml”);
var query = from node in document.DescendantNodes()
where node.ToString() == “book”
select new XElement(“BookTitle”, node.ToString());

Answer: A

QUESTION 108
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that uses the Entity Framework. The application has the entity model shown in the following diagram. The application must create a projection of the unique set of names and year-to-date sales for territories where at least one sales person had sales last year of more than $100,000. The projection must consist of properties named Sales and Name. You need to write a query that will generate the required projection. Which code segment should you use?

A.    (from person in model.SalesPersons
where (person.SalesLastYear > 100000)
select new {
Name = person.SalesTerritory.Name,
Sales = person.SalesTerritory.SalesYTD
}
).Distinct();
B.    (from person in model.SalesPersons
where (person.SalesLastYear > 100000)
select new {
Name = person.SalesTerritory.Name,
Sales = person.SalesTerritory.SalesYTD
}
);
C.    model.SalesTerritories.
Where( t => t.SalesPersons.Any( p => p.SalesLastYear > 100000))
.Select( t=> new  { t.Name, t.SalesYTD})
.Distinct();
D.    model.SalesTerritories.
Where( t=> t.SalesPersons.Any( p => p.SalesLastYear > 100000))
.Select( t=> new { t.Name, Sales = t.SalesYTD});

Answer: A

QUESTION 109
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL Server 2008 database. You add the following stored procedure to the database:
CREATE PROCEDURE [dbo].[InsertTag]
@Name nvarchar (15)
AS
INSERT INTO [dbo].[Tags] (Name) VALUES(@Name)
RETURN @@ROWCOUNT
You need to invoke the stored procedure by using an open SqlConnection named conn. Which code segment should you use?

A.    SqlCommand cmd = new SqlCommand(“EXEC InsertTag”, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@Name”, “New Tag 1”);
cmd.ExecuteNonQuery();
B.    SqlCommand cmd = new SqlCommand(“EXEC InsertTag”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@Name”, “New Tag 1”);
cmd.ExecuteNonQuery();
C.    SqlCommand cmd = new SqlCommand(“InsertTag”, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@Name”, “New Tag 1”);
cmd.ExecuteNonQuery();
D.    SqlCommand cmd = new SqlCommand(“InsertTag”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@Name”, “New Tag 1”);
cmd.ExecuteNonQuery();

Answer: D
Explanation:
http://msdn.microsoft.com/en-us/library/yy6y35y8(v=vs.71).aspx

QUESTION 110
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL Server 2008 database. The database contains a ClassStudent table that contains the StudentID for students who are enrolled in the classes. You add the following stored procedure to the database:
CREATE PROCEDURE [dbo].[GetNumEnrolled]
@ClassID INT,
@NumEnrolled INT OUTPUT
AS BEGIN
SET NOCOUNT ON
SELECT @NumEnrolled = COUNT(StudentID)
FROM ClassStudent
WHERE (ClassID = @ClassID)
END
You write the following code. (Line numbers are included for reference only.)
01 private int GetNumberEnrolled(string classID)
02 {
03    using (SqlConnection conn = new SqlConnection(GetConnectionString())
04    {
05       SqlCommand cmd = new SqlCommand(“GetNumEnrolled”, conn);
06       cmd.CommandType = CommandType.StoredProcedure;
07       SqlParameter parClass = cmd.Parameters.Add(“@ClassID”, SqlDbType.Int, 4, “classID”);
08       SqlParameter parNum = cmd.Parameters.Add(“@NumEnrolled”, SqlDbType.Int);
09       …
10       conn.Open()
11       …
12    }
13 }
You need to ensure that the GetNumberEnrolled method returns the number of students who are enrolled for a specific class. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Insert the following code at line 09.
parNum.Direction = ParameterDirection.Input;
B.    Insert the following code at line 09.
parNum.Direction = ParameterDirection.Output;
C.    Insert the following code at line 11.
int numEnrolled = 0;
SqlDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
numEnrolled = numEnrolled + (int)cmd.Parameters[“@NumEnrolled”].Value;
}
return numEnrolled;
D.    Insert the following code at line 11.
cmd.ExecuteNonQuery();
return (int)parNum.Value;

Answer: BD


http://www.passleader.com/70-516.html

QUESTION 111
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application uses the ADO.NET Entity Framework to model entities. You define a Category class by writing the following code segment. (Line numbers are included for reference only.)
01 public class Category
02 {
03    public int CategoryID { get; set; }
04    public string CategoryName { get; set; }
05    public string Description { get; set; }
06    public byte[] Picture { get; set; }
07    …
08 }
You need to add a collection named Products to the Category class. You also need to ensure that the collection supports deferred loading. Which code segment should you insert at line 07?

A.    public static List <Product> Products { get; set; }
B.    public virtual List <Product> Products { get; set; }
C.    public abstract List <Product> Products { get; set; }
D.    protected List <Product> Products { get; set; }

Answer: B
Explanation:
One of the requirements for lazy loading proxy creation is that the navigation properties must be declared virtual (Overridable in Visual Basic). If you want to disable lazy loading for only some navigation properties, then make those properties non-virtual.
Loading Related Objects (Entity Framework)
http://msdn.microsoft.com/en-us/library/gg715120(v=vs.103).aspx

QUESTION 112
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Forms application. You plan to deploy the application to several shared client computers. You write the following code segment. (Line numbers are included for reference only.)
01 Configuration config = ConfigurationManager.OpenExeConfiguration(exeConfigName);
02 …
03 config.Save();
04 …
You need to encrypt the connection string stored in the .config file. Which code segment should you insert at line 02?

A.    ConnectionStringsSection section =
config.GetSection(“connectionString”)
as ConnectionStringsSection;
section.SectionInformation.ProtectSection
(“DataProtectionConfigurationProvider”);
B.    ConnectionStringsSection section =
config.GetSection(“connectionStrings”)
as ConnectionStringsSection;
section.SectionInformation.ProtectSection
(“DataProtectionConfigurationProvider”);
C.    ConnectionStringsSection section =
config.GetSection(“connectionString”)
as ConnectionStringsSection;
section.SectionInformation.ProtectSection
(“RsaProtectedConfigurationProvider”);
D.    ConnectionStringsSection section =
config.GetSection(“connectionStrings”)
as ConnectionStringsSection;
section.SectionInformation.ProtectSection
(“RsaProtectedConfigurationProvider”);

Answer: D

QUESTION 113
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 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. The application includes the following code segment. (Line numbers are included for reference only.)
01 using (AdventureWorksEntities context = new AdventureWorksEntities()){
02    …
03    foreach (SalesOrderHeader order in customer.SalesOrderHeader){
04       Console.WriteLine(String.Format(“Order: {0} “, order.SalesOrderNumber));
05       foreach (SalesOrderDetail item in order.SalesOrderDetail){
06          Console.WriteLine(String.Format(“Quantity: {0} “, item.Quantity));
07          Console.WriteLine(String.Format(“Product: {0} “, item.Product.Name));
08       }
09    }
10 }
You want to list all the orders for a specified customer. You need to ensure that the list contains the following fields:
– Order number
– Quantity of products
– Product name
Which code segment should you insert at line 02?

A.    Contact customer = context.Contact.Where(“it.ContactID = @customerId”, new ObjectParameter(“@customerId”, customerId)).First();
B.    Contact customer = context.Contact.Where(“it.ContactID = @customerId”, new ObjectParameter(“customerId”, customerId)).First();
C.    context.ContextOptions.LazyLoadingEnabled = true;
Contact customer = (from contact in context.Contact include(“SalesOrderHeader.SalesOrderDetail”) select conatct).FirstOrDefault();
D.    Contact customer = (from contact in context.Contact include(“SalesOrderHeader”) select conatct).FirstOrDefault();

Answer: B

QUESTION 114
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 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.)
01 AdventureWorksEntities context = new AdventureWorksEntities(“http://localhost:1234/AdventureWorks.svc”);
02 …
03 var q = from c in context.Customers
04            where c.City == “London”
05            orderby c.CompanyName
06            select 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?

A.    context.MergeOption = MergeOption.AppendOnly;
B.    context.MergeOption = MergeOption.PreserveChanges;
C.    context.MergeOption = MergeOption.OverwriteChanges;
D.    context.MergeOption = MergeOption.NoTracking;

Answer: B
Explanation:
PreserveChanges-Objects that do not exist in the object context are attached to the context. If the state of the entity is Unchanged, the current and original values in the entry are overwritten with data source values. The state of the entity remains Unchanged and no properties are marked as modified. If the state of the entity is Modified, the current values of modified properties are not overwritten with data source values. The original values of unmodified properties are overwritten with the values from the data source. In the .NET Framework version 4, the Entity Framework compares the current values of unmodified properties with the values that were returned from the data source. If the values are not the same, the property is marked as modified.
MergeOption Enumeration
http://msdn.microsoft.com/en-us/library/system.data.objects.mergeoption.aspx

QUESTION 115
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 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.)
01 public partial class SalesOrderDetail : EntityObject
02 {
03    partial void OnOrderQtyChanging(short value)
04    {
05       …
06       {
07          …
08       }
09    }
10 }
You need to find out whether the object has a valid ObjectStateEntry instance. Which code segment should you insert at line 05?

A.    if (this.EntityState != EntityState.Detached)
B.    if (this.EntityState != EntityState.Unchanged)
C.    if (this.EntityState != EntityState.Modified)
D.    if (this.EntityState != EntityState.Added)

Answer: A

QUESTION 116
You use Microsoft Visual Studio 2010, Microsoft Sync Framework, and Microsoft .NET Framework 4.0 to create an application. You have a ServerSyncProvider connected to a Microsoft SQL Server database. The database is hosted on a Web server. Users will use the Internet to access the Customer database through the ServerSyncProvider. You write the following code segment. (Line numbers are included for reference only.)
01 SyncTable customerSyncTable = new SyncTable(“Customer”);
02 customerSyncTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
03 …
04 customerSyncTable.SyncGroup = customerSyncGroup;
05 this.Configuration.SyncTables.Add(customerSyncTable);
You need to ensure that the application meets the following requirements:
– Users can modify data locally and receive changes from the server.
– Only changed rows are transferred during synchronization.
Which code segment should you insert at line 03?

A.    customerSyncTable.SyncDirection = SyncDirection.DownloadOnly;
B.    customerSyncTable.SyncDirection = SyncDirection.Snapshot;
C.    customerSyncTable.SyncDirection = SyncDirection.Bidirectional;
D.    customerSyncTable.SyncDirection = SyncDirection.UploadOnly;

Answer: C

QUESTION 117
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication Foundation (WCF) Data Services service. The service connects to a Microsoft SQL Server 2008 database. The service is hosted by an Internet Information Services (IIS) 6.0 Web server. The application works correctly in the development environment. However, when you connect to the service on the production server, attempting to update or delete an entity results in an error. You need to ensure that you can update and delete entities on the production server. What should you do?

A.    Add the following line of code to the InitializeService method of the service:
config.SetEntitySetAccessRule (“*”, EntitySetRights.WriteDelete | EntitySetRights.WriteInsert);
B.    Add the following line of code to the InitializeService method of the service:
config.SetEntitySetAccessRule (“*”, EntitySetRights.WriteDelete | EntitySetRights.WriteMerge);
C.    Configure IIS to allow the PUT and DELETE verbs for the .svc Application Extension.
D.    Configure IIS to allow the POST and DELETE verbs for the .svc Application Extension.

Answer: C

QUESTION 118
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 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 data. 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.)
01 public void LoadDocuments(DbConnection cnx)
02 {
03    var cmd = cnx.CreateCommand();
04    cmd.CommandText = “SELECT * FROM dbo.Documents”;
05    …
06    cnx.Open();
07    …
08    ReadDocument(reader);
09 }
You need to ensure that data can be read as a stream. Which code segment should you insert at line 07?

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

Answer: D

QUESTION 119
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 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)
02 {
03    var cmd = cnx.CreateCommand();
04    cmd.CommandText = “SELECT * FROM dbo.Products; ” + “SELECT * FROM dbo.Categories”;
05    var adapter = new SqlDataAdapter(cmd);
06    …
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: D
Explanation:
Table Mapping in ADO.NET
http://msdn.microsoft.com/en-us/library/ms810286.aspx

QUESTION 120
You are calling a stored procedure in SQL Server 2008 that returns a UDT as an output parameter. This UDT, called MyCompanyType, was created by your company. The UDT has a method called GetDetails that you want to execute in your client application. What must you do to execute the method? (Each correct answer presents part of a complete solution. Choose three.)

A.    Set the SqlDbType of the parameter to SqlDbType.Udt.
B.    Set the UdtTypeName of the parameter to MyCompanyType.
C.    Call the ExecuteXmlReader method on the SqlCommand to serialize the UDT as XML.
D.    In the client application, set a reference to the assembly in which the UDT is.

Answer: ABD


http://www.passleader.com/70-516.html

70-516 Practice TestsMicrosoft Practice Tests     , ,