Microsoft
70-516 · Question #98
You use Microsoft .NET Framework 4.0 to develop an ASP.NET Web application that connects to a Microsoft SQL Server 2008 database. The application uses Integrated Windows authentication in Internet…
The correct answer is D. using (var conn = new SqlConnection()). See the full explanation below for the reasoning.
Question
You use Microsoft .NET Framework 4.0 to develop an ASP.NET Web application that connects to a Microsoft SQL Server 2008 database. The application uses Integrated Windows authentication in Internet Information Services (IIS) to authenticate users. A connection string named connString defines a connection to the database by using integrated security. You need to ensure that a SqlCommand executes under the application pool's identity on the database server. Which code segment should you use?
Options
- Ausing (var conn = new SqlConnection())
- Busing (var conn = new SqlConnection(connString))
- Cusing (var conn = new SqlConneccion())
- Dusing (var conn = new SqlConnection())
How the community answered
(33 responses)- A15% (5)
- B6% (2)
- C9% (3)
- D70% (23)
Community Discussion
No community discussion yet for this question.