Study Latest Braindump2go 70-516 Practice Exam Questions From Today Pass 70-516 Easily! (141-150)

MICROSOFT NEWS: 70-516 Exam Questions has been Updated Today! Get Latest 70-516 VCE and 70-516PDF Instantly! Welcome to Download the Newest Braindump2go 70-516 VCE&70-516 PDF Dumps: http://www.braindump2go.com/70-516.html (286 Q&As)

Quick and Effective Microsoft 70-516 Exam Preparation Options – Braindump2go new released 70-516 Exam Dumps Questions! Microsoft Official 70-516 relevant practice tests are available for Instant downloading at Braindump2go! PDF and VCE Formates, easy to use and install! 100% Success Achievement Guaranteed!

Exam Code: 70-516
Exam Name: TS: Accessing Data with Microsoft .NET Framework 4
Certification Provider: Microsoft
Corresponding Certifications: MCPD, MCPD: Web Developer 4, MCPD: Windows Developer 4, MCTS, MCTS: Microsoft .NET Framework 4, Data Access

70-516 Dumps,70-516 Dumps PDF,70-516 Exam PDF,70-516 Book,70-516 Study Guide,70-516 eBook,70-516 eBook PDF,70-516 Exam Questions,70-516 Training Kit,70-516 PDF,70-516 Microsoft Exam,70-516 VCE,70-516 Braindump,70-516 Braindumps PDF,70-516 Braindumps Free,70-516 Practice Test,70-516 Practice Exam,70-516 Preparation,70-516 Preparation Materials,70-516 Practice Questions

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


Braindump2go Regular Updates of Microsoft 70-516 Preparation Materials Exam Dumps, with Accurate Answers, Keeps the Members One Step Ahead in the Real 70-516 Exam. Field Experts with more than 10 Years Experience in Certification Field work with us.


FREE DOWNLOAD: NEW UPDATED 70-516 PDF Dumps & 70-516 VCE Dumps from Braindump2go: http://www.braindump2go.com/70-516.html (286 Q&A)