nerdexam
Microsoft

98-361 · Question #318

You need to develop a C# program that exports the contents of the Customers table to an XML file. The exported data must be in the following format: - <Customer CustomerID="ALFKI" ContactName="Maria…

The correct answer is A. foreach(DataColumn c in dataset1.tables["Customers"].Columns) {. See the full explanation below for the reasoning.

Question

You need to develop a C# program that exports the contents of the Customers table to an XML file. The exported data must be in the following format:

  • <Customer CustomerID="ALFKI" ContactName="Maria Anders" Phone="030-007-

4321" />

  • <Customer CustomerID="ANATR" ContactName="Ana Trujillo" Phone="(5) 555-

4729" /> Which of the following code segments should you use to export the Customers table to the specified XML format?

Options

  • Aforeach(DataColumn c in dataset1.tables["Customers"].Columns) {
  • BColumnMapping = MappingType.Attribute;
  • Cforeach(DataColumn c in dataset1.tables["Customers"].Columns) {
  • DColumnMapping = MappingType.Element;
  • Eforeach(DataColumn c in dataset1.tables["Customers"].Columns) {
  • FColumnMapping = MappingType.Attribute;
  • Gforeach(DataColumn c in dataset1.tables["Customers"].Columns) {
  • HColumnMapping = MappingType.Element;

How the community answered

(25 responses)
  • A
    72% (18)
  • D
    4% (1)
  • E
    8% (2)
  • G
    16% (4)

Community Discussion

No community discussion yet for this question.

Full 98-361 Practice