SQL Server CE >> Dump SQL CE Database into dataset XML

by Sai » Thu, 20 May 2004 03:24:42 GMT

Hi all,

I am trying to dump a SQL Server CE database (whose structure I will not
know at runtime) into a dataset and then perform a writexml on that dataset.
The desktop application will have the smarts to process this dataset xml but
not the pocket pc application dumping out the xml.

How can I write generic ado based code to dump out the entire database into
a dataset? All the code samples I see assume knowledge of the database
structure and the relationships between the tables. Is there a simple
command I am missing with which I can point a dataset at a database and tell
it populate itself (tables, subtables, Foreign key relations etc.)

(Merge replication and RDA are not options since my desktop database could
be access or sql server)

Thanks in advance for your help


SQL Server CE >> Dump SQL CE Database into dataset XML

by Y. Sivaram » Thu, 20 May 2004 07:54:19 GMT

I do not think there is a single command that can do this. One option is you
can query the system tables of the CE Database and get the necessary details
of tables, indexes, relationships etc and then use them to build the

Best Regards,
Y. Sivaram


SQL Server CE >> Dump SQL CE Database into dataset XML

by mrameshchandra » Tue, 01 Jun 2004 00:21:57 GMT


How can i retrieve the list of child tables in Sql Ce using C#? This is very very urgent. Please reply soon.

thanks and regards..

Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

SQL Server CE >> Dump SQL CE Database into dataset XML

by Sai » Fri, 18 Jun 2004 06:33:46 GMT

do a "select *" on each table and put each table in a datatable. Put these
dataset and then write it out using this function:

Private Sub WriteXmlToFile(ByVal thisDataSet As DataSet, ByVal sFilePath As

If thisDataSet Is Nothing Then


End If

' Create the FileStream to write with.

Dim myFileStream As New System.IO.FileStream(sFilePath,

' Create an XmlTextWriter with the fileStream.

Dim myXmlWriter As New System.Xml.XmlTextWriter(myFileStream,

' Write to the file with the WriteXml method.

thisDataSet.WriteXml(myXmlWriter, XmlWriteMode.WriteSchema)


End Sub

This is very very urgent. Please reply soon.
ASP.NET resources...

Similar Threads

1. Dump SQL Server database to XML through C#

Ok, I'm trying to dump an SQL Server 2005 database to XML via C#, and
I'm having some troubles.  I'm relatively new to the whole .net thing,
so there may be some stupid/basic questions/assumptions involved.

The first way I thought about doing it was dumping the entire dataset
to XML.  However, as far as I can tell there's no way to populate the
entire dataset at once (I'm using an auto-generated dataset from Visual
Studio 2005).  I think if I could do that it would be simplest, but I
haven't even found something hinting that its possible.

Right now I've got a partial solution where I loop through each of the
tables and print that out as XML.  However, that is printing them out
as individual entities, instead of printing out the document as one
entire XML document.  While that might work, I'd much rather have it
all nice and together.
<database><table1>...</table1><table2>...</table2>... is what I'd like.
 What I'm getting is

2. SQL CE 2.0 database to XML

3. Read XML into Dataset and load SQL server table from Dataset

Hello all,
I am working on a project with the following characteristics:

1. Load data from a SQL server table to an xml file

2. Read the xml file into a dataset.

3. Load data from the dataset into another SQL server table.

I was able to accomplish the first objective.
I used the following code to read the generated xml file into a dataset.
Dim strXml As String = "C:\Customers.xml"

Dim sr As StreamReader = New StreamReader(strXml)

Dim ds As DataSet = New DataSet

ds.ReadXml(sr, XmlReadMode.IgnoreSchema)

How can I traverse in the dataset and post each row to my desired table on a
different SQL server?

Any help will be greatly appreciated.


4. Looking for samples of parsing xml with linq dump to database table - CSharp/C#

5. XML between SQL Server and SQL Server CE over Internet

We're going to have PocketPCs out in the field, connected to the server at HQ over the internet through GPRS. It is assumed that they'll be connected only some of the time, so each has a client VB.NET app and SQL Server CE.
When some important configuration data (the structure of a survey) - held in the central SQL Server - is modified at HQ, I want those changes to be transmitted to the PocketPCs by XML. I don't want to use replication or RDA, because we're committed to sending the results back in XML format.
How can this be implemented? I want the PocketPCs to receive XML with the survey structure. At that point I can get it into the local SQL Server CE database - I reckon it would be quicker during the bulk of the application's stuff to use a database instead of messing around with accessing XML data at run-time. But when the chages are made at the server, how can this trigger the transmission of the XML, and what happens if some of the PocketPCs are not connected? Can I do it so that they'll queue until the devices come online?
Well, thankis for reading all that - hope somebody can point me in the right direction.

6. Q: dump dataset to a table in SQL server - Asp.Net

7. How to upload Dataset read from XML to SQL Server Database

Hello All,

I am using SQL Server 2000 and .Net 2.0. I want to import XML files
into database. SQLXMLBulkLoad is useless since, our schema doesn't have
annotation required by that.

But I could read schema and xml file in dataset without problem. Now
only quesiton is how to insert this dataset in database. One way is
insert each record from dataset at a time, which I think is pretty
crude way. Is there any faster way to do bulk insert of dataset loaded
from xml into database?

Best Regards,

8. Howto fill a sql mobile database with a dataset filled with readxml