Program Control Flashcards

1
Q
Which property of the DbException class identifies
the data provider?
A

the Source property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which method is used to stop a running thread for an

amount of time?

A

the Sleep method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which delegate should you use when instantiating a

Thread object whose method takes no arguments?

A

the ThreadStart delegate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which method is used to run a thread?

A

the Start method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which delegate should you use when instantiating a

Thread object whose method takes argument(s)?

A

the ParameterizedThreadStart delegate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the syntax for instantiating a Thread object to

run a specified method?

A

Thread [name] = new Thread

([targetMethod]);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
Which class allows you to easily manage multiple
threads within an application domain?
A

the ThreadPool class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which property of the IAsyncResult interface

indicates an asynchronous operation has ended?

A

the IsCompleted property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is an exception?

A

An exception is an abnormal condition at runtime

resulting from an error or unexpected operation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
From which class should you inherit to implement a
custom exception?
A

the Exception class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
Which property of the Thread class is used to set or
retrieve the current user for an application in rolebased security?
A

the CurrentPrincipal property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
Which property of the ServiceSecurityAuditBehavior
class sets whether logging failures will throw an
exception?
A

the SuppressAuditFailure property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
Which property of the DbException class provides the
vendor-specific error message?
A

the Message property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the syntax used to declare a delegate?

A

public delegate [void|return] [name]

([args]);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does the ThreadState enumeration indicate?

A

the current execution state of the thread, whether it

has been started, is running, or is suspended

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
Which method should you invoke on the ThreadPool
class to add a delegate?
A

the QueueUserWorkItem method

17
Q

Which delegate should you use for callbacks from the

ThreadPool class?

A

the WaitCallback delegate

18
Q
Which property of the Process class returns all
libraries loaded by the current process?
A

the Modules property

19
Q
Which class should you use to generate an
application-specific exception?
A

the ApplicationException class

20
Q

Which exception class represents a concurrency
violation during database update operations and is
thrown if the number of rows affected by each
INSERT, UPDATE, or DELETE command is zero?

A

the DbConcurrencyException exception

21
Q

When an exception type SqlException is caught, how
do you determine the error that was encountered in
SQL Server?

A

Iterate over the Errors collection of the SqlException

object

22
Q

How do you invoke the method(s) to which a delegate

references?

A

Invoke the Invoke method, specifying the arguments

required by the delegate.