MCSD.NET - 70-320 Exam Question:
Download Questions PDF

Suppose Company Ltd. receives product information from manufactures in the form of an XML documents.
The product information is stored in a Microsoft SQL Server database. The format of each XML
document varies. Each one is located in a MemoryStream object named newProds. You create a
merge procedure that reads data and schema information in a Dataset object and merges the
information into your database. You now need to write code to transfer the XML document and its
schema into a Dataset object.
Which code segment should you use?
A. Dataset products = new Dataset("prodInfo");
XmlTextReader reader = new XmlTextReader(newProds);
XmlValidatingReader validReader = new
XmlValidatingReader(reader);
while (validReader.Read()) { products.WriteXml(validReader.Value);}
B. Dataset products = new Dataset("prodInfo");
products.ReadXml(newProds);
C. Dataset products = new Dataset("prodInfo");
XmlDataDocument document = new XmlDataDocument(products);
D. document.DataSet.ReadXmlSchema(newProds);
Dataset products = new Dataset("prodInfo");
string myXmlData = Encoding.UTF8.GetString(newProds.ToArrary());
SqlDataAdapter adapter = new SqlDataAdapter("LoadSchemaType=XML",myXmlData);
adapter.
Fill(products)

MCSD.NET - 70-320 Exam Interview Question
MCSD.NET - 70-320 Exam Interview Question

Answer:

B. Dataset products = new Dataset("prodInfo");
products.ReadXml(newProds);

Download MCSD.NET - 70-320 Exam Interview Questions And Answers PDF

Previous QuestionNext Question
You are creating an XML Web service named ListBoxService. This service provides content,
such as states, countries, and geographical regions, for use in drop-down list boxes.
ListBoxService contains a Web method named RetrieveRegionsListBox. This method runs a
Dataset object that contains every geographical region in the world. RetrieveRegionsListBox calls
a Microsoft SQL Server database to load the Dataset object with region data. You want to
minimize the amount of time the method takes to return to the caller.
What should you do?
A. Use a stored procedure to return the datas.
B. Store each Dataset object by using the Session object.
C. Set the Buffer Response property of the Web Method attribute to false.
D. Set the Cache Duration property of the Web Method attribute to an interval greater than zero.
Suppose You create an XML Web service named Time ESService. Each time ESService is started, it
checks for the existence of an event log named Time ESServiceLog. If TimeServiceLog does not
exist, Time ESService creates it. You discover that when Time ESService creates Time
ESServiceLog, it throws a System.Security.SecurityException. The exception includes the
following message: "Requested registry access is not allowed". You need to resolve this problem.
What should you do?
A. Configure Inetinfo.exe to run as the local administrator user account.
B. Create an installer for Time ESService, and create the new event log in the installer code.
C. Modify the Web.config file by adding an identity element to impersonate the LOGON user
specified by Internet Information Services (IIS).
D. Modify the permissions of the
KEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesEventlog registry key to give
full control to the IUSR_computername user account.