web analytics

Free Share The Newest Microsoft MCTS Exam Questions And Answers From PassLeader

[Pass Ensure VCE Dumps] Best 286q PassLeader 70-516 Exam Dumps Help Passing Exam Easily (21-40)

100% Valid Dumps For 70-516 Exam Pass: PassLeader have been updated the 286q 70-516 exam dumps and added the new exam questions, in the latest version of 70-516 PDF dumps or VCE dumps, you will get all the new changed 286q 70-516 exam questions, which will help you 100% passing 70-516 exam, and you will get the free version of VCE Player together with your 70-516 VCE dumps. Welcome to visit our website — passleader.com and get your 70-516 exam passed easily!

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 21
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 stores user names and passwords in the database. You need to ensure that users cannot read passwords extracted from the database. What should you do?

A.    Encrypt stored passwords by using the RC2CryptoServiceProvider class.
B.    Encrypt stored passwords by using the TripleDESCryptoServiceProvider class.
C.    Append a random salt to the password by using the RNGCryptoServiceProvider class. Encrypt stored passwords by using the RijndaelManaged class.
D.    Append a random salt to the password by using the RNGCryptoServiceProvider class. Hash stored passwords by using the SHA1CryptoServiceProvider class.

Answer: D
Explanation:
SHA1CryptoServiceProvider Class Computes the SHA1 hash value for the input data using the implementation provided by the cryptographic service provider (CSP). This class cannot be inherited.
SHA1CryptoServiceProvider Class
http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha1cryptoserviceprovider.aspx
CHAPTER 8 Developing Reliable Applications
Lesson 3: Protecting Your Data
Hashing and Salting (page 550-551)

QUESTION 22
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 stores encrypted credit card numbers in the database. You need to ensure that credit card numbers can be extracted from the database. Which cryptography provider should you use?

A.    DSACryptoServiceProvider
B.    AESCryptoServiceProvider
C.    MD5CryptoServiceProvider
D.    SHA1CryptoServiceProvider

Answer: B
Explanation:
AESCryptoServiceProvider Performs symmetric encryption and decryption using the Cryptographic Application Programming Interfaces (CAPI) implementation of the Advanced Encryption Standard (AES) algorithm.
DSACryptoServiceProvider Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the DSA algorithm. This class cannot be inherited. MD5CryptoServiceProvider Computes the MD5 hash value for the input data using the implementation provided by the cryptographic service provider (CSP). This class cannot be inherited.
SHA1CryptoServiceProvider Computes the SHA1 hash value for the input data using the implementation provided by the cryptographic service provider (CSP).
This class cannot be inherited.
DSACryptoServiceProvider
http://msdn.microsoft.com/en-us/library/system.security.cryptography.dsacryptoserviceprovider.aspx
AESCryptoServiceProvider
http://msdn.microsoft.com/en-us/library/system.security.cryptography.aescryptoserviceprovider.aspx
MD5CryptoServiceProvider
http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5cryptoserviceprovider.aspx
SHA1CryptoServiceProvider Class
http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha1cryptoserviceprovider.aspx

QUESTION 23
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Microsoft ASP.NET application. The application connects to a Microsoft SQL Server database. The application is hosted on a Web server along with other applications. You need to secure the transmission of data between the application and the database. You need to achieve this goal without affecting other applications. What should you do?

A.    Encrypt the connection string.
B.    Use encryption to store sensitive data in the database.
C.    Use Secure Sockets Layer (SSL) to establish connections to the database.
D.    Use Internet Protocol Security (IPSec) to secure the communication channel.

Answer: C
Explanation:
SSL is an established standard for ensuring secure HTTP transactions.
SSL provides a mechanism to perform up to 128-bit encryption on all transactions between the client and server.
It enables the client to verify that the server belongs to a trusted entity through the use of server certificates.
It also enables the server to confirm the identity of the client with client certificates.
Each of these issues–encryption, server identity, and client identity–are negotiated in the SSL handshake that occurs when a client first requests a resource from a Secure Hypertext Transfer Protocol (HTTPS) server. Essentially, the client and server each present a list of required and preferred settings.
If a common set of requirements can be agreed upon and met, an SSL connection is established.
Internet Protocol Security (IPsec) is a set of security protocols used to transfer IP packets confidentially across the Internet.
IPsec is mandatory for all IPv6 implementations and optional for IPv4.
An IPsec policy is a set of rules that determine which type of IP traffic needs to be secured using IPsec and how to secure that traffic.
Only one IPsec policy is active on a computer at one time.

QUESTION 24
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. The application allows users to make changes to entities while disconnected from the central data store. You need to ensure that when the user connects to the central data store and retrieves new data, the application meets the following requirements:
– Changes made to the local data store in disconnected mode are preserved.
– Entities that have already been loaded into the local data store, but have not been modified by the user, are updated with the latest data.
What should you do?

A.    Call the query’s Execute method by using the MergeOptions.AppendOnly option.
B.    Call the query’s Execute method by using the MergeOptions.OverwriteChanges option.
C.    Call the Refresh method of ObjectContext by using the RefreshMode.StoreWins option.
D.    Call the Refresh method of ObjectContext by using the RefreshMode.ClientWins option.

Answer: D

QUESTION 25
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 persistence-ignorant entities. The application operates in a disconnected mode. You need to ensure that changes made to local entities while the application is in the disconnected mode are correctly persisted. Which method should you call before persisting changes?

A.    ObjectContext.Refresh
B.    DataContext.AcceptAllChanges
C.    ObjectStateEntry.AcceptChanges
D.    ObjectStateEntry.SetModifiedProperty

Answer: D
Explanation:
ObjectStateEntry.SetModifiedProperty(string propertyName) Method Marks the specified property as modified.

QUESTION 26
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 deploy an application to a production server. The application uses the model and mapping files that are deployed as application resources. You need to update the conceptual model for the application on the production server. What should you do?

A.    Copy the updated .edmx file to the production server.
B.    Copy the updated .csdl file to the production server.
C.    Copy the updated .ssdl file to the production server.
D.    Recompile the application and redeploy the modified assembly file.

Answer: D

QUESTION 27
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 need to ensure that the model and mapping files are not deployed as application resources. What should you do?

A.    Modify the connection string in the application’s .config file to refer to the absolute physical path to the .edmx file.
B.    Modify the connection string in the application’s .config file to refer to the relative path to the .edmx file.
C.    Set the value of the .edmx file’s Metadata Artifact Processing property to Copy to Output Directory.
D.    Set the value of the .edmx file’s Build Action property to Copy to Output.

Answer: C

QUESTION 28
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application updates several Microsoft SQL Server databases within a single transaction. You need to ensure that after a resource failure, you can manage unresolved transactions. What should you do?

A.    Call the EnlistVolatile method of the Transaction class.
B.    Call the EnlistDurable method of the Transaction class.
C.    Call the Reenlist method of the TransactionManager class.
D.    Call the RecoveryComplete method of the TransactionManager class.

Answer: C
Explanation:
Enlisting Resources as Participants in a Transaction
http://msdn.microsoft.com/en-us/library/ms172153.aspx
Implementing a Resource Manager
http://msdn.microsoft.com/en-us/library/ms229975.aspx
Committing a Transaction in Single-Phase and Multi-Phase
http://msdn.microsoft.com/en-us/library/ckawh9ct.aspx
TransactionManager.Reenlist() Reenlists a durable participant in a transaction.
A resource manager facilitates resolution of durable enlistments in a transaction by reenlisting the transaction participant after resource failure.
Transaction.EnlistVolatile() Enlists a volatile resource manager to participate in a transaction. Volatile resource managers cannot recovery from failure to complete a transaction in which they were participating.
Transaction.EnlistDurable() Enlists a durable resource manager to participate in a transaction.
TransactionManager.RecoveryComplete() Notifies the transaction manager that a resource manager recovering from failure has finished reenlisting in all unresolved transactions.
All durable resource managers should do recovery when they first start up by calling the Reenlist method for each outstanding transaction. Only when all of the reenlistments are done should the resource manager call RecoveryComplete.
TransactionManager.Reenlist() Method
http://msdn.microsoft.com/en-us/library/system.transactions.transactionmanager.reenlist.aspx
Transaction.EnlistVolatile() Method
http://msdn.microsoft.com/en-us/library/system.transactions.transaction.enlistvolatile.aspx
Transaction.EnlistDurable()
http://msdn.microsoft.com/en-us/library/system.transactions.transaction.enlistdurable.aspx
TransactionManager.RecoveryComplete() Method
http://msdn.microsoft.com/en-us/library/system.transactions.transactionmanager.recoverycomplete.aspx

QUESTION 29
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to several SQL Server databases. You create a function that modifies customer records that are stored in multiple databases. All updates for a given record are performed in a single transaction. You need to ensure that all transactions can be recovered. What should you do?

A.    Call the EnlistVolatile method of the Transaction class.
B.    Call the EnlistDurable method of the Transaction class.
C.    Call the Reenlist method of the TransactionManager class.
D.    Call the RecoveryComplete method of the TransactionManager class.

Answer: B
Explanation:
Volatile resource managers cannot recovery from failure to complete a transaction in which they were participating. To obtain a durable enlistment in a transaction, use the EnlistDurable method. For more information on volatile and durable resources, as well as how to enlist a resource, see Implementing A Resource Manager. For more information on how a resource manager responds to commit notification and prepare the commit, see Committing A Transaction In Single-Phase and Multi-Phase.
http://msdn.microsoft.com/en-us/library/ms149779.aspx

QUESTION 30
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. The model includes the entity shown in the following exhibit. You need to add a function that returns the number of years since a person was hired. You also need to ensure that the function can be used within LINQ to Entities queries. What should you do?

A.    //Add the following conceptual model function returns the number of years since an
instructor was hired
<Function Name=”YearsSince” ReturnType=”Edm.Int32″>
<Parameter Name=”date” Type=”Edm.DateTime” />
<DefiningExpression>
Year(CurrentDateTime()) – Year(date)
</DefiningExpression>
</Function>
// add the following method to your application and use an EdmFunctionAttribute to map it to
the conceptual model function:
[EdmFunction(“SchoolModel”, “YearsSince”)]
public static int YearsSince(DateTime date){
throw new NotSupportedException(“Direct calls are not supported.”);
}
B.    //Add the following conceptual model function returns the number of years since an instructor
was hired
<Function Name=”YearsSince” ReturnType=”Edm.Int32″>
<Parameter Name=”date” Type=”Edm.DateTime” />
<DefiningExpression>
Year(CurrentDateTime()) – Year(date)
</DefiningExpression>
</Function>
// add the following method to your application and use an EdmFunctionAttribute to map it to
the conceptual model function:
[EdmFunction(“SchoolModel”, “YearsSince”)]
public static int YearsSince(DateTime date){
return CurrentDateTime() – Year(date);
}
C.    //Add the following conceptual model function returns the number of years since an instructor
was hired
<Function Name=”YearsSince” ReturnType=”Edm.Int32″>
<Parameter Name=”date” Type=”Edm.DateTime” />
<DefiningExpression>
YearsSince(DateTime date)
</DefiningExpression>
</Function>
// add the following method to your application and use an EdmFunctionAttribute to map it to
the conceptual model function:
[EdmFunction(“SchoolModel”, “YearsSince”)]
public static int YearsSince(DateTime date){
return CurrentDateTime() – Year(date);
}
D.    Use the Entity Data Model Designer to create a complex property named YearsSinceNow
that can be accessed throuqh the LINQ to Entites query at a Later time

Answer: A
Explanation:
How to: Call Model-Defined Functions in Queries
http://msdn.microsoft.com/en-us/library/dd456857.aspx
How to: Call Model-Defined Functions as Object Methods
http://msdn.microsoft.com/en-us/library/dd456845.aspx


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

QUESTION 31
Which class should you use to manage multiple tables and relationships among them?

A.    DataRow
B.    DataView
C.    DataTable
D.    DataSet

Answer: D

QUESTION 32
You want to set up a primary key on a column. Which properties on the data column must be set? (Each correct answer presents part of a complete solution. Choose three.)

A.    MappingType
B.    AutoIncrementSeed
C.    AutoIncrementStep
D.    AutoIncrement

Answer: BCD

QUESTION 33
If you want to assign a Car object to a column called CarObject, which attribute must be on the Car class to enable saving the data table to a file?

A.    Bindable
B.    DataObject
C.    Serializable
D.    FileIOPermission

Answer: C

QUESTION 34
You are storing custom Car objects in a data table that will be serialized to a file. After serializing to a binary file called cars.bin, you open the file with a binary editor and notice that XML is in the file. Which setting can you use to ensure that you will create a binary file without embedded XML?

A.    Set the BatchUpdate setting to SerializationFormat.Binary.
B.    Set the RemotingFormat property to SerializationFormat.Binary.
C.    Set the DefaultView property to SerializationFormat.Binary.
D.    Set the Constraints property to SerializationFormat.Binary.

Answer: B

QUESTION 35
Which code segment will properly return the TimeSpan returned by the stopWatch variable?

A.    Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
DoSomething();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed; 
string elapsedTime = String.Format(“{0:00}:{1:00}:{2:00}.{3:00}”,
ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
Console.WriteLine(elapsedTime, “RunTime”);
private void DoSomething()
{ … }
B.    Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
DoSomething();
stopWatch.Reset();
TimeSpan ts = stopWatch.Elapsed; 
string elapsedTime = String.Format(“{0:00}:{1:00}:{2:00}.{3:00}”,
ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
Console.WriteLine(elapsedTime, “RunTime”);
private void DoSomething()
{ … }
C.    Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
DoSomething();
TimeSpan ts = stopWatch.Elapsed;
string elapsedTime = String.Format(“{0:00}:{1:00}:{2:00}.{3:00}”,
ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
Console.WriteLine(elapsedTime, “RunTime”);
private void DoSomething()
{ … }
D.    Stopwatch stopWatch = new Stopwatch();
stopWatch.Begin();
DoSomething();
stopWatch.End();
TimeSpan ts = stopWatch.Elapsed; 
string elapsedTime = String.Format(“{0:00}:{1:00}:{2:00}.{3:00}”,
ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
Console.WriteLine(elapsedTime, “RunTime”);
private void DoSomething()
{ … }

Answer: A
Explanation:
Stopwatch Class
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx

QUESTION 36
You are a tasked with performing a code review. The business rule is the following:
– If INSERTs into the first table succeed, then INSERT into the second table.
– However, if the INSERTs into the second table fail, roll back the inserts in the second table but do not roll back the inserts in the first table.
– Although this can also be done by way of regular transactions, It needs to be performed using TransactionScope objects.
Whis code would fit this business rule?

A.    try
{
using (TransactionScope scope1 = new TransactionScope
(TransactionScopeOption)
{
….
Try
{
…..
using (TransactionScope scope2 = new TransactionScope
(TransactionScopeOption))
{ …. }
}
}
}
B.    try
{
using (TransactionScope scope1 = new TransactionScope
(TransactionScopeOption.Required))
{

using (TransactionScope scope2 = new TransactionScope
(TransactionScopeOption.RequiresNew))
{ …. }
……
}
}
C.    try
{
using (TransactionScope scope1 = new TransactionScope
(TransactionScopeOption.Required))
{

}
using (TransactionScope scope2 = new TransactionScope
(TransactionScopeOption.RequiresNew))
{
….
}
}
D.    try
{
using (TransactionScope scope1 = new TransactionScope
(TransactionScopeOption.Required))
{
….
Try
{
…..
using (TransactionScope scope2 = new TransactionScope
(TransactionScopeOption.RequiresNew))
{ …. }
}
}
}

Answer: D
Explanation:
Required A transaction is required by the scope. It uses an ambient transaction if one already exists. Otherwise, it creates a new transaction before entering the scope. This is the default value. RequiresNew A new transaction is always created for the scope. Suppress The ambient transaction context is suppressed when creating the scope. All operations within the scope are done without an ambient transaction context.
Transaction Scope (EXAMPLE 3)
http://msdn.microsoft.com/en-us/library/bb896149%28SQL.100%29.aspx
TransactionScopeOption Enumeration
http://msdn.microsoft.com/en-us/library/system.transactions.transactionscopeoption.aspx

QUESTION 37
Which method will return all nodes of an XDocument?

A.    doc.DescendantNodes();
B.    doc.Descendants();
C.    doc.Root.Allnodes();
D.    doc.GetAllnodes();

Answer: A
Explanation:
public IEnumerable<XNode> DescendantNodes()
Returns a collection of the descendant nodes for this document or element, in document order.
public IEnumerable<XElement> Descendants()
Returns a collection of the descendant elements for this document or element, in document order.

QUESTION 38
Which one of these samples it the correct way to close the connection using Command Behavior?

A.    SqlDataReader rdr = new SqlDataReader();   
string sql = @”sql statement”;
SqlConnection conn = connection.GetConnection();
SqlCommand cmd = new SqlCommand(sql, conn);
SqlDataReader rdr = cmd.ExecuteReader
(CommandBehavior.CloseConnection);
Console.WriteLine(“{0}”, rdr);
B.    SqlDataReader rdr = new SqlDataReader();   
string sql = @”sql statement”;
SqlConnection conn = connection.GetConnection();
SqlCommand cmd = new SqlCommand(sql, conn);
SqlDataReader rdr = cmd.ExecuteReader
(CommandBehavior.CloseConnection);
rdr.Close();
Console.WriteLine(“{0}”, rdr);
C.    SqlDataReader rdr = new SqlDataReader();   
string sql = @”sql statement”;
SqlConnection conn = connection.GetConnection();
SqlCommand cmd = new SqlCommand(sql, conn);
SqlDataReader rdr = cmd.ExecuteReader
(CommandBehavior.CloseConnection);
conn.Close();
Console.WriteLine(“{0}”, rdr);
D.    using (SqlDataReader rdr = new SqlDataReader())

   string sql = @”sql statement”;
   SqlConnection conn = connection.GetConnection();
   SqlCommand cmd = new SqlCommand(sql, conn);
   SqlDataReader rdr = cmd.ExecuteReader
(CommandBehavior.CloseConnection);
   Console.WriteLine(“{0}”, rdr);
}

Answer: B

QUESTION 39
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 database table named ProductCatalog as shown in the exhibit. You add the following code segment to query the first row of the ProductCatalog table. (Line numbers are included for reference only.)
01 using(SqlConnection cnx = new SqlConnection(connString)
02 {
03 var command = cnx.CreateCommand();
04 command.CommandType = CommandType.Text;
05 command.CommandText = “SELECT TOP 1 * FROM dbo.ProductCatalog”;
06 cnx.Open();
07 var reader = command.ExecuteReader();
08 if (reader.Read())
09 {
10 var id = reader.GetInt32(0);
11 …
12 reader.Close();
13 }
14 }
Which answer belongs in line 11?

 
A.    var weight = reader.GetDouble(1);
var price = reader.GetDecimal(2);
var status = reader.GetBoolean(3);
B.    var weight  = reader.GetFloat(1);
var price = reader.GetDecimal(2);
var status  = reader.GetByte(3);
C.    var weight = reader.GetDouble(1);
var price = reader.GetFloat(2);
var status = reader.GetBoolean(3);
D.    var weight = reader.GetFloat(1);
var price = reader.Doublel(2);
var status = reader.GetByte(3);

Answer: A

QUESTION 40
You have been assigned the task of writing code that executes an Entity SQL query that returns entity type objects that contain a property of a complex type. (Line numbers are included for reference only.)
01 using (EntityCommand cmd = conn.CreateCommand())
02 {
03 cmd.CommandText = esqlQuery;
04 EntityParameter param = new EntityParameter();
05 param.ParameterName = “id”;
06 param.Value = 3;
07 cmd.Parameters.Add(param);
08 using (EntityDataReader rdr = cmd.ExecuteReader(CommandBehavior.SequentialAccess))
09 {
10 while (rdr.Read())
11 {
12 …
13 Console.WriteLine(“Email and Phone Info:”);
14 for (int i = 0; i < nestedRecord.FieldCount; i++)
15 {
16 Console.WriteLine(” ” + nestedRecord.GetName(i) + “: ” + nestedRecord.GetValue(i));
17 }
18 }
19 }
20 }
Which code segment should you insert at line 12?

A.    DbDataRecord nestedRecord = rdr[“EmailPhoneComplexProperty”]
as DbDataRecord;
B.    DbDataRecord nestedRecord = rdr[“EmailPhoneComplexProperty”]
C.    DataSet nestedRecord = rdr[“EmailPhoneComplexProperty”]
as ComplexDataSet
D.    ComplexDataRecord nestedRecord = rdr[“EmailPhoneComplexProperty”]

Answer: A
Explanation:
How to: Execute a Query that Returns Complex Types
http://msdn.microsoft.com/en-us/library/bb896329.aspx
using (EntityConnection conn = new EntityConnection(ConfigurationManager.ConnectionStrings [“StoreConnection”].ConnectionString))
{
using (EntityCommand comm = conn.CreateCommand()) {
// Here StoreConnection-ObjectContext name, Customers-correct DataSet name comm.CommandText = “Select Customers.CustomerID, Customers.Name, Customers.Address
from StoreConnection.Customers where Customers.CustomerID=@qqqCustomerID”;
EntityParameter param = new EntityParameter(“qqqCustomerID”, DbType.Int32);
param.Value = 1;
comm.Parameters.Add(param);
conn.Open();
var reader = comm.ExecuteReader(CommandBehavior.SequentialAccess);
while (reader.Read())
{
DbDataRecord record = reader[“Address”] as DbDataRecord;
for (int i = 0; i < record.FieldCount; i++)
{
name.Text += “<br/>” + record.GetName(i) + ” : ” + record.GetValue(i).ToString(); }
}
reader.Close();
}
}


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