473,378 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

XMLDOM save

I must get a lot of information out of my database into a XMLDOM. The
database part is done, all the information is in SQLDataReaders, but
how can i convert all that information into a XMLDOM??

I must get it nice so i can load the information later..

Greetz Koen

Aug 15 '06 #1
5 1807


Dikkuuhh wrote:
I must get a lot of information out of my database into a XMLDOM. The
database part is done, all the information is in SQLDataReaders, but
how can i convert all that information into a XMLDOM??
What are you using, the Microsoft .NET Framework? That has an
SqlDataReader you can create with the ExecuteReader method of an SqlCommand.
But SqlComand also has method ExecuteXmlReader so you can do e.g.
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(sqlCommandInstance.ExecuteXmlRead er());
xmlDocument.Save(@"file.xml");
Check the MSDN documentation about ExecuteXmlReader, it works only with
special FOR XML SQL commands issued:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataSqlClientSqlCommandClassExecuteXmlR eaderTopic.asp>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 15 '06 #2
I`m using ASP.NET 2.0, but i don`t understand what you are saying...

Do you have a small sample code where it happens??

Thanx

Koen

Martin Honnen wrote:
Dikkuuhh wrote:
I must get a lot of information out of my database into a XMLDOM. The
database part is done, all the information is in SQLDataReaders, but
how can i convert all that information into a XMLDOM??

What are you using, the Microsoft .NET Framework? That has an
SqlDataReader you can create with the ExecuteReader method of an SqlCommand.
But SqlComand also has method ExecuteXmlReader so you can do e.g.
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(sqlCommandInstance.ExecuteXmlRead er());
xmlDocument.Save(@"file.xml");
Check the MSDN documentation about ExecuteXmlReader, it works only with
special FOR XML SQL commands issued:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataSqlClientSqlCommandClassExecuteXmlR eaderTopic.asp>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 15 '06 #3


Dikkuuhh wrote:
I`m using ASP.NET 2.0, but i don`t understand what you are saying...

Do you have a small sample code where it happens??
I did post a code sample and a link to the documentation of the method
ExecuteXmlReader.
Here is more about that
<http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/xmlfromsqlsrv.aspx>
--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 15 '06 #4
I`m a newbie if it comes to xml so i didn`t get result in your sample
and your link.....

Can you give me a small sample working?

Many thanx,

Koen
Martin Honnen wrote:
Dikkuuhh wrote:
I`m using ASP.NET 2.0, but i don`t understand what you are saying...

Do you have a small sample code where it happens??

I did post a code sample and a link to the documentation of the method
ExecuteXmlReader.
Here is more about that
<http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/xmlfromsqlsrv.aspx>
--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 16 '06 #5


Dikkuuhh wrote:
I`m a newbie if it comes to xml so i didn`t get result in your sample
and your link.....

Can you give me a small sample working?
I did post a sample, I also posted links to documentation and more
complete samples. If you can't work with them then you would at least to
explain in detail what you have tried, where it failed to get further
help. But I suggest you then take the questions to an appropriate
Microsoft group.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 16 '06 #6

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

Similar topics

2
by: jfizer | last post by:
I have a web app that uses a form with its fields populated from XML using Microsoft.XMLDOM. The problem is that Microsoft.XMLDOM functions seem to run on their own thread, so I dont know when the...
3
by: Robert Zurer | last post by:
Hello all, I want to load an in-memory XmlDocument from the server to the client and create an XMLDOM object using javascript. I can do it from a url by calling this Javascript from the...
1
by: Dave Romig | last post by:
Can anyone provide guidance for saving and restoring an XMLDOM object as a binary blob? In a VB application, I need to repeatedly save and restore a large, dynamic XML document. Currently, the...
8
by: Mr. x | last post by:
Hello, How can I use xmlpath technogy by xmldom. (or there is another technique, but not xmldom). I need some code samples, please. Thanks :)
2
by: Trip | last post by:
Is possible to: a) save XMLHttpRequest object* (precisly: server response** which is in the form of xml) to the xml document(on the client side) by the help of JavaScript or b) directly load...
0
by: Robert Zurer | last post by:
Hello all, I want to load an in-memory XmlDocument from the server to the client and create an XMLDOM object using javascript. I can do it from a url by calling this Javascript from the...
1
by: kurtrips | last post by:
I am trying to use M$'s XMLDOM's save method but it is doing absolutely nothing. xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.load("bestscores.xml");...
2
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have the following code which I try to load an xml file, but in browser, I only get text value for each node, not whole xml string. I expect to see something like <name...
1
AnuSumesh
by: AnuSumesh | last post by:
Hi, I want to read the text property of XML file. My xml file is as follows: <?xml version="1.0"?> <Domain_Credentials> <User> anu </User>
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.