Quick question - xml DataSet

  • Thread starter Thread starter jez
  • Start date Start date
Please see inline...

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: Quick question - xml DataSet
Date: Fri, 19 Mar 2004 12:04:34 +0100
Organization: Worldonline Belgium
Lines: 14
Message-ID: <[email protected]>
NNTP-Posting-Host: 213.177.151.7
X-Trace: news.worldonline.be 1079694280 28098 213.177.151.7 (19 Mar 2004 11:04:40 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Fri, 19 Mar 2004 11:04:40 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.co
m!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.tiscali.
ch!tiscali!newsfeed1.ip.tiscali.net!news.worldonline.be!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.compactframework:48989
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

In my DataSet that has been saved to an xml file I get the following in the
beginning of the file :

<?xml version="1.0" standalone="yes" ?>
<NewDataSet xmlns="http://tempuri.org/XMLSchema.xsd">

* what does the "NewDataSet" stand for ?

It's a DataSet name. In this case it's a default name.
(I gave another name to my DataSet
in my application)

Do you mean after XML is loaded?
Can I change it to something else ?

Sure, just change the name of the DataSet.

No.

Here's a sample code and resulting XML which would make things clear:

Code:

DataSet ds = new DataSet();
ds.DataSetName = "MyName";
ds.Namespace = "MyNameSpace";
ds.WriteXml("my.xml");

my.xml:

<?xml version="1.0" standalone="yes"?>
 
Thanks for the reply! Basically I create a DataSet before the xml file
is loaded with the following code :
private DataSet _CustomersDS = new DataSet("Customers");

Then I read the xml file in _CustomersDS. And then I write it back to
another xml file. To answer your question : I gave a name to the
DataSet before the xml is loaded. Do I also need to rename the DS
after the xml is loaded ?

thanks,
jez
 
Existing DataSet name will be overwritten with the name from XML you're
lording, original name will be lost.
So, unless you happy with the name from XML file, you need to change it
after XML is loaded.
New name will be saved to the new XML file.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
Ilya,

I added the .DataSetName and .NameSpace literally just after doing a
ReadXML yet for some reason when I write the xml file the namespace
and dataset name haven't changed. I even tried adding the two methods
before writing the xml file - no change.

Could I be doing something wrong or have forgotten to do something ?
 
I could not think of anything else...

Make sure the file is actually saved and you're checking saved file, not
some other file.
If it's not the problem, please post your code and XML file so I could try
to repro it. Thanks.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: (e-mail address removed) (jez)
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: Re: Quick question - xml DataSet
Date: 29 Mar 2004 05:36:23 -0800
Organization: http://groups.google.com
Lines: 100
Message-ID: <[email protected]>
References: <[email protected]>
<[email protected]>
NNTP-Posting-Host: 213.177.151.7
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1080567384 26288 127.0.0.1 (29 Mar 2004 13:36:24 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Mon, 29 Mar 2004 13:36:24 +0000 (UTC)
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
ul.t-online.de!t-online.de!news.glorb.com!postnews2.google.com!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.compactframework:49718
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Ilya,

I added the .DataSetName and .NameSpace literally just after doing a
ReadXML yet for some reason when I write the xml file the namespace
and dataset name haven't changed. I even tried adding the two methods
before writing the xml file - no change.

Could I be doing something wrong or have forgotten to do something ?

(e-mail address removed) ("Ilya Tumanov [MS]") wrote in message
Existing DataSet name will be overwritten with the name from XML you're
lording, original name will be lost.
So, unless you happy with the name from XML file, you need to change it
after XML is loaded.
New name will be saved to the new XML file.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!news.glorb.com!postnews2.google.com!not-for-mail following
in
the
 
Back
Top