RE: Multiple DataSets in one XML file

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Ilya Tumanov [MS] (ilyatum_at_online.microsoft.com)
Date: 03/14/05


Date: Mon, 14 Mar 2005 21:51:17 GMT

Unless you're taking some special care of XML structure, writing several
data sets into one XML would result in malformed XML document.
If you're fixing XML manually, look into ReadXml() overloads with
XmlReadMode argument and XmlReadMode.Fragment mode.
Again, it's up to you to find the right data set start and invoke ReadXml()
on it.

I don't see any advantages of that compared to normal file per data set
solution.
In fact, I do see a major disadvantage which is the need to overwrite the
entire file should you change even one record in one data set.
So I would suggest you don't do it.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
> From: sergio.rolanski@gmail.com (Sergio Rolanski)
> Newsgroups: microsoft.public.dotnet.framework.compactframework
> Subject: Multiple DataSets in one XML file
> Date: 14 Mar 2005 13:23:55 -0800
> Organization: http://groups.google.com
> Lines: 7
> Message-ID: <7371fd27.0503141323.6c98e343@posting.google.com>
> NNTP-Posting-Host: 200.138.40.128
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: 8bit
> X-Trace: posting.google.com 1110835436 8429 127.0.0.1 (14 Mar 2005
21:23:56 GMT)
> X-Complaints-To: groups-abuse@google.com
> NNTP-Posting-Date: Mon, 14 Mar 2005 21:23:56 +0000 (UTC)
> Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!news.glorb.com!postnews.google.com!not-for-mail
> Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.compactframework:73213
> X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
>
> It's very easy to DataSet.WriteXml() multiple dataset to a single xml
> file, but when I want to DataSet.ReadXml() I don't know how to specify
> whick dataset to read. Anybody knows if it's possible to have multiple
> dataset in a single xml file?
>
> Thanks,
> Sergio V. R.
>



Relevant Pages

  • Re: dataset.writeXml
    ... XML from the data set, then it should load up fine when you pass that back to a data set. ... Also, if you are writing to a string, why not use a StringWriter, and then get the string to pass around. ... not specifying any encoding anywhere. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: suggestions on serialization approach
    ... I am sure the data set would work. ... I was hoping the DOTNET way would be to simply serialize it ... then it is transformed again to xml. ... <stat xmlns:xsd="http://www.w3.org/2001/XMLSchema " ...
    (microsoft.public.dotnet.languages.vb)
  • Querying XML data through a dataset
    ... Mock up in XML ... Fill the data set with the XML data in the program ... As this is preliminary work for projects starting later this year I'm ... Three Bears Software, LLC ...
    (microsoft.public.dotnet.framework.adonet)
  • how to create xml schema object in asp.net 2.0?
    ... How do you use/access a strongly typed data set object (based on an xml ... when I dragged a stored procedure on to an xml schema ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Multiple DataSets in one XML file
    ... that's the idea of a Fragment mode - to allow loading of XML fragment. ... > Thank you for the answer Ilya. ... >> I don't see any advantages of that compared to normal file per data set ...
    (microsoft.public.dotnet.framework.compactframework)