[Pass Ensure VCE Dumps] PassLeader Real 286q 70-516 Exam VCE Dumps Help You Passing Exam Easily (141-160)

Want To Pass The New 70-516 Exam Easily? DO NOT WORRY! PassLeader now is supplying the latest and 100 percent pass ensure 286q 70-516 PDF dumps and VCE dumps, the new updated 70-516 braindumps are the most accurate with all the new changed 70-516 exam questions, it will help you passing 70-516 exam easily and quickly. Now visit the our site passleader.com and get the valid 286q 70-516 VCE and PDF exam questions and FREE VCE PLAYER!

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 141
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 application uses a Microsoft ADO.NET SQL Server managed provider. When a connection fails, the application logs connection information, including the full connection string. The information is stored as plain text in a .config file. You need to ensure that the database credentials are secure. Which connection string should you add to the .config file?

A.    Data Source=myServerAddress; Initial Catalog=myDataBase; Integrated Security=SSPI;
Persist Security Info=false;
B.    Data Source=myServerAddress; Initial Catalog=myDataBase; Integrated Security=SSPI;
Persist Security Info=true;
C.    Data Source=myServerAddress; Initial Catalog=myDataBase; User Id=myUsername;
Password=myPassword; Persist Security Info=false;
D.    Data Source=myServerAddress; Initial Catalog=myDataBase; User Id=myUsername;
Password=myPassword; Persist Security Info=true;

Answer: A
Explanation:
Persist Security Info
Default: ‘false’
When set to false or no (strongly recommended), security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state. Resetting the connection string resets all connection string values including the password.
Recognized values are true, false, yes, and no.

QUESTION 142
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 manage order data. The application makes a Web service call to obtain orders from an order-tracking system. You need to ensure that the orders are added to the local data store. Which method should you call on the ObjectContext?

A.    Attach
B.    AttachTo
C.    AddObject
D.    ApplyCurrentValues

Answer: C
Explanation:
ObjectContext.AddObject() Call AddObject on the ObjectContext to add the object to the object context.
Do this when the object is a new object that does not yet exist in the data source. ObjectContext.Attach() Call Attach on the ObjectContext to attach the object to the object context.
Do this when the object already exists in the data source but is currently not attached to the context.
If the object being attached has related objects, those objects will also be attached to the object context.
Objects are added to the object context in an unchanged state.
The object that is passed to the Attach method must have a valid EntityKey value. If the object does not have a valid EntityKey value, use the AttachTo method to specify the name of the entity set.
ObjectContext.AttachTo() Call AttachTo on the ObjectContext to attach the object to a specific entity set in the object context or if the object has a null (Nothing in Visual Basic) EntityKey value.
The object being attached is not required to have an EntityKey associated with it. If the object does not have an entity key, then entitySetName cannot be an empty string. ApplyCurrentValues<TEntity>() method is used to apply changes that were made to objects outside the ObjectContext, such as detached objects that are received by a Web service.
The method copies the scalar values from the supplied object into the object in the ObjectContext that has the same key.
You can use the EntityKey of the detached object to retrieve an instance of this object from the data source.

QUESTION 143
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the Entity Framework Designer to create an Entity Data Model using model-first development. The database has the following requirements:
– each table must have a datetime column named time_modified
– each table requires a trigger that updates the value of the time_modified column when a row is inserted or updated
You need to ensure that the database script that is created by using the Generate Database From Model option meets the requirements. What should you do?

A.    Create a new T4 template, and set the DDL Generation template to the name of the new template.
B.    Create a new Windows Workflow Foundation workflow, and set Database Generation Workflow to the name of the new workflow.
C.    Add a DateTime property named time_modified to each entity in the model and set the property’s StoreGeneratedPattern to Computed.
D.    Add a new entity named time_modified to the model, and modify each existing entity so that it inherits from the new entity.

Answer: A
Explanation:
Model-First in the Entity Framework 4
http://msdn.microsoft.com/en-us/data/ff830362

QUESTION 144
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 as shown in the following diagram. You create an ObjectContext instance named objectContext1 and use it to create a SalesPerson instance named person1. You create an ObjectContext instance named objectContext2 and use it to create a SalesTerritory instance named territory1. You need to create and persist a relationship between person1 and terrotory1. What should you do?

A.    Detach person1 from objectContext1.
Attach person1 to objectContext2.
Set the SalesTerritory property of person1 to territory1.
Call SaveChanges on objectContext2.
B.    Attach person1 to objectContext2.
Attach territory1 to objectContext1.
Set the SalesTerritory property of person1 to territory1.
Call SaveChanges on both objectContext1 and objectContext2.
C.    Detach person1 from objectContext1.
Detach territory1 from objectContext2.
Set the SalesTerritory property of person1 to territory1.
Call Refresh on both objectContext1 and objectContext2.
D.    Attach person1 to objectContext2.
Detach territory1 from objectContext2.
Set the SalesTerritory property of person1 to territory1.
Call Refresh on objectContext1.

Answer: A

QUESTION 145
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework. You create the following Entity Data Model. You add the following code fragment:
using(var context = new AdventureWorksLTEntities())
{
Customer cust = context.Customers.First();
cust.CompanyName = “Contoso”;
int count = 0;
}
The changes to the cust entity must be saved. If an exception is thrown, the application will attempt to save up to 3 times. If not, an exception is thrown. Which code segment should you use?

A.    while(count++ < 3)
{
try
{
context.SaveChanges();
break;
}
catch(Exception)
{
}
}
B.    while(cust.EntityState == EntityState.Modified)
{
    try
    {
        context.SaveChanges();
     }
    catch(Exception)
    {
if(count++ > 2 && context.Connection.State == ConnectionState.Broken
        {
              throw new Exception();
        }
    }
}
C.    while(true)
{
context.SavingChanges += delegate(System.Object o, System.EventArgs e)
    {
        if(count++ >2)
        {
            throw new Exception();
        }
        context.SaveChanges();
    }
}
D.    while(context.ObjextStateManager.GetObjectStateEntry(cust).
OriginalValues.IsDBNull(0))
{
    if(count++ >2)
    {
        break;
    }
    context.SaveChanges();
}

Answer: B

QUESTION 146
You have executed the Where query extension method on your collection, and it returned IEnumerable of Car, but you want to assign this to a variable whose type is List Of Car. How can you convert the IEnumerable of Car to List Of Car?

A.    Use CType (C# cast).
B.    It can’t be done.
C.    Use the ToList() query extension method.
D.    Just make the assignment

Answer: C

QUESTION 147
When working with LINQ to SQL, what is the main object that moves data to and from the database?

A.    DataSet
B.    SqlDataAdapter
C.    DataContext
D.    Entity

Answer: C

QUESTION 148
You want to use LINQ to SQL to run queries on a table that contains a column that stores large photos. Most of the time, you won’t need to view the photo, but occasionally you will need to see it. In the LINQ to SQL designer, which property can you set on the photo column to get the efficient loading of the data for most scenarios but still be able to retrieve the photo when needed?

A.    Skip
B.    Delay Loaded
C.    Take
D.    Auto Generated Value.

Answer: B

QUESTION 149
You retrieved a row of data into an entity object by using a LINQ to SQL DataContext object. You haven’t made any changes to the object, but you know that someone else has modified the data row in the database table, so you rerun your query, using the same LINQ to SQL DataContext object, to retrieve the updated data. What can be said about the result of the second query?

A.    It returns the updated data and you can use it immediately.
B.    The changes are thrown out and you use the cached data, so you don’t see the changes.
C.    An exception is thrown due to the difference in data.
D.    An exception is thrown because you already have the object, so you can’t re-query unless you create a new DataContext object.

Answer: B

QUESTION 150
You ran a LINQ to SQL query to retrieve the products that you are going to mark as discontinued. After running the query, you looped through the returned products and set their Discontinued property to true. What must you do to ensure that the changes go back to the database?

A.    Call the Update method on the DataContext object.
B.    Nothing; the changes are sent when you modify the object.
C.    Call the Dispose method on the DataContext object.
D.    Call the SubmitChanges method on the DataContext object.

Answer: D


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

QUESTION 151
You are working with an ObjectContext object that targets the mainframe and another ObjectContext object that targets SQL Server. When it’s time to save the changes, you want all changes to be sent to the mainframe and to SQL Server as one transaction. How can you accomplish this?

A.    Just save both ObjectContext objects because they automatically join the same transaction.
B.    Save to the mainframe and use an if statement to verify that the changes were successful. If successful, save to SQL Server.
C.    Wrap the saving of both ObjectContext objects within a TransactionScope object that is implemented in a using statement in which the last line executes the Complete method on the TransactionScope class.
D.    Use a Boolean flag to indicate the success of each save, which will tell you whether the save was successful.

Answer: C

QUESTION 152
The URI to your WCF data service is http://www.northwind.com/DataServices.svc. What can you add to the end of the URI to retrieve only a list of Order entities for the Customer entity whose CustomerID is `BONAP’?

A.    /Customers(`BONAP’)?$expand=Orders
B.    /Customers?$filter=CustomerID eq `BONAP’&$expand=Orders
C.    /Customers/Orders?$filter=CustomerID eq `BONAP’
D.    /Customers(`BONAP’)/Orders

Answer: D

QUESTION 153
You are writing a WCF data service that will be included in a large project that has many other WCF data services. Your WCF data service will provide access to a SQL server using the Entity Framework. The EDMX file already exists in the project and is used by other services. One of the tables exposed by your service is the Contacts table, which contains the list of employees and the list of external contacts, which are denoted by the IsEmployee column that can be set to 1 or 0. You want to configure your WCF data service to return the external contacts whenever someone queries the Contacts entity set through WCF Data Services. What is the best way to solve this problem?

A.    Modify the Contacts entity set in the EDMX file.
B.    Add a stored procedure to SQL Server and modify the EDMX file to create a function import that you can call.
C.    Add a method to your WCF data service class and adorn the method with a QueryInterceptorAttribute of Contacts. In the method, provide the filter.
D.    Add a lazy loader to the WCF data service that will filter out the employees.

Answer: C

QUESTION 154
What must you use to capture an exception that might occur when you are sending changes to the database server?

A.    A using block.
B.    A try/catch block.
C.    A while statement.
D.    You can’t capture exceptions.

Answer: B

QUESTION 155
Which of the following are valid encryption algorithms that can be selected when encrypting the connection strings in your .config files? (Each correct answer presents a complete solution. Choose two.)

A.    DpapiProtectedConfigurationProvider
B.    RNGCryptoServiceProvider
C.    SHA256Managed
D.    RsaProtectedConfigurationProvider
E.    RijndaelManaged

Answer: AD

QUESTION 156
Which of the following is a valid symmetric encryption algorithm?

A.    RNGCryptoServiceProvider
B.    RNGCryptoServiceProvider
C.    SHA256Managed
D.    RijndaelManaged

Answer: D

QUESTION 157
You want to synchronize data between your local SQL Server Compact tables and SQL Server 2008. You want the synchronization to send changes to SQL Server 2008, and you want to receive changes from SQL Server 2008. Which setting must you assign to the SyncDirection property of your sync agent’s tables?

A.    SyncDirection.Bidirectional
B.    SyncDirection.UploadOnly
C.    SyncDirection.Snapshot
D.    SyncDirection.DownloadOnly

Answer: A

QUESTION 158
You are adding a process to the application. The process performs the following actions:
1. Opens a ContosoEntities context object named context1.
2. Loads a Part object into a variable named part1.
3. Calls the Dispose() method on context1.
4. Updates the data in part1.
5. Updates the database by using a new ContosoEntities context object named context2.
You need to update the database with the changed data from part1. What should you do?

A.    Add the following code segment before calling SaveChanges() on context2:
context2.ApplyCurrentValues(“Parts”, part1);
B.    Add the following code segment before calling SaveChanges() on context2:
context2.Attach(part1);
context2.ApplyCurrentValues(“Parts”, part1);
C.    Add the following code segment before calling SaveChanges() on context2:
context2.Attach(part1);
context2.ObjectStateManager.ChangeObjectState(part1, System.Data.EntitySate.Modified);
D.    Add the following code segment before calling SaveChanges() on context2:
context2.ApplyOriginalValues(“Parts”, part1);

Answer: C
Explanation:
How to: Apply Changes Made to a Detached Object
http://msdn.microsoft.com/en-us/library/bb896248.aspx

QUESTION 159
The application must provide a component part list for any product. The component part list must give the quantity of each distinct part that is required to manufacture that product. You need to create a LINQ expression that delivers a a result of type IEnumerable<Tuple<int,Part>> to meet the requirements. Which expression should you use?

A.    IEnumerable<Tuple<int, Part>> result = part.Children.Distinct().GroupBy(p => p).Select(g => Tuple.Create(g.Count(), g.Key));
B.    IEnumerable<Tuple<int, Part>> result = part.Descendants.GroupBy(p => p).Select(g => Tuple.Create(g.Count(), g.Key));
C.    IEnumerable<Tuple<int, Part>> result = part.Descendants.ToDictionary(c => c).Select(d => Tuple.Create(d.Value.Children.Count(), d.Key));
D.    IEnumerable<Tuple<int, Part>> result = part.Children.GroupBy(p => p).Select(g => Tuple.Create(g.Count(), g.Key));
E.    IEnumerable<Tuple<int, Part>> result = part.Descendants.Distinct().GroupBy(p => p).Select(g => Tuple.Create(g.Count(), g.Key));

Answer: B

QUESTION 160
You are developing a new feature that displays an auto-complete list to users as the type color names. You have an existing ContosoEntities context object named contex. To support the new feature you must develop code that will accept a string object named text containing a user’s partial input and will query the Colors database table to retrieve all color names that begin with that input. You need to create an Entity SQL (ESQL) query to meet the requirement. The query must not be vulnerable to a SQL injection attack. Which code segment should you use?

A.    var parameter = new ObjectParameter(“text”, text + “%”);
var result = context.CreateQuery<string>(“SELECT VALUE (c.Name) FROM Colors AS c WHERE c.Name LIKE ‘@text'”, parameter);
B.    var parameter = new ObjectParameter(“text”, text + “%”);
var result = context.CreateQuery<string>(“SELECT VALUE (c.Name) FROM Colors AS c WHERE c.Name LIKE @text”, parameter);
C.    var parameter = new ObjectParameter(“text”, text + “%”);
var result = context.CreateQuery<string>(“SELECT (c.Name) FROM Colors AS c WHERE c.Name LIKE @text”, parameter);
D.    var parameter = new ObjectParameter(“text”, HttpUtility.HtmlEncode(text) + “%”);
var result = context.CreateQuery<string>(“SELECT (c.Name) FROM Colors AS c WHERE c.Name LIKE ‘@text’@, parameter);

Answer: B
Explanation:
Entity SQL supports two variants of the SELECT clause. The first variant, row select, is identified by the SELECT keyword, and can be used to specify one or more values that should be projected out. Because a row wrapper is implicitly added around the values returned, the result of the query expression is always a multiset of rows. Each query expression in a row select must specify an alias. If no alias is specified,Entity SQL attempts to generate an alias by using the alias generation rules. The other variant of the SELECT clause, value select, is identified by the SELECT VALUE keyword. It allows only one value to be specified, and does not add a row wrapper. A row select is always expressible in terms of VALUE SELECT, as illustrated in the following example.
ESQL Select
http://msdn.microsoft.com/en-us/library/bb399554.aspx


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