Microsoft
70-516 · Question #50
70-516 Question #50: Real Exam Question with Answer & Explanation
Sign in or unlock 70-516 to reveal the answer and full explanation for question #50. The question stem and answer options stay visible for context.
Question
You use Microsoft Visual Studio 2010 and .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server 2008 database. The application contains the following code segment. string SQL = string.Format( "SELECT * FROM Customer WHERE CompanyName LIKE '%{0}%', companyName); var cmd = new SqlCommand(SQL, con); You need to reduce the vulnerability to SQL injection attacks. Which code segment should you use?
Options
- Astring SQL = "SELECT * FROM Customer Where " +
- Bstring SQL = "SELECT * FROM Customer Where " +
- Cstring SQL = string.Format("SELECT * FROM " +
- Dstring SQL = "SELECT" * FROM Customer @companyName;
Unlock 70-516 to see the answer
You've previewed enough free 70-516 questions. Unlock 70-516 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.