Which line of code should you insert at line 10?

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.)
01string s = GetConnectStringFromConfigFile(“xmldb”);
02using (SqlConnection conn = new SqlConnection(s))
03using (SqlCommand cmd = new SqlCommand(
04″select * from ObjectCache”, conn))
05{
06conn.Open();
07SqlDataReader rdr = cmd.ExecuteReader();
08while(rdr.Read())
09{
10
11DeserializeObject(obj);
12}
13}
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 10?

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.)
01string s = GetConnectStringFromConfigFile(“xmldb”);
02using (SqlConnection conn = new SqlConnection(s))
03using (SqlCommand cmd = new SqlCommand(
04″select * from ObjectCache”, conn))
05{
06conn.Open();
07SqlDataReader rdr = cmd.ExecuteReader();
08while(rdr.Read())
09{
10
11DeserializeObject(obj);
12}
13}
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 10?

A.
XmlReader obj = (XmlReader)rdr[1];

B.
SByte obj = (SByte)rdr[1];

C.
String obj = (String)rdr[1];

D.
Type obj = rdr[1].GetType();



Leave a Reply 0

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