Interviewer And Interviewee Guide

MCSD.NET - 70-320 Exam Interview Question:

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)

Submitted by: Administrator
B. Dataset products = new Dataset("prodInfo");
products.ReadXml(newProds);
Submitted by: Administrator

Read Online MCSD.NET - 70-320 Exam Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.