|
-
February 13th, 2009, 09:34 AM
#1
how to use xmldocument?
Hello I want to make an xmldocument object not to be saved in a file. How do I use create element so that I get different levels of the nodes? Like this:
Code:
<root>
<node1>
test
<\node1>
<\root>
Last edited by Visslan; February 13th, 2009 at 09:38 AM.
-
March 6th, 2009, 03:24 AM
#2
Re: how to use xmldocument?
I used these logic to read xml from a databse:
Dim strSQL As string = "SELECT OrderId, OrderDate FROM Orders FOR XML AUTO,
ELEMENTS"
Dim xReader As New XMLReader()
'...ADO.NET code to get a XMLReader
Dim doc As New XMLDocument()
doc.Load(xReader)
xReader.Close()
An exception generated in line doc.Load(xReader) because there is no root
node in the result XML. Query the XML directly from SQL Query Analyser, I
can get there:
<Orders><OrderId>10248</OrderId><OrderDate>1996-07-04T00:00:00</OrderDate>
</Orders>
<Orders><OrderId>10249</OrderId><OrderDate>1996-07-04T00:00:00</OrderDate>
</Orders>
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
|