Microsoft
70-516 · Question #228
You use Microsoft .NET Framework 4 to develop an application. You write the following code to update data in a Microsoft SQL Server 2008 database. (Line numbers are included for reference only,) 01…
The correct answer is C. Using conn As New SqlConnection(connString). See the full explanation below for the reasoning.
Question
You use Microsoft .NET Framework 4 to develop an application. You write the following code to update data in a Microsoft SQL Server 2008 database. (Line numbers are included for reference only,) 01 Private Sub ExecuteUpdate(ByVal cmd As SqlCommand, ByVal connString As String, ByVal updateStrat As String) 03 End Sub You need to ensure that the update statement executes and that the application avoids connection leaks. Which code segment should you insert at line 02?
Options
- ADim conn As SqlConnection =
- BUsing conn As New SqlConnection(connString)
- CUsing conn As New SqlConnection(connString)
- DDim conn As SqlConnection =
How the community answered
(25 responses)- A16% (4)
- B8% (2)
- C72% (18)
- D4% (1)
Community Discussion
No community discussion yet for this question.