Re: Manipulating DataSets through XML

From: Shock (no_at_way.com)
Date: 09/12/04


Date: Sun, 12 Sep 2004 18:44:07 -0500

Val wrote:

> Hi all,
> Im trying to make a lil database server, it communicates with clients
> through tcp connections.
> Its pretty cool so far, but manipulating with the DataSet is messy:
> There is a function which loads xml data (and schema) into the dataset but
> whats the way to delete records from a dataset using xml?
>
> So far my solution came to this:
>
> DataSet "A" - Contains the original records
> DataSet "B" - Contains same records as "A" but some have deleted
>
> 1.Create a new dataset "C" which contains deleted records using
> "B.GetChanges(DataRowState.Deleted)"
> 2.Convert "C" into xml string and send it to the server
>
> But ones "C" gets to server how do I delete the records in "A" using it?
> I could use "foreach" on all the records in "A" and delete them if they
> match records in "C", but surely theres a better way...
>
> Thank u!
> Val
>
>

Why not create a collection of objects (i.e. a collection of records to
be deleted) and pass that collection to the server? Then you could have
the server create an new instance of each record using an identifer from
each object (i.e. record). Then simply remove each object (i.e. record)
  from the database. This would be easily implemented using a
persistence framework such as Gentle.Net
(http://www.mertner.com/confluence/homepage.action).

This is pretty much the same basic idea, only it is much more OO than
just using ADO/ADO.NET, easier to implement IMHO, and it would possibly
be much faster.

Shock



Relevant Pages

  • Re: Manipulating DataSets through XML
    ... and manipulate the records inside the dataset. ... This server will be accessed by multiple users at once, ... >> Im trying to make a lil database server, ... >> There is a function which loads xml data into the dataset ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: IMAP server with fast search
    ... Vadik wrote: ... > Having all messages in one file with improve search, but opening and ... > manipulating such big file will slow down server. ...
    (Debian-User)
  • Re: Create a users homedirectory thru ldap
    ... > But that will not create the actual folder on the server. ... And either ADsSecurity.dll for manipulating the NTFS permissions directly ... from vbscript, or cacls.exe or xcacls.exe to do it more indirectly. ...
    (microsoft.public.windows.server.scripting)

Loading