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

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application.
You use the ADO.NET Entity Framework Designer to model entities. The model contains an entity type
named Product.
You need to ensure that a stored procedure will be invoked when the ObjectContext.SaveChanges method
is executed after an attached Product has changed.
What should you do in the ADO.NET Entity Framework Designer?

解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application contains the following XML document:
<bib> <book title="TCP/IP Illusrated" year="1994">
<author>Author1</author>
</book>
<book title="Programming in UNIX" year="1992">
<author>Author1</author>
<author>Author2</author>
<author>Author3</author>
</book>
<book title="Data on the web" year="2000">
<author>Author4</author>
<author>Author3</author>
</book> </bib>
You add the following code fragment. (Line numbers are included for reference only.)
01 public IEnumerable<XElement> GetBooks(string xml)
02 {
03 XDocument doc = XDocument.Parse(xml);
04 ...
05 }
You need to return a list of book XML element that are authored by Author1. Which code segment should you insert at line 04?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server database.
You write the following code segment that executes two commands against the database within a
transaction.
(Line numbers are included for reference only.)
01 using(SqlConnection connection = new SqlConnection(cnnStr)) {
02 connnection.Open();
03 SqlTransaction sqlTran = connection.BeginTransaction();
04 SqlCommand command = connection.CreateCommand();
05 command.Transaction = sqlTran;
06 try{
07 command.CommandText = "INSERT INTO Production.ScrapReason(Name)
VALUES('Wrong size')";
08 command.ExecuteNonQuery();
09 command.CommandText = "INSERT INTO Production.ScrapReason(Name)
VALUES('Wrong color')";
10 command.ExecuteNonQuery();
11 ...
l2 }
You need to log error information if the transaction fails to commit or roll back. Which code segment should you insert at line 11?

解説: (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. You add the following store procedure
to the database.
CREATE PROCEDURE GetProducts AS BEGIN
SELECT ProductID, Name, Price, Cost FROM Product END
You create a SqlDataAdapter named adapter to execute the stored procedure. You need to fill a DataTable
instance with the first 10 rows of the result set.
What are two possible code segments that you can use to achieve the goal?

正解:C、D 解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You 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?

解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft Visual Studio 2010 and 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 ObjectCache ( Id INT IDENTITY PRIMARY KEY, SerializedObjectData XML)
You write the following code segment to retreive records from the ObjectCache table. (Line numbers are included for reference only.)
01 string s = GetConnectionStringFromConfigFile("xmldb");
02 using (SqlConnection conn = new SqlConnection(s))
03 using (SqlCommand cmd = new SqlCommand("select * from ObjectCache",
conn))
04 {
05 conn.Open();
06 SqlDataReader rdr = cmd.ExecuteReader();
07 while(rdr.Read())
08 {
09 ...
10 DeserializeObject(obj);
11 }
12 }
You need to retreive the data from the SerializedObjectData column and pass it to a method named
DeserializeObject.
Which line of code should you insert at line 09?

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 manage Plain Old CLR Objects (POCO) entities.
You create a new POCO class. You need to ensure that the class meets the following requirements:
-It can be used by an ObjectContext.
-It is enabled for change-tracking proxies.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

正解:C、D 解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
You are creating the data layer of the application. You write the following code segment.
(Line numbers are included for reference only.)
01 public static SqlDataReader GetDataReader(string sql)
02 {
03 SqlDataReader dr = null;
04 ...
05 return dr;
06 }
You need to ensure that the following requirements are met: The SqlDataReader returned by the GetDataReader method can be used to retreive rows from the database.
--
SQL connections opened within the GetDataReader method will close when the SqlDataReader is closed.
Which code segment should you insert at the line 04?

解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server
2008 database.
You need to ensure that the application connects to the database server by using SQL Server
authentication.
Which connection string should you use?

解説: (JPNTest メンバーにのみ表示されます)
You are developing a new feature that displays an auto-complete list to users as the type color names. You
have an
existing ContosoEntities context object named contex.
To support the new feature you must develop code that will accept a string object named text containing a
user's
partial input and will query the Colors database table to retrieve all color names that begin with that input.
You need to create an Entity SQL (ESQL) query to meet the requirement.
The query must not be vulnerable to a SQL injection attack. Which code segment should you use?

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

弊社を連絡する

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

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

サポート:現在連絡