2 questions. Partial SqlDataAdapter.Fill() and ReadXml()

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

From: Jon Brunson (JonBrunson_at_NOSPAMinnovationsoftwareDOTcoPERIODuk)
Date: 09/16/04


Date: Thu, 16 Sep 2004 15:46:04 +0100

1. Is it possible to setup at SqlDataAdapter to only .Fill() a DataTable
with the rows that have changed? ie, if I have a table with 10,000
records in it, and I change 1 of them, can .Fill() only change that 1
row (nice & quick), rather than re-populate all 10,00 rows (which would
take some time)

2. After loading a DataTable using SqlDataAdapter.Fill(), is it possible
to do this:
  a) Save that table to Xml (Load it into a DataSet, then
DataSet.WriteXml()).
  b) Load it back again (DataSet.ReadXml())
  c) Use another SqlDataAdapter to .Fill() the table properly, knowing
that the rows that already exist in the DataTable came from the
database, and should be updated/deleted if the database has made such
changes to them.
Currently I can only seem to make the SqlDataAdapter.Fill() method add
all the rows again (eg. if the table has 5 rows, after loading from Xml
and .Fill()ing, it contains 10). It's as if the SqlDataAdapter doesn't
know which Xml row matches each row in the database.



Relevant Pages

  • Re: filehandle, read lines
    ... split the orders and load them into a database for further processing. ... Generally XML should be parsed by an XML ... cleaner if the code to burn data was all in one place. ...
    (comp.lang.perl.misc)
  • Re: Fill Database Table with Sample data
    ... Have an opinion on the effectiveness of Microsoft Embedded newsgroups? ... > I want to load some sample data for my nunit unit tests in the database. ... file that is generated by the command "SELECT * FROM SomeTbl FOR XML AUTO". ... I want to load this back to the table without much effort. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: XML memory stream
    ... Firstly, you can't really load xml "into" an xml-reader, as it doesn't ... If you want to manipulate the data (in a more convenient than string ... Load() method accepts an input stream, ... essentially an entire database), then the corresponding XmlDocument will be ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: 2 questions. Partial SqlDataAdapter.Fill() and ReadXml()
    ... You can, however, add a timestamp column to your database ... Don't forget to save schema (separately or within XML). ... Don't forget to load schema prior to the data. ... Without primary key it has no way to determine if row is already in the ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: XML or SQL Server?
    ... Recipe Ingredients... ... load performance. ... I would recommend using a database of some sort ... ... XML files ...
    (microsoft.public.dotnet.languages.vb)