11.07.2015 Views

Leer y escribir datos XML - Willy .Net

Leer y escribir datos XML - Willy .Net

Leer y escribir datos XML - Willy .Net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Leer</strong> y <strong>escribir</strong> <strong>datos</strong> <strong>XML</strong> 21El siguiente ejemplo de <strong>XML</strong> muestra el resultado que resultará de invocarWriteXml en el DataSet:title1140.00title2260.00title3130.001pub12pub2Los elementos Titles y Publishers se muestran como elementos secuenciales.Para que los elementos Titles aparezcan como secundarios de sus respectivoselementos primarios, la propiedad Nested de DataRelation debería estarestablecida a true y deberíamos añadir el siguiente código:Visual Basic .NETC#…Dim dr As New DataRelation _("TitlePublishers", parentCol, childCol)dr.Nested = Trueds.Relations.Add(dr)ds.Write<strong>XML</strong>(Server.MapPath("PubTitlesNested.xml"), _XmlWriteMode.IgnoreSchema)…DataRelation dr = new DataRelation("TitlePublishers",parentCol, childCol);dr.Nested = true;ds.Relations.Add(dr);ds.Write<strong>XML</strong>(Server.MapPath("PubTitlesNested.xml"),XmlWriteMode.IgnoreSchema);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!