70-340 Implementing Security for Applications with Microsoft Visual C# .NET Practice Test


Microsoft ™

70-340 Implementing Security for Applications with Microsoft Visual C# .NET



Note 1: 70-340 Exhibit and all related diagrams are not shown in demo questions.
Note 2: 70-340 Answers are not shown in demo questions.
Exhibits and Answers are only provided in the Full Version.


Demo Question 3.


You are an application developer for EliteCertify.com. You are conducting a code review of an application that updates a Microsoft SQL Server database named Payroll. This database is used by other applications. The application contains the following code segment. public void calculateAndStore(SqlConnection conn, string ID, string bonus, string salary) { salary=Convert.ToString (Convert. ToDecimal (salary) *1.05m) ; bonus=Convert.TOString (Convert. ToDecimal (salary) *0.05m) ; if (ID. Length==0) Throw new ApplicationException ("Error - Empty ID" ) ; string newID= "ID. " + ID ; string strUpdate = "UPDATE Payroll SET EmployeeID = '" + newID + "', Bonus = '" + bonus + "', Salary = '" + salary + "' " + "WHERE Employee ID=' " + ID + " '" ; SqlCommand cmd=new SqlCommand(StrUpdate, conn) ; cmd. Connection .Open ( ) ; cmd. Execute Non Query ( ) ; } The values in the string variables named ID, Bonus, and Salary are contained in the Payroll database. The purpose of the code segment is to calculate new values for ID, Bonus, and Salary, and to update those values in the Payroll database. You need to improve the security of this application. What should you do?

A. Validate that the Salary value is within the range for the data type in the SQL Server database.
B. Validate the contents of the ID value before updating it in the SQL Server database.
C. Validate the length of the ID value before updating it in the SQL Server database.
D. Enclose the body of the function within a try-catch block.


Display Answer


Purchase Full Version:


70-340 Printable PDF Prep Guide $49.95 BUY NOW!

70-340 Test Simulation Engine $69.95 BUY NOW!

70-340 PDF & Test Simulation Engine $99.95 BUY NOW!




Answer: D

Explanation: There are several things worrisome about this question. Since all input must be considered evil until otherwise proven, even input from and passed by applications, there must be a validation step used at every opportunity. This will increase the code segment and the application will take a perceived performance hit. However, this is still better than taking the chance that the data being used or passed has not been manipulated. Parameterized stored procedures or parameterized SQL statements should be used instead of dynamic SQL. Since the information is being pulled from the database, we have to assume that earlier processes in the application have handled the scrubbing and validation of the data during the original data entry or it should not be there. However, a less than trustworthy database administrator could still manipulate the data anytime and the database could have been compromised by some other means.



  • Based on the latest 70-340 exam objectives!
  • Designed like actual 70-340 exam questions!
  • 100% Verified Realistic 70-340 Exam Questions and Answers!
  • Exhibits, Drag&Drop and Simulation 70-340 Questions Included!
  • Constantly Updated Guide to Reflect the Current 70-340 Exams!
  • Detailed Explanations for Most Guide Practice Exams!
 Sponsored Links
Japan Exam



SCSI
310-330
$49.95 Get Detail

MCD
1D0-425 1D0-520
1D0-525
$89 Get Detail

CCNA
640-811 640-821

$59 Get Detail

SA
1D0-470
$49.95 Get Detail

MCSE 2003 Messaging
70-270 70-284
70-290 70-291
70-293 70-294
70-297 70-298

$239 Get Detail


England
Many thanks to your complete solution in 3Com Test Simulation Engine, Study Guides and PDF practice exams which are very ...


NY, USA
I wanted to take a few minutes to thank EliteCertify for passing 3 exams towards my MCSE. ...


London, UK
First class site! Just passed 70-290 and achieved my MCSE & MCSA. ...





Keyword
This site is both PayPal and VeriSign Verified. 128-bit SSL Encryption!
More questions about Order Security?