This page was exported from All The Latest MCTS Exam Questions And Answers For Free Share [ https://www.mctsdump.com ] Export date:Fri Mar 29 11:48:28 2024 / +0000 GMT ___________________________________________________ Title: [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 21You 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: DExplanation: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 Classhttp://msdn.microsoft.com/en-us/library/system.security.cryptography.sha1cryptoserviceprovider.aspxCHAPTER 8 Developing Reliable ApplicationsLesson 3: Protecting Your DataHashing and Salting (page 550-551) QUESTION 22You 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.    DSACryptoServiceProviderB.    AESCryptoServiceProviderC.    MD5CryptoServiceProviderD.    SHA1CryptoServiceProvider Answer: BExplanation: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.DSACryptoServiceProviderhttp://msdn.microsoft.com/en-us/library/system.security.cryptography.dsacryptoserviceprovider.aspxAESCryptoServiceProviderhttp://msdn.microsoft.com/en-us/library/system.security.cryptography.aescryptoserviceprovider.aspxMD5CryptoServiceProviderhttp://msdn.microsoft.com/en-us/library/system.security.cryptography.md5cryptoserviceprovider.aspxSHA1CryptoServiceProvider Classhttp://msdn.microsoft.com/en-us/library/system.security.cryptography.sha1cryptoserviceprovider.aspx QUESTION 23You 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: CExplanation: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 24You 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 25You 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.RefreshB.    DataContext.AcceptAllChangesC.    ObjectStateEntry.AcceptChangesD.    ObjectStateEntry.SetModifiedProperty Answer: DExplanation:ObjectStateEntry.SetModifiedProperty(string propertyName) Method Marks the specified property as modified. QUESTION 26You 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 27You 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 28You 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: CExplanation:Enlisting Resources as Participants in a Transaction http://msdn.microsoft.com/en-us/library/ms172153.aspxImplementing a Resource Managerhttp://msdn.microsoft.com/en-us/library/ms229975.aspxCommitting a Transaction in Single-Phase and Multi-Phasehttp://msdn.microsoft.com/en-us/library/ckawh9ct.aspxTransactionManager.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() Methodhttp://msdn.microsoft.com/en-us/library/system.transactions.transactionmanager.reenlist.aspxTransaction.EnlistVolatile() Methodhttp://msdn.microsoft.com/en-us/library/system.transactions.transaction.enlistvolatile.aspxTransaction.EnlistDurable()http://msdn.microsoft.com/en-us/library/system.transactions.transaction.enlistdurable.aspxTransactionManager.RecoveryComplete() Methodhttp://msdn.microsoft.com/en-us/library/system.transactions.transactionmanager.recoverycomplete.aspx QUESTION 29You 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: BExplanation: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 30You 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: AExplanation:How to: Call Model-Defined Functions in Querieshttp://msdn.microsoft.com/en-us/library/dd456857.aspxHow to: Call Model-Defined Functions as Object Methodshttp://msdn.microsoft.com/en-us/library/dd456845.aspx http://www.passleader.com/70-516.html QUESTION 31Which class should you use to manage multiple tables and relationships among them? A.    DataRowB.    DataViewC.    DataTableD.    DataSet Answer: D QUESTION 32You 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.    MappingTypeB.    AutoIncrementSeedC.    AutoIncrementStepD.    AutoIncrement Answer: BCD QUESTION 33If 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.    BindableB.    DataObjectC.    SerializableD.    FileIOPermission Answer: C QUESTION 34You 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 35Which 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: AExplanation:Stopwatch Classhttp://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx QUESTION 36You 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: DExplanation: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.aspxTransactionScopeOption Enumerationhttp://msdn.microsoft.com/en-us/library/system.transactions.transactionscopeoption.aspx QUESTION 37Which method will return all nodes of an XDocument? A.    doc.DescendantNodes();B.    doc.Descendants();C.    doc.Root.Allnodes();D.    doc.GetAllnodes(); Answer: AExplanation: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 38Which 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 39You 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 40You 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 ComplexDataSetD.    ComplexDataRecord nestedRecord = rdr["EmailPhoneComplexProperty"] Answer: AExplanation:How to: Execute a Query that Returns Complex Typeshttp://msdn.microsoft.com/en-us/library/bb896329.aspxusing (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.Addressfrom 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 --------------------------------------------------- Images: --------------------------------------------------- --------------------------------------------------- Post date: 2015-11-27 07:32:45 Post date GMT: 2015-11-27 07:32:45 Post modified date: 2015-11-27 07:32:46 Post modified date GMT: 2015-11-27 07:32:46 ____________________________________________________________________________________________ Export of Post and Page as text file has been powered by [ Universal Post Manager ] plugin from www.gconverters.com