Data Access Flashcards

1
Q

What should you apply to a method for it to execute

after an object is completely deserialized?

A

the OnDeserialized attribute

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

Which parameter indicates whether user credentials
are available even after the database connection is
opened?

A

the Persist Security Info parameter

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

What is the only method in the

IDeserializationCallback interface?

A

the OnDeserialization method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
Which collection class is the most efficient at storing a
small or large number of items?
A

the HybridDictionary class

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

Which LINQ class represents an XML tree?

A

the XNode class

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

Which property of the SqlConnection class should
you set to enable query statistics on the active
connection?

A

the StatisticsEnabled property

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

Which method should you invoke to retrieve all

network drives on a local system?

A

You should invoke the GetDrives method (and verify

the DriveType property).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
Which method of the FileStream class should be
invoked when work is completed with a file's contents?
A

the Close method

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

What type of XML structure will be generated for a
field to which no XML serialization attributes have
been applied?

A

An XML element: a tag with the name of the field and

its content with the value of that field

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
Which class should you use to establish a server port
using Transmission Control Protocol (TCP)?
A

the TCPListener class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
Which method of the BinaryFormatter class will load an object in memory from a contiguous stream of
bytes?
A

the Deserialize method

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

When should you use a stack?

A
When organizing elements according to the Last In,
First Out (LIFO) method
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is serialization?

A

the process of converting objects in memory into a

contiguous stream of bytes

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

Which method of the GZipStream or DeflateStream
classes should you invoke to decompress data from
the stream?

A

the Read method

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

When query statistics is enabled on the active SQL
Server connection, which method should you invoke to
access a collection of name/value pairs?

A

the RetrieveStatistics method

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

Which class includes algorithms for lossless
compression/decompression and a cyclic redundancy
check?

A

the GZipStream class

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

When property of the SqlRowUpdatedEventArgs
instance indicates whether an error has occurred
during an update operation?

A

the Status property

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

What should you apply to field to ensure it will not be

converted into a contiguous stream of bytes?

A

the NonSerialized attribute

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

When using the LINQ to SQL model designer, which
data type should you use for methods that are
associated with a stored procedure that returns
multiple result sets?

A

the MultipleResults class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q
Which class represents any error that occurs when
using a data store?
A

the DbException class

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

Which enumeration indicates whether compression or

decompression should occur?

A

the CompressionMode enumeration

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

Which six states are available for database

connections?

A

Closed, Open, Connecting, Executing, Fetching, and

Broken

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

Which four values are specified in the

SqlRowUpdatedEventArgs.Status property?

A

the values Continue, ErrorsOccurred,

SkipCurrentRow, and SkipAllRemainingRows

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

How should you alter the name of an XML element

generated from a field?

A

You should apply the XmlElement attribute and

specify the new name.

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

Which GetXXX method should you use to retrieve the

SQL data type bigint?

A

the GetInt64 method

26
Q
Which class represents the file instance on a
computer's file system?
A

the FileInfo class

27
Q

What should you apply to a method for it to execute
while an object is loaded into memory from a stream of
bytes?

A

the OnDeserializing attribute

28
Q
Which interface should you implement when defining a
class responsible for the format of serialized data
types?
A

the IFormatter interface

29
Q
Which interface should you implement when defining a
class responsible for converting data types?
A

the IFormatterConverter interface

30
Q

What object is required when invoking either the Write
or Read methods of the GZipStream or
DeflateStream classes?

A

A byte array is required.

31
Q
Which class includes algorithms for lossless
compression/decompression without data integrity?
A

the DeflateStream class

32
Q
Which method of the StreamReader class will retrieve
all text content available to a stream?
A

the ReadToEnd method

33
Q

Which method of the GZipStream or DeflateStream
classes should you invoke to compress data to the
stream?

A

the Write method

34
Q

What should you apply to a method for it to execute

after an object is completely serialized?

A

the OnSerialized attribute

35
Q

Which two events are raised when a SqlDataAdapter

object executes an UPDATE command?

A

the RowUpdated and RowUpdating events

36
Q

Which character represents a shortcut for the

attribute:: syntax in an XPath expression?

A

the @ symbol

37
Q

Which method is used to remove all elements from a

queue?

A

the Clear method

38
Q

Which LINQ expression breaks items into separate

portions based upon a key value?

A

the group…by…into expression

39
Q

Which method of the FileSecurity class sets or
removes Access Control List (ACL) protection from
parent objects through inheritance?

A

the SetAccessRuleProtection member

40
Q

Which event is raised when a connection is opened,

executing a command, fetching rows, and closed?

A

the StateChange event

41
Q

Which LINQ class represents an XML attribute?

A

the XAttribute class

42
Q

Which method of the StreamWriter class should you
invoke to clear all buffers and force data in the buffer
to be written?

A

the Flush method

43
Q

What should you apply to a field for it to output an

XML attribute?

A

the XmlAttribute attribute

44
Q

Which exception should you catch when attempting to

use a SqlClient provider?

A

the SqlException exception

45
Q

When should you use a queue?

A
When organizing elements according to the First In,
First Out (FIFO) method
46
Q

Which property should you set on the DataContext
object to indicate whether related objects in a LINQ
query are loaded?

A

the DeferredLoadingEnabled property

47
Q

What should you apply to a method for it to execute

while an object is converted to a stream of bytes?

A

the OnSerializing attribute

48
Q

What should you apply to a field if its value is not

required during deserialization?

A

the OptionalField attribute

49
Q
Which method of the XMLSerializer class will convert
an object in memory to a stream of XML data?
A

the Serialize method

50
Q

Which LINQ class represents an XML attribute?

A

the XAttribute class

51
Q

Which namespace is used to create generic types?

A

the System.Collections.Generic namespace

52
Q

Which LINQ class represents an XML element?

A

the XElement class

53
Q

What is deserialization?

A

the process of converting a contiguous stream of bytes

into objects in memory.

54
Q

Which interface should you implement to initialize

values during deserialization?

A

the IDeserializationCallback interface

55
Q
Which class provides access to the contents of a file
instance on a computer's file system?
A

the FileStream class

56
Q
Which class should you use to access information
about all drives on a local system?
A

the DriveInfo class

57
Q
What should you apply to a class to indicate its objects
can be converted into a contiguous stream of bytes?
A

the Serializable attribute

58
Q

Which characters enclose an expression that
evaluates to a Boolean or positional value in an XPath
expression?

A

the square brackets ([])

59
Q
Which class is responsible for the binary serialization
process?
A

the BinaryFormatter class

60
Q

What should you apply to an array or collection field to
ensure that derived classes will serialize into XML
correctly?

A

the XmlArrayItem attribute

61
Q

Which class represents a collection of XML
serialization attributes that will be altered during XML
serialization?

A

the XmlAttributeOverrides class