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)
Braindump2go New Released 70-516 Exam Dumps Questions New Updated Today: Latest 286 Questions and Answers Explanation. Guarantee you 100% Success when you attend Microsoft MCM 70-516 Exam! We update 70-516 Exam Dumps Questions every day and you can come to download our latest 70-516 Practice Tests daily!
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 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
Explanation:
An alternative to explicitly closing the Connection is to pass
CommandBehavior.CloseConnection to the ExecuteReader method to ensure that the associated connection is closed when the DataReader is closed. This is especially useful if you are returning a DataReader from a method and do not have control over the closing of the DataReader or associated connection. When you close the data reader and you use CommandBehavior.CloseConnection-the SQLconnection also closes http://msdn.microsoft.com/en-us/library/ms971481.aspx
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();
}
}
100% Full Money Back Guarantee Promised By Braindump2go to All 70-516 Exam Candiates: Braindump2go is confident that our NEW UPDATED 70-516 Exam Questions and Answers are changed with Microsoft Official Exam Center, If you cannot PASS 70-516 Exam, nevermind, we will return your full money back! Visit Braindump2go exam dumps collection website now and download 70-516 Exam Dumps Instantly Today!
FREE DOWNLOAD: NEW UPDATED 70-516 PDF Dumps & 70-516 VCE Dumps from Braindump2go: http://www.braindump2go.com/70-516.html (286 Q&A)