Solved

Questions about creating XML file

Posted on 2007-03-28
5
161 Views
Last Modified: 2010-04-23
I am running a .net app that needs to email a record to another location. I would like that record to be in XML format. It needs to contain multiple tables from a local MSDE database. There may be one or multiple rows from each table that need to be a part of an export.

On the opposite end, I need to import into a SQL server DB. I am good with that part. I can use the readxml to get it into a temptable in my SP and then use the data from there.. What I am not sure about is how to structure my XML file on the "sending" end so that I can read it on the "receiving" end.

Also, I don't know if there is a "simple" way to do this, or if I am goign to need to manually loop through each dataset and manuall write the XML tags and data.

Thanks for advice/guidance.
Vee
0
Comment
Question by:VeeVan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:ullfindsmit
ID: 18808409
there is a dataset.writexml function which will write to a file path given as parameter

also you can do dataset.getxml which returns a string
0
 
LVL 1

Author Comment

by:VeeVan
ID: 18808849
Right, but the way the program is coded right now, each dataset only holds one table from my database. How to I get multiple tables into the same XML file?
0
 
LVL 12

Accepted Solution

by:
ullfindsmit earned 500 total points
ID: 18809106
you would have to write your own functions to have it write to the fiel

something like this

function writeToFile( fileName as string, d as dataset)
  dim fd as new dataset
  fd.readxml( filename)
  fd.tables.add( d.tables(0).copy)

  fd.writexml( filename)

end function

should do the trick
0
 
LVL 1

Author Comment

by:VeeVan
ID: 18809185
Right. I was hoping to avoid recreating my DS, but oh, well. It's easier than manually writing each line to the XML file. Thanks for your help.
Vee
0
 
LVL 12

Expert Comment

by:ullfindsmit
ID: 18809229
glad to help
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Asp.Net Session Question 2 49
Need help with a query 14 55
Subtract dates in vb.net 6 36
Convert a string to date 4 40
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question