For the following code,

SqlParameter prmStudentName = new SqlParameter("@StudentName", studentName);

SqlParameter prmReturnResult = new SqlParameter("@ReturnResult", System.Data.SqlDbType.Int);
prmReturnResult.Direction = System.Data.ParameterDirection.Output;

result = context.Database
.ExecuteSqlRaw("EXEC @ReturnResult = usp_ AddStudentDetails @ StudentName”, prmReturnResult, prmStudentName);
returnResult = Convert.ToInt32(prmReturnResult.Value);

what is the value of the variable result when NO rows are affected in the database? Assume that the procedure usp_AddStudentDetails contains one update and one insert statement and the procedure returns 1, only if they are executed successfully.

0
-1
-2
NULL
Verified Answer
Correct Option - b

To get all Infosys Certified Backend Layers Developer Exam questions Join Telegram Group https://rebrand.ly/lex-group-70b557

Telegram

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in

Updated on Tue, 16 Sept 2025