Which line of code should you insert at line 9?

You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL
Server 2008 database. You add the following table to the database.
CREATE TABLE ObjectCache (
Id INT IDENTITY PRIMARY KEY,
SerializedObjectData XML )
You write the following code segment to retrieve records from the ObjectCache table. (Line numbers
are included for reference only.)
01Dim s As String = GetConnectStringFromConfigFile(“xmldb”)
02Using conn As New SqlConnection(s)
03Using cmd As New SqlCommand(
04″select * from ObjectCache”, conn))
05
06conn.Open()
07Dim rdr As SqlDataReader = cmd.ExecuteReader()
08While rdr.Read()
09
10DeserializeObject(obj)
11End While
12End Using
13End Using
You need to retrieve the data from the SerializedObjectData column and pass it to a method named
DeserializeObject. Which line of code should you insert at line 9?

You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL
Server 2008 database. You add the following table to the database.
CREATE TABLE ObjectCache (
Id INT IDENTITY PRIMARY KEY,
SerializedObjectData XML )
You write the following code segment to retrieve records from the ObjectCache table. (Line numbers
are included for reference only.)
01Dim s As String = GetConnectStringFromConfigFile(“xmldb”)
02Using conn As New SqlConnection(s)
03Using cmd As New SqlCommand(
04″select * from ObjectCache”, conn))
05
06conn.Open()
07Dim rdr As SqlDataReader = cmd.ExecuteReader()
08While rdr.Read()
09
10DeserializeObject(obj)
11End While
12End Using
13End Using
You need to retrieve the data from the SerializedObjectData column and pass it to a method named
DeserializeObject. Which line of code should you insert at line 9?

A.
Dim obj As XmlReader = DirectCast(rdr(1), XmlReader)

B.
Dim obj As SByte = DirectCast(rdr(1), SByte)

C.
Dim obj As String = DirectCast(rdr(1), String)

D.
Dim obj As Type = rdr(1).GetType()



Leave a Reply 0

Your email address will not be published. Required fields are marked *