473,388 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Generate XML File from XSD schema

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???????????
Nov 12 '05 #1
0 1046

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Almoni | last post by:
Hi, I have a few .xsd files that include each other in the following way: <!-- lets call the main schema file AA.xsd and it includes BB.xsd inside it --> <xs:schema...
2
by: PeterW | last post by:
I have an xml file from which I want to generate an xsd schema and at a later stage a cs class. The xml file has a mix of defined namespaces and also an empty namespace. These are defined as...
1
by: comic_rage | last post by:
Hi, I am writing code with C# to generate xml schema, however, the following code generate a UTF-16 in the first line. This will create some problems. How can get the code/missing what part of...
8
by: Phil Lee | last post by:
I'm sure this is possible but I just can't see how to do it. I want to add schemas to my solution and have C# classes automatically generated from them. I can see how to generate typed DataSet's...
0
by: mmaslar | last post by:
Can Visual Studio ('05 or '08) generate a WSDL file with an external Schema file? eg. Instead of placing the schema within the WSDL file, generate it in a separate XSD file? In other words......
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.