070-516 無料問題集「Microsoft TS: Accessing Data with Microsoft .NET Framework 4」
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. The application stores user names and
passwords in the database.
You need to ensure that users cannot read passwords extracted from the database. What should you do?
The application connects to a Microsoft SQL Server database. The application stores user names and
passwords in the database.
You need to ensure that users cannot read passwords extracted from the database. What should you do?
正解:C
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server
2008 database.
The application uses nested transaction scopes. An inner transaction scope contains code that inserts
records into the database.
You need to ensure that the inner transaction can successfully commit even if the outer transaction rolls
back.
What are two possible TransactionScope constructors that you can use for the inner transaction to achieve
this goal?
(Each correct answer presents a complete solution. Choose two.)
2008 database.
The application uses nested transaction scopes. An inner transaction scope contains code that inserts
records into the database.
You need to ensure that the inner transaction can successfully commit even if the outer transaction rolls
back.
What are two possible TransactionScope constructors that you can use for the inner transaction to achieve
this goal?
(Each correct answer presents a complete solution. Choose two.)
正解:A、C
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Forms
application.
The application connects to a Microsoft SQL Server database.
You need to find out whether the application is explicitly closing or disposing SQL connections. Which code
segment should you use?
application.
The application connects to a Microsoft SQL Server database.
You need to find out whether the application is explicitly closing or disposing SQL connections. Which code
segment should you use?
正解:C
解答を投票する
解説: (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?
<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?
正解:A
解答を投票する
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 use the ADO.NET Entity Framework to model your entities. You use ADO.NET self-tracking entities.
You need to ensure that the change-tracking information for the self-tracking entities can be used to update
the database.
Which ObjectContext method should you call after changes are made to the entities?
The application connects to a Microsoft SQL Server 2008 database.
You use the ADO.NET Entity Framework to model your entities. You use ADO.NET self-tracking entities.
You need to ensure that the change-tracking information for the self-tracking entities can be used to update
the database.
Which ObjectContext method should you call after changes are made to the entities?
正解:A
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft .NET Framework 4.0 to develop an ASP.NET application. The application uses
Integrated Windows authentication.
The application accesses data in a Microsoft SQL Server 2008 database that is located on the same server
as the application.
You use the following connection string to connect to the database.
Integrated Security=SSPI; Initial Catalog=AdventureWorks;
The application must also execute a stored procedure on the same server on a database named pubs.
Users connect to the ASP.NET application through the intranet by using Windows-based authentication.
You need to ensure that the application will use connection pooling whenever possible and will keep the
number of pools to a minimum.
Which code segment should you use?
Integrated Windows authentication.
The application accesses data in a Microsoft SQL Server 2008 database that is located on the same server
as the application.
You use the following connection string to connect to the database.
Integrated Security=SSPI; Initial Catalog=AdventureWorks;
The application must also execute a stored procedure on the same server on a database named pubs.
Users connect to the ASP.NET application through the intranet by using Windows-based authentication.
You need to ensure that the application will use connection pooling whenever possible and will keep the
number of pools to a minimum.
Which code segment should you use?
正解:A
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You use Microsoft Visual Studio 2010 and .NET Framework 4.0 to develop an application.
You use entity Framework Designer to create an Entity Data Model from an existing database by using the
Generate From Database wizard.
The model contains an entity type named Product. The Product type requires an additional property that is
not mapped to database colomn.
You need to add the property to product. What should you do?
You use entity Framework Designer to create an Entity Data Model from an existing database by using the
Generate From Database wizard.
The model contains an entity type named Product. The Product type requires an additional property that is
not mapped to database colomn.
You need to add the property to product. What should you do?
正解:C
解答を投票する
The application populates a DataSet object by using a SqlDataAdapter object.
You use the DataSet object to update the Categories database table in the database. You write the
following code segment.
(Line numbers are included for reference only.)
01 SqlDataAdapter dataAdpater = new SqlDataAdapter("SELECT CategoryID,
CategoryName FROM Categories", connection);
02 SqlCommandBuilder builder = new SqlCommandBuilder(dataAdpater);
03 DataSet ds = new DataSet();
04 dataAdpater.Fill(ds);
05 foreach (DataRow categoryRow in ds.Tables[0].Rows)
06 {
07 if (string.Compare(categoryRow["CategoryName"].ToString(), searchValue,
true) == 0)
08 {
09 ...
10 }
11 }
12 dataAdpater.Update(ds);
You need to remove all the records from the Categories database table that match the value of the
searchValue variable.
Which line of code should you insert at line 09?
You use the DataSet object to update the Categories database table in the database. You write the
following code segment.
(Line numbers are included for reference only.)
01 SqlDataAdapter dataAdpater = new SqlDataAdapter("SELECT CategoryID,
CategoryName FROM Categories", connection);
02 SqlCommandBuilder builder = new SqlCommandBuilder(dataAdpater);
03 DataSet ds = new DataSet();
04 dataAdpater.Fill(ds);
05 foreach (DataRow categoryRow in ds.Tables[0].Rows)
06 {
07 if (string.Compare(categoryRow["CategoryName"].ToString(), searchValue,
true) == 0)
08 {
09 ...
10 }
11 }
12 dataAdpater.Update(ds);
You need to remove all the records from the Categories database table that match the value of the
searchValue variable.
Which line of code should you insert at line 09?
正解:A
解答を投票する
解説: (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 database.
The application uses the ADO.NET LINQ to SQL model to retrieve data from the database.
The application will not modify retrieved data. You need to ensure that all the requested data is retrieved.
You want to achieve this goal using the minimum amount of resources. What should you do?
The application connects to a Microsoft SQL Server database.
The application uses the ADO.NET LINQ to SQL model to retrieve data from the database.
The application will not modify retrieved data. You need to ensure that all the requested data is retrieved.
You want to achieve this goal using the minimum amount of resources. What should you do?
正解:A
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)