nerdexam
Microsoft

70-516 · Question #82

You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 200B database. You populate a SqlDataAdapter by using the following code. (Line numbers are…

The correct answer is A. foreach(DataRow row in BlogEntryDataSet.Tables["BlogEntries"].Rows). SqlDataAdapter.Update()-Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the System.Data.DataSet with the specified System.Data.DataTable name.

Manipulating and Validating Data

Question

You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 200B database. You populate a SqlDataAdapter by using the following code. (Line numbers are included for reference only.) 01 SqlDataAdapter dataAdapter1 = new SqlDataAdapter("SELECT * FROM [BlogEntries] ORDER BY CreationDate”, connection); 02 cmdBuilder = new SqlCommandBuilder(dataAdapter1); 03 dataAdapter1.Fill(BlogEntryDataSet, “BlogEntries”); 04 .... 05 connection.Close(); You need to update the blog owner for all BlogEntry records. Which code segment should you insert at line 04?

Options

  • Aforeach(DataRow row in BlogEntryDataSet.Tables["BlogEntries"].Rows)
  • Bforeach(DataRow row in BlogEntryDataSet.Tables["BlogEntries"].Rows)
  • CSqlDataAdapter dataAdapter2 = new SqlDataAdapter(
  • DSqlDataAdapter dataAdapter2 = new SqlDataAdapter

How the community answered

(45 responses)
  • A
    80% (36)
  • B
    2% (1)
  • C
    7% (3)
  • D
    11% (5)

Explanation

SqlDataAdapter.Update()-Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the System.Data.DataSet with the specified System.Data.DataTable name.

Topics

#SqlDataAdapter#SqlCommandBuilder#DataRow#batch update

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice