070-516 無料問題集「Microsoft TS: Accessing Data with Microsoft .NET Framework 4」

You use Microsoft .NET Framework 4.0 to develop an ASP.NET Web application that connects to a
Microsoft SQL Server 2008 database.
The application uses Integrated Windows authentication in Internet Information Services (IIS) to
authenticate users.
A connection string named connString defines a connection to the database by using integrated security.
You need to ensure that a SqlCommand executes under the application pool's identity on the database
server.
Which code segment should you use?

解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the Entity Framework Designer to create the following Entity Data Model.

You write a method named ValidatePostalCode to validate the postal code for the application.
You need to ensure that the ValidatePostalCode method is called before the PostalCode property set
method is completed and before the underlying value has changed.
Which code segment should you place in the entity's partial class?

解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that
uses the Entity Framework.
You create the following Entity Data Model.

You add the following code fragment:
using(var context = new AdventureWorksLTEntities())
{ Customer cust = context.Customers.First(); cust.CompanyName = "Contoso"; int count = 0;
}
The changes to the cust entity must be saved. If an exception is thrown, the application will attempt to save
up to 3 times.
If not, an exception is thrown. Which code segment should you use?

You use Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework.
The application defines the following Entity SQL (ESQL) query, which must be executed against the mode.
string prodQuery = "select value p from Products as p where
p.ProductCategory.Name = @p0";
You need to execute the query. Which code segment should you use?

解説: (JPNTest メンバーにのみ表示されます)
The database contains orphaned Color records that are no longer connected to Part records.
You need to clean up the orphaned records. You have an existing ContosoEntities context object named
context.
Which code segment should you use?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application retreives data from Microsoft SQL Server 2008 database named AdventureWorks. The AdventureWorks.dbo.ProductDetails table contains a column names ProductImages that uses a varbinary(max) data type.
You write the following code segment. (Line numbers are included for reference only.)
01 SqlDataReader reader = command.ExecureReader(--empty phrase here --);
02 while(reader.Read())
03 {
04 pubID = reader.GetString(0);
05 stream = new FileStream(...);
06 writer = new BinaryWriter(stream);
07 startIndex = 0;
08 retval = reader.GetBytes(1, startIndex, outByte, 0, bufferSize);
09 while(retval == bufferSize)
10 {
11 ...
12 }
13 writer.Write(outbyte, 0, (int)retval-1);
14 writer.Flush();
15 writer.Close();
16 stream.Close();
17 }
You need to ensure that the code supports streaming data from the ProductImages column. Which code segment should you insert at the empty phrase in line 01?

解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
You use Plain Old CLR objects (POCO) to model your entities.
The application communicates with a Windows Communication Foundation (WCF) Data Services service.
You need to ensure that entities can be sent to the service as XML. What should you do?

解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application that
connects to a database by using the Entity Framework.
You create an Entity Data Model (EDM) by using the Generate from database wizard for the following
tables.

You need to ensure that the EDM contains an entity type named Employee that contains all of the data from
both tables.
What should you do?

The user interface requires that a paged view be displayed of all the products sorted in alphabetical order.
The user interface supplies a current starting index and a page size in variables named startIndex and
pageSize of type int.
You need to construct a LINQ expression that will return the appropriate Parts from the database from an
existing
ContosoEntities context object named context. You begin by writing the following expression:
context.Parts
Which query parts should you use in sequence to complete the expression?
(To answer, move the appropriate actions from the list of actions to the answer area and arrange them in
the correct order.)

正解:B、C、E 解答を投票する
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 create an entity as shown in
the following code fragment.
<EntityType Name="ProductCategory">
<Key>
<PropertyRef Name="ProductCategoryID" />
</Key>
<Property Name="ProductCategoryID" Type="int" Nullable="false" StoreGeneraedPattern="Identity" />
<Property Name="ParentProductCategoryID" Type="int" />
<Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="50" />
...
</EntityType>
You need to provide two entity-tracking fields:
-rowguid that is automatically generated when the entity is created
-ModifiedDate that is automatically set whenever the entity is updated. Which code fragment should you add to the .edmx file?

解説: (JPNTest メンバーにのみ表示されます)
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 application uses a Microsoft
ADO.NET SQL Server managed provider.
When a connection fails, the application logs connection information, including the full connection string.
The information is stored as plain text in a .config file. You need to ensure that the database credentials are
secure.
Which connection string should you add to the .config file?

解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft Visual Studio 2010 and the Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server database. The application uses DataContexts to query
the database.
You define a foreign key between the Customers and Orders tables in the database.
You need to ensure that when you delete a customer record, the corresponding order records are deleted.
You want to achieve this goal by using the minimum amount of development effort. What should you do?

解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server
2008 database.
You add the following table to the database.
CREATE TABLE Orders( ID numeric(18, 0) NOT NULL, OrderName varchar(50) NULL, OrderTime time(7) NULL, OrderDate date NULL)
You write the following code to retrieve data from the OrderTime column. (Line numbers are included for reference only.)
01 SqlConnection conn = new SqlConnection("...");
02 conn.Open();
03 SqlCommand cmd = new SqlCommand("SELECT ID, OrderTime FROM Orders", conn);
04 SqlDataReader rdr = cmd.ExecuteReader();
05 ....
06 while(rdr.Read())
07 {
08 ....
09 }
You need to retrieve the OrderTime data from the database. Which code segment should you insert at line 08?

解説: (JPNTest メンバーにのみ表示されます)

弊社を連絡する

我々は12時間以内ですべてのお問い合わせを答えます。

オンラインサポート時間:( UTC+9 ) 9:00-24:00
月曜日から土曜日まで

サポート:現在連絡