Microsoft TS: Accessing Data with Microsoft .NET Framework 4 Sample Questions:
1. 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="false" />
Insert the following code at line EX250:
<Condition ColumnName="PartType" IsNull="true" />
C) Insert the following code at line EX243:
<Condition ColumnName="ProductType" IsNull="true" />
Insert the following code at line EX250:
<Condition ColumnName="PartType" IsNull="false" />
D) Insert the following code at line EX243:
<Condition ColumnName="ProductType" IsNull="true" />
Insert the following code at line EX250:
<Condition ColumnName="PartType" IsNull="true" />
2. You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
You create an Entity Data Model (EDM) by using the Microsoft ADO.NET Entity Data Model Designer (Entity
Designer).
The EDM contains a complex type. You need to map a stored procedure to the complex type by using the
Entity Designer.
What should you do?
A) Add an association to the stored procedure.
B) Add an entity that mirrors the properties of the complex type.
C) Add a code generation item that has the name of the stored procedure.
D) Add a function import for the stored procedure.
3. 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 XAttribute("description", this.Description),
new XAttribute("productType", this.ProductType));
B) 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));
C) 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));
D) 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));
E) 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));
F) 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));
4. You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application. A file named books.xml contains the following XML.
<bib>
<book title="Programming in Unix" year="1992">
<author>Author1</author>
<author>Author2</author>
<author> Author 3 </author>
</book> </bib>
The application must generate an XML result that contains an XML element named BookTitle for each
book. The text content of the element must contain the title of the book.
You need to create a query that generates the new XML result. What should you do?
A) XDocument document = XDocument.Load("books.xml");
var query = from node in document.Descendants()
where node.Name.LocalName == "book"
select new XElement("BookTitle", node.FirstAttribute.Value);
B) XDocument document = XDocument.Load("books.xml");
var query = from node in document.Descendants()
where node.Name.LocalName == "book"
select new XElement("BookTitle").Value = node.FirstAttribute.Value;
C) XDocument document = XDocument.Load("books.xml");
var query = from node in document.DescendantNodes()
where node.ToString() == "book"
select new XElement("BookTitle", node.ToString());
D) XDocument document = XDocument.Load("books.xml");
var query = from node in document.DescendantNodes()
where node.ToString() == "book"
select new XText("BookTitle" + node.ToString());
5. You use Microsoft Visual Studio 2010 to create a Microsoft .NET Framework 4.0 application. You create an Entity Data Model for the database tables shown in the following diagram.
You need to modify the .edmx file so that a many-to-many association can exist between the Address and
Customer entities.
Which storage Model section of the .edmx file should you include?
A) <EntityType Name="CustomerAddress">
<Key>
<PropertyRef Name="CustomerID" />
<PropertyRef Name="AddressID" />
</Key>
<Property Name="CustomerID" Type="int" Nullable="false" />
<Property Name="AddressID" Type="int" Nullable="false" />
<Property Name="AddressType" Type="nvarchar" Nullable="false" MaxLength="50"
DefaultValue="Home" />
</EntityType>
B) <EntityType Name="CustomerAddress"> <Key>
<PropertyRef Name="CustomerAddressID" /> </Key> <Property Name="CustomerAddressID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /
>
<Property Name="CustomerID" Type="int" Nullable="false"/>
<Property Name="AddressID" Type="int" Nullable="false" />
<Property Name="AddressType" Type="nvarchar" Nullable="false" MaxLength="50"/>
</EntityType>
C) <EntityType Name="CustomerAddress">
<Key>
<PropertyRef Name="CustomerAddressID" />
<PropertyRef Name="CustomerID" />
<PropertyRef Name="AddressID" />
</Key>
<Property Name="CustomerAddressID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /
>
<Property Name="CustomerID" Type="int" Nullable="false"/>
<Property Name="AddressID" Type="int" Nullable="false"/>
<Property Name="AddressType" Type="nvarchar" Nullable="false" MaxLength="50"/>
</EntityType>
D) <EntityType Name="CustomerAddress">
<Key>
<PropertyRef Name="CustomerID" />
<PropertyRef Name="AddressID" />
</Key>
<Property Name="CustomerID" Type="int" Nullable="false"/>
<Property Name="AddressID" Type="int" Nullable="false"/>
<Property Name="AddressType" Type="nvarchar" Nullable="false" MaxLength="50" />
</EntityType>
Solutions:
| Question # 1 Answer: A | Question # 2 Answer: D | Question # 3 Answer: A,B | Question # 4 Answer: A | Question # 5 Answer: D |














1215 Customer Reviews
Quality and ValueITCertKing Practice Exams are written to the highest standards of technical accuracy, using only certified subject matter experts and published authors for development - no all study materials.
Tested and ApprovedWe are committed to the process of vendor and third party approvals. We believe professionals and executives alike deserve the confidence of quality coverage these authorizations provide.
Easy to PassIf you prepare for the exams using our ITCertKing testing engine, It is easy to succeed for all certifications in the first attempt. You don't have to deal with all dumps or any free torrent / rapidshare all stuff.
Try Before BuyITCertKing offers free demo of each product. You can check out the interface, question quality and usability of our practice exams before you decide to buy.
