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 VE&70-516 PDF Dumps: http://www.braindump2go.com/70-516.html (286 Q&As)
Microsoft Official Exam Center New Released 70-516 Dumps Questions, Many New Questions added into it! Braindump2go Offer Free Sample Questions and Answers for Download Now! Visit Our Webiste, get the new updated Questions then pass Microsoft 70-516 at the first try!
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 211
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.
You add the following store procedure to the database.
CREATE PROCEDURE GetSalesPeople
AS
BEGIN
SELECT FirstName, LastName, Suffix, Email, Phone
FROM SalesPeople
END
You write the following code segment. (Line numbers are included for reference only.)
01 SqlConnection connection = new SqlConnection(“…”);
02 SqlCommand command = new SqlCommand(“GetSalesPeople”, connection);
03 command.CommandType = CommandType.StoredProcedure;
04 …
You need to retreive all of the results from the stored procedure.
Which code segment should you insert at line 04?
A. var res = command.ExecuteReader();
B. var res = command.ExecuteScalar();
C. var res = command.ExecuteNonQuery();
D. var res = command.ExecuteXmlReader();
Answer: A
Explanation:
ExecuteReader Sends the CommandText to the Connection and builds a SqlDataReader.
SqlCommand Class
(http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx)
QUESTION 212
The Entity Data Model file (.edmx file) must be updated to support inheritance mapping for Products and Componets.
You need to add the following code to the \Model\Model.edmx file:
– the code in line EX243 that maps the Product type
– the code in line EX250 that maps the Component type
What should you do?
A. Insert the following code at line EX243:
<Condition ColumnName=”ProductType” IsNull=”false” />
Insert the following code at line EX250:
<Condition ColumnName=”PartType” IsNull=”false” />
B. Insert the following code at line EX243:
<Condition ColumnName=”ProductType” IsNull=”true” />
Insert the following code at line EX250:
<Condition ColumnName=”PartType” IsNull=”true” />
C. Insert the following code at line EX243:
<Condition ColumnName=”ProductType” IsNull=”false” />
Insert the following code at line EX250:
<Condition ColumnName=”PartType” IsNull=”true” />
D. Insert the following code at line EX243:
<Condition ColumnName=”ProductType” IsNull=”true” />
Insert the following code at line EX250:
<Condition ColumnName=”PartType” IsNull=”false” />
Answer: A
QUESTION 213
A performance issue exists in the application.
The following code segment is causing a performance bottleneck:
var colors = context.Parts.GetColors();
You need to improve application performance by reducing the number of database calls.
Which code segment should you use?
A. var colors = context.Parts.OfType<Product>().
Include(“Colors”).GetColors();
B. var colors = context.Parts.OfType<Product>().
Include(“Product.Color”).GetColors();
C. var colors = context.Parts.OfType<Product>().
Include(“Parts.Color”).GetColors();
D. var colors = context.Parts.OfType<Product>().
Include(“Color”).GetColors();
Answer: D
QUESTION 214
The application must be configured to run on a new development computer.
You need to configure the connection string to point to the existing named instance.
Which connection string fragment should you use?
A. Data Source=INST01\SQL01
B. Initial Catalog= SQL01\INST01
C. Data Source=SQL01\INST01
D. Initial Catalog= INST01\SQL01
Answer: C
QUESTION 215
You have an existing ContosoEntities context object named context.
Calling the SaveChanges() method on the context object generates an exception that has the following inner exception:
System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object ‘dbo.Colors’ with unique index ‘IX_Colors’.
You need to ensure that a call to SaveChanges() on the context object does not generate this exception.
What should you do?
A. Examine the code to see how Color objects are allocated.
Replace any instance of the new Color() method with a call to the
ContosoEntities.LoadOrCreate() method.
B. Add a try/catch statement around every call to the SaveChanges() method.
C. Remove the unique constraint on the Name column in the Colors table.
D. Override the SaveChanges() method on the ContosoEntities class,
call the ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Added) method,
and call the AcceptChanges() method on each ObjectStateEntry object it returns
Answer: A
QUESTION 216
Refer to the following lines in the case study: PA40 in \Model\Part.cs, PR16 in\Model\Product.cs, and CT14 in \Model\Component.cs
The application must create XML files that detail the part structure for any product.
The XML files must use the following format:
<?xml version=”1.0″ encoding=”utf-8″?>
<product name=”Brush” description=”Brush product” productType=”1″>
<component name=”Handle” description=”Handle” partType=”2″>
<component name=”Screw” description=”Screw” partType=”3″>
<component name=”Wood” description=”Wooden shaft” partType=”45″>
</component>
<component name=”Head” description=”Head” partType=”5″>
<component name=”Screw” description=”Screw” partType=”3″>
<component name=”Bristles” description=”Bristles” partType=”4″>
</component>
</product>
You need to update the application to support the creation of an XElement object having a structure that will serialize to the format shown above.
What should you do? (Each correct answer presents part of the solution. Choose two.)
A. Insert the following code segment at line PR16 in \Model\Product.cs:
return new XElement(“product, new XAttribute(“name”, this.Name),
new XElement(“description”, this.Description),
new XElement(“productType”, this.ProductType));
B. Insert the following code segment at line CT14 in \Model\Component.cs:
return new XElement(“component, new XElement(“name”, this.Name),
new XElement(“description”, this.Description),
new XElement(“partType”, this.PartType));
C. Insert the following code segment at line PR16 in \Model\Product.cs:
return new XElement(“product, new XElement(“name”, this.Name),
new XElement(“description”, this.Description),
new XElement(“productType”, this.ProductType));
D. Insert the following code segment at line PR16 in \Model\Product.cs:
return new XElement(“product, new XAttribute(“name”, this.Name),
new XAttribute(“description”, this.Description),
new XAttribute(“productType”, this.ProductType));
E. Insert the following code segment at line CT14 in \Model\Component.cs:
return new XElement(“component, new XAttribute(“name”, this.Name),
new XElement(“description”, this.Description),
new XElement(“partType”, this.PartType));
F. Insert the following code segment at line CT14 in \Model\Component.cs:
return new XElement(“component, new XAttribute(“name”, this.Name),
new XAttribute(“description”, this.Description),
new XAttribute(“partType”, this.PartType));
Answer: DF
QUESTION 217
You need to ensure that an exception is thrown when color names are set to less than two characters.
What should you do?
A. Add the following method to the Color partial class in Model\Color.cs:
protected overrride void OnPropertyChanged(string property)
{
if (property == “Name” && this.Name.Length < 2)
throw new ArgumentOutOfRangeException
(“Name must be at least two characters”);
}
B. Add the following code segment to the ContosoEntities partial class in Model\ContosoEntities.cs:
public override in SaveChanges(System.Data.Objects.SaveOptions options)
{
var changes = this.ObjectStateManager.GetObjectSateEntries
(System.Data.EntityState.Added);
foreach (var change in changes)
{
if (change.Entity is Color)
if (((Color)change.Entity.Name.Length < 2)
throw new ArgumentException(“Name too short”);
}
return base.SaveChanges(options);
}
C. Add the following attribute to the Name property of the Color class in the entity designer file:
[StringLength(256, MinimumLength = 2)]
D. Add the following method to the Color partial class in Model\Color.cs:
protected overrride void OnPropertyChanging(string property)
{
if (property == “Name” && this.Name.Length < 2)
throw new ArgumentOutOfRangeException
(“Name must be at least two characters”);
}
Answer: A
QUESTION 218
Drag and Drop Question
You are developing an application that updates entries in a Microsoft SQL Server table named Orders.
You need to ensure that you can update the rows in the Orders table by using optimistic concurrency.
What code should you use? (To answer, drag the appropriate properties to the correct locations. Each property may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
Answer:
QUESTION 219
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that uses the Entity Framework.
The appl cat on 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. Option A
B. Option B
C. Option C
D. Option D
Answer: D
QUESTION 220
You are developing a Microsoft .NET Framework 4 application.
You need to collect performance data to the event log after the application is deployed to the production environment.
Which two components should you include in the project? (Each correct answer presents part of the solution. Choose two.)
A. A trace listener
B. A debug listener
C. Debug.Asset() statements
D. Debug.WriteLine() statements
E. Trace.WriteLine() statements
Answer: BC
Explanation:
Tracing is a way for you to monitor the execution of your application while it is running.
Example:
For example, suppose you set up two listeners:
a TextWriterTraceListener and an EventLogTraceListener.
Each listener receives the same message.
The TextWriterTraceListener would direct its output to a stream, and the EventLogTraceListener would direct its output to an event log.
The following example shows how to send output to the Listeners collection.
C#VB
// Use this example when debugging.
System.Diagnostics.Debug.WriteLine(“Error in Widget 42”);
// Use this example when tracing.
System.Diagnostics.Trace.WriteLine(“Error in Widget 42”);
Want to be 70-516 certified? Using Braindump2go New Released 70-516 Exam Dumps Now! We Promise you a 100% Success Passing Exam 70-516 Or We will return your money back instantly!
FREE DOWNLOAD: NEW UPDATED 70-516 PDF Dumps & 70-516 VCE Dumps from Braindump2go: http://www.braindump2go.com/70-516.html (286 Q&A)