I have imported my xsd file into the .Net project, then I generated
the Dataset through the XSD schema.
I would like to have the following result:
<MITR>
<DONNEESVENTE>
<DVIDCARTE\>
<NUMCONTRAT\>
<ZONES>
<NbSections\>
</ZONES>
</DONNEESVENTE>
</MITR>
but I have this with the following code to build my XML file.
<MITR>
<DONNEESVENTE>
<DVIDCARTE\>
<NUMCONTRAT\>
</DONNEESVENTE>
<ZONES>
<NbSections\>
</ZONES>
</MITR>
Dim oHDS As New MITR 'the root of the schema
Dim SqlConnString As String = "..."
Dim ds As DataSet = SqlHelper.ExecuteDataset(SqlConnString,
MyStoredProc")
Dim r As DataRow
For Each r In ds.Tables(0).Rows
Dim oHRow As MITR.DONNEESVENTERow =
oHDS.DONNEESVENTE.NewDONNEESVENTERow
oHRow.DVIDCARTE = Convert.ToString(r("NumSerie"))
oHRow.NUMCONTRAT = Convert.ToString(r("NumContrat"))
oHDS.DONNEESVENTE.AddDONNEESVENTERow(oHRow)
Dim oHRow1 As MITR.ZONESRow = oHDS.ZONES.NewZONESRow
oHRow1.NbSections = 1
oHDS.ZONES.AddZONESRow(oHRow1)
oHDS.AcceptChanges()
Next
oHDS.WriteXml("c:\ProduitVendu.xml")
oHDS.Clear()
Can someone help me???????????