10 tips on how many questions 70-516

It is impossible to pass Microsoft 70-516 exam without any help in the short term. Come to Examcollection soon and find the most advanced, correct and guaranteed Microsoft 70-516 practice questions. You will get a surprising result by our Latest TS: Accessing Data with Microsoft .NET Framework 4 practice guides.

2021 Jan exam 70-516 testking:

Q231. - (Topic 3) 

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 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: B,C 

Explanation: 

CHAPTER 6 ADO.NET Entity Framework 

Lesson 1: What Is the ADO.NET Entity Framework? 

Other POCO Considerations (page 412) 


Q232. - (Topic 3) 

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 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: C,D 


Q233. - (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 Entity Framework to access data. 

You need to use Entity SQL to query data from an object of type ObjectContext. 

Which method should you use first? 

A. ExecuteStoreCommand 

B. ExecuteStoreQuery 

C. CreateObject 

D. CreateQuery 

Answer:


Q234. - (Topic 1) 

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that uses LINQ to SQL. The application contains the following model. 

You write the following code. (Line numbers are included for reference only.) 01 static void Insect() 

02 { 

03 NorthwindDataContext dc = new NorthwindDataContext(); 

04 Customer newCustomer = new Customer(); 

05 newCustomer.Firstname = "Todd"; 

06 newCustomer.Lastname = "Meadows"; 

07 newCustomer.Email = "troeadows@contoso.com"; 08 

09 dc.SubmitChanges(); 

10 { 

A product named Bike Tire exists in the Products table. The new customer orders the Bike Tire product. 

You need to ensure that the correct product is added to the order and that the order is associated with the new customer. 

Which code segment should you insert at line 08? 

A. Order newOrder = new Order(); 

newOrder.Product = (from p in dc.Products 

where p.ProductName == "Bike Tire" 

select p) .First(); 

B. Product newProduct = new Product(); 

newProduct.ProductName = "Bike Tire"; Order 

newOrder = new Order(); 

newOrder.Product = newProduct; 

C. Product newProduct = new Product(); 

newProduct.ProductName = "Bike Tire"; 

Order newOrder = new Order (); 

newOrder.Product = newProduct; 

newCustomer.Orders.Add(newOrder) ; 

D. Order newOrder = new Order(); 

newOrder.Product = (from p in dc.Products 

where p.ProductName == "Bike Tire" 

select p).First(); 

newCustomer.Orders.Add(newOrder) ; 

Answer:

17. - (Topic 1) 

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that uses the Entity Framework. The application has an entity model that contains a SalesOrderHeader entity. The entity includes an OrderDate property of type DateTime. 

You need to retrieve the 10 oldest SalesOrderHeaders according to the OrderDate property. 

Which code segment should you use? 

A. var model = new AdventureWorksEntities(); 

var sales = model.SalesOrderHeaders.Take(10).OrderByDescending(soh => 

soh.OrderDate); 

B. var model = new AdventureWorksEntities(); 

var sales = model.SalesOrderHeaders.OrderByDescending(soh => 

soh.OrderDate).Take(10); 

C. var model = new AdventureWorksEntities(); 

var sales = model.SalesOrderHeaders.OrderBy(soh => soh.OrderDate).Take(10); 

D. var model = new AdventureWorksEntities(); 

var sales = model.SalesOrderHeaders.Take(10).OrderBy(soh => soh.OrderDate); 

Answer:

Explanation: 

OrderBy() Sorts the elements of a sequence in ascending order according to a key. 

OrderByDescending() Sorts the elements of a sequence in descending order according to 

a key. 

Enumerable.OrderBy<TSource, TKey> Method (IEnumerable<TSource>, Func<TSource, 

TKey>) 

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


Q235. - (Topic 3) 

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:

Explanation: 

You must use the IMultipleResults.GetResult<TElement> Method pattern to obtain an 

enumerator of the correct type, based on your knowledge of the stored procedure. 

FunctionAttribute Associates a method with a stored procedure or user-defined function in 

the database. 

IMultipleResults.GetResult<TElement> Method 

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


Abreast of the times 70-516 dumps pdf:

Q236. - (Topic 1) 

You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL Server 2008 database. 

The application contains the following code segment. 

string SQL = string.Format ("SELECT * FROM Customer WHERE CompanyName LIKE '%{0}%'", companyName); 

var cmd = new SqlCommand(SQL, con); 

You need to reduce the vulnerability to SQL injection attacks. Which code segment should you use? 

A. string SQL = "SELECT * FROM Customer WHERE " + 

"CompanyName LIKE @companyName"; 

var cmd = new SqlCommand(SQL, con); 

cmd.Parameters.AddWithValue("@companyName", 

string.Format("%{0}%", companyName)); 

B. string SQL = "SELECT * FROM Customer WHERE " + 

"CompanyName LIKE @companyName"; 

var cmd = new SqlCommand(SQL, con); 

var param = new SqlParameter("@companyName", 

string.Format("%{0}%", companyName)); 

C. string SQL = string.Format("SELECT * FROM " + 

"Customer WHERE CompanyName LIKE {0}", 

new SqlParameter("@companyName", 

string.Format("%{0}%", companyName))); 

var cmd = new SqlCommand(SQL, con); 

D. string SQL = "SELECT * FROM Customer @companyName"; 

var cmd = new SqlCommand(SQL, con); 

cmd.Parameters.AddWithValue("@companyName", 

string.Format("WHERE CompanyName LIKE '%{0}%'", 

companyName)); 

Answer:

Explanation: 

SqlParameterCollection.AddWithValue Method (http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparametercollection.addwithvalue.aspx) 


Q237. - (Topic 3) 

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application retrieves data from a Microsoft SQL Server 2008 database named AdventureWorks. The AdventureWorks.dbo.ProductDetails table contains a column named ProductImages that uses a varbinary(max) data type. 

You write the following code segment. (Line numbers are included for reference only.) 

01 Dim reader As SqlDataReader = command.ExecuteReader( 

03 ) 

04 While reader.Read() 

05 pubID = reader.GetString(0) 

06 ... 

07 stream = New FileStream() 

08 writer = New BinaryWriter(stream) 

09 startIndex = 0 

10 retval = reader.GetBytes(1, startIndex, outByte, 0, bufferSize) 

11 ... 

12 While retval = bufferSize 

13 End While 

14 writer.Write(outByte, 0, DirectCast(retval, Integer) - 1) 

15 writer.Flush() 

16 writer.Close() 

17 stream.Close() 

18 End While 

You need to ensure that the code supports streaming data from the ProductImages column. 

Which code segment should you insert at line 02? 

A. CommandBehavior.[Default] 

B. CommandBehavior.KeyInfo 

C. CommandBehavior.SingleResult 

D. CommandBehavior.SequentialAccess 

Answer:

Explanation: 

Default The query may return multiple result sets. Execution of the query may affect the database state. 

Default sets no CommandBehavior flags, so calling 

ExecuteReader(CommandBehavior.Default) 

is functionally equivalent to calling ExecuteReader(). 

KeyInfo The query returns column and primary key information. When KeyInfo is used for 

command execution, the provider will append extra columns to the result set for existing 

primary key and timestamp columns. 

SingleResult The query returns a single result set. 

SequentialAccess Provides a way for the DataReader to handle rows that contain columns 

with large binary values. 

Rather than loading the entire row, SequentialAccess enables the DataReader to load data 

as a stream. 

You can then use the GetBytes or GetChars method to specify a byte location to start the 

read operation, and a limited buffer size for the data being returned. 

CommandBehavior Enumeration 

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


Q238. - (Topic 5) 

Ensure that SSDL can be modified without rebuilding application. 

A. res://*/Model.csdl | ... (rest of files) copy to output directory 

B. .(backslash)Model.csdl | ... (rest of files) embeded in output assembly 

C. res://*/Model.csdl | ... (rest of files) embeded in output assembly 

D. .(backslash)Model.csdl | ... (rest of files) copy to output directory 

Answer:


Q239. - (Topic 4) 

The entity data model must be configured to provide a way to call the sp_FindObsolete stored procedure. The returned data must implement the Descendants property. 

In Visual Studio 2010, you open the Add Function Import dialog box from the EDMX diagram and enter the information shown in the following graphic. 

You need to complete the configuration in the dialog box. 

What should you do? 

A. In the Returns a Collection Of area, click Scalars and then, in the Scalars list, click Int32. 

B. In the Returns a Collection Of area, click Scalars and then, in the Scalars list, click String. 

C. Click the Get Column Information button, click Create New Complex Type and then, in the Complex box, enter Parts. 

D. In the Returns a Collection Of area, click Entities and then, in the Entities list, click Component. 

Answer:


Q240. - (Topic 3) 

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Microsoft 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 Dim config As Configuration = Conf igurationManager .OpenExeConf iguratlon(exeConf igName) 

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. Dim section As ConnectionStringsSection _ TryCast(config.GetSection("connectionString"), ConnectionStringsSection) section.Sectionlnformation.ProtectSection("DataProtectionConfigurationProvider") 

B. Dim section As ConnectionStcingsSection = TryCast(config.GetSecion("connectionStrings"), ConnectionStringsSection) section.Sectionlnformation.ProtectSection("RsaProtectedConf igurationProvider") 

C. Dim section As ConnectionStringsSection = TryCast(config.GetSection("connectionString") ConnectionStringsSection) section.Sectionlnformation.ProtectSection("RsaProtectedConfigurationProvider") 

D. Dim section As ConnectionStringsSection = TryCast(config.GetSection("connectionStrings"), ConnectionStringsSection) section.Sectionlnformation.ProtectSection("DataProtectionConfigurationProvider") 

Answer:

Explanation: 

You encrypt and decrypt the contents of a Web.config file by using System.Configuration . DPAPIProtectedConfigurationProvider, which uses the Windows Data Protection API (DPAPI) to encrypt and decrypt data, or System.Configuration. RSAProtectedConfigurationProvider, which uses the RSA encryption algorithm to encrypt and decrypt data. When you use the same encrypted configuration file on many computers in a Web farm, only System.Configuration.RSAProtectedConfigurationProvider enables you to export the encryption keys that encrypt the data and import them on another server. This is the default setting. 

CHAPTER 2 ADO.NET Connected Classes Lesson 1: Connecting to the Data Store Storing Encrypted Connection Strings in Web Applications (page 76) Securing Connection Strings (http://msdn.microsoft.com/en-us/library/89211k9b(v=vs.80).aspx) 



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