472,986 Members | 2,980 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

ADO.NET and XML Schemas: Generating the XML using the DataSet

Hi,

I have to prepare a XML file in the following format:

<CompanyOrders>
<CompanyProfile>
<CompanyID>Test</CompanyID>
<CompanyName>The Company</CompanyName>
</CompanyProfile>
<OrderInformation>
<BuyerInformation>
<OrderNo>00001</OrderNo>
<FName>John</FName>
<LName>Doe</LName>
</BuyerInformation>
<CustomerEMailInformation>
<EmailAddr>jo*****@johndoe.com</EmailAddr>
<CustomerEMailInformation>
<CreditCardInformation>
<CcType>MA</CcType>
<ExpYear>09</ExpYear>
</CreditCardInformation>
</OrderInformation>

This information will come from one table CustomerOrder. Here are my
questions:

1. I suspect I will have to create multiple data adapter as
<CustomerEMailInformation> exist outside the <BuyerInformation>.
2. The code that I have written untile now:

DataSet dsOrders = new DataSet("CompanyOrders");
this.dsOrders.Tables.Clear();
SqlDataAdapter sdaOrder = new SqlDataAdapter(this.strSQL,conn);
sdaOrder.Fill(this.dsOrders,"OrderInformation");
conn.Close();
this.dsOrders.WriteXml("C:\\test.xml",XmlWriteMode .IgnoreSchema);

And the XML output is as follows:

<CompanyOrders>
<OrderInformation>
<OrderNo>I000004</OrderNo>
<FName>Nauman</FName>
<MI />
<LName>Ahmed</LName>
<CoName>Company</CoName>
<Street>Address</Street>
<City>City</City>
<State>State</State>
<ZipCode>Zip</ZipCode>
<CountryCode>1000</CountryCode>
<DayPhone>000-000-0000</DayPhone>
</OrderInformation>
</CompanyOrders>

I need the information contained in the
<OrderInformation></OrderInformation> tags to be contained in
<BuyerInformation></BuyerInformation> tags as it is defined in the DTD. Any
suggestions?

Thanks, Nauman.
Jul 21 '05 #1
0 881

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

Similar topics

1
by: Jack Notarangelo | last post by:
Hello, I am interested in anyone's preference as to creating datasets in code vs generating them using the UI. I know typing is an advantage of the latter method. But any other information...
2
by: sam | last post by:
Hi, I've been buried in xsl and xslt articles for several days now, and am still unsure as to what I need to do... Basically, my vb.net app loads up an XML file from an external source...
2
by: AlexS | last post by:
Hello all! Are there any limitations know for schemas (xsd), which could be processed by DataSet.ReadXMLSchema method? I have problem when reading one of schemas. .Net complains and people say...
10
by: Al Christoph | last post by:
Please forgive me if this is the wrong place to post this. The last place I posted got me a fairly rude response. I guess vb.db people just don't want to think about XML as database. At any rate,...
1
by: xxxxyz | last post by:
Hi, I want to generate dataset class using Visual studio ( I can do this as first generate SqlDataAdaptor and SqlConnection). But can I ganerate it without sqldataadaptor and sqlconnection,...
3
by: Anthony | last post by:
Hi There When trying to add a dataset to a web form I get the following error msg. "There were problems generating . To resolve this problem build the project, fix the errors and generate...
0
by: Nauman Ahmed | last post by:
Hi, I have to prepare a XML file in the following format: <CompanyOrders> <CompanyProfile> <CompanyID>Test</CompanyID> <CompanyName>The Company</CompanyName> </CompanyProfile>...
0
by: dlutz | last post by:
Good day to all -- I have been trying to load a dataset from XML based on a multi-level schema structure that uses <xsd:importtags to bring other schemas into the XML document context - Schema1...
1
by: Leon_Amirreza | last post by:
Hi, How can I comapre 2 dataset schemas are compatible (Same table columns, same keys, same constraints, ...)?
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.