New Year Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: simple70

GIAC GIAC Secure Software Programmer - C#.NET GSSP-.NET Question # 133 Topic 14 Discussion

GIAC GIAC Secure Software Programmer - C#.NET GSSP-.NET Question # 133 Topic 14 Discussion

GSSP-.NET Exam Topic 14 Question 133 Discussion:
Question #: 133
Topic #: 14

Mark works as a Software Developer for GenTech Inc. He develops an application, named App1, using Visual Studio .NET. The application contains a Form control, named Form1, which enables users to edit information in a SQL Server database. Mark wants to save all the changes made by users in the database. He defines a boolean variable, named DataIsSaved, in the application code. DataIsSaved indicates whether or not all data are saved in the database. Mark wants to prevent Form1 from closing until all the changes are saved in the database. Which of the following code will he use to accomplish this?


A.

protected void Form1_Leave(object sender, System.ComponentModel.CancelEventArgs e) {

if(!DataIsSaved)


B.

Cancel = false;

else


C.

Cancel = true;

}


D.

protected void Form1_Leave(object sender, System.ComponentModel.CancelEventArgs e) {

if(!DataIsSaved)


E.

Cancel = true;

else


F.

Cancel = false;

}


G.

protected void Form1_Closed(object sender, System.ComponentModel.CancelEventArgs e) {

if(!DataIsSaved)


Get Premium GSSP-.NET Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.