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.
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)- A80% (36)
- B2% (1)
- C7% (3)
- D11% (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
Community Discussion
No community discussion yet for this question.