T
Timothy V
Hi,
I'm having trouble working this out and was wondering if anyone could help
me. I have a query:
SELECT
1 AS Tag,
NULL AS Parent,
classID AS [Class!1!classID],
className AS [Class!1!Name!element]
FROM Classes
FOR XML EXPLICIT;
The problem is that when i invoke this:
XmlReader xr = sqlCommand.ExecuteXmlReader();
XmlDocument xd = new XmlDocument();
xd.Load(xr);
xd.Save(@"C:\a.xml");
I get this error:
"This document already has a DocumentElement node."
Can anyone tell me how to make this work? All I want to do is save the data
from the query to an xml file.
Thank you in advance,
Tim.
I'm having trouble working this out and was wondering if anyone could help
me. I have a query:
SELECT
1 AS Tag,
NULL AS Parent,
classID AS [Class!1!classID],
className AS [Class!1!Name!element]
FROM Classes
FOR XML EXPLICIT;
The problem is that when i invoke this:
XmlReader xr = sqlCommand.ExecuteXmlReader();
XmlDocument xd = new XmlDocument();
xd.Load(xr);
xd.Save(@"C:\a.xml");
I get this error:
"This document already has a DocumentElement node."
Can anyone tell me how to make this work? All I want to do is save the data
from the query to an xml file.
Thank you in advance,
Tim.