|
-
Feb 8th, 2007, 03:20 PM
#1
Thread Starter
Hyperactive Member
[2.0] Reading xml file using C#
I am tasked to read an xml file and save the contents to an oracle table.
I am planning to load the xml doc into DOM and read the element by element. The file is not big at all. But I feel there should be some easier way than going thru each element tag to read the data. Is that a good practice or are there any new methods that I could use? I heard using XSD file, we can load the data into a datatable.
thanks
nath
-
Feb 9th, 2007, 07:16 AM
#2
Re: [2.0] Reading xml file using C#
If you're going to save the data to a database then the logical thing to do would be to read it straight into a DataSet. Create one and call its ReadXml method and you're done. You can then simply create your OracleCommand object with parameters that will draw data from the appropriate DataColumns and insert to the corresponding Oracle columns. All up it would be about 10 to 20 lines of code for your average table.
-
Feb 9th, 2007, 11:21 AM
#3
Thread Starter
Hyperactive Member
Re: [2.0] Reading xml file using C#
Thanks Jm. I figured out.
This forum used to be more active a year ago.
nath
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|