Re: Merge data

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: John Smith (johnsmith_at_microsoft.com)
Date: 01/06/05


Date: Thu, 6 Jan 2005 16:52:44 +1100

Yes, I have javascript on the client to manpulate the xml so there are no
server pulls for add, change and delete rows.
I have a commit button to send it all back to the server.

Is there an example of how to handle this?

doing a server pull for every little action is quite crazy.

mark

"Dino Chiesa [Microsoft]" <dinoch@online.microsoft.com> wrote in message
news:u%23gZDQH6EHA.3644@tk2msftngp13.phx.gbl...
> Hmm, depends.
>
> You can use DataSet in an ASP.NET Web form, and it certainly allows you to
> add/update/delete rows etc.
> The DataSet instance is only used server side, of course, and the logic to
> add/update rows in the table need to be handled by your server-side logic.
> On the client (browser) side, the client just gets an HTML table. there
> is no XML DOM involved there.
> At some point the conversation ends, the client clicks "all Done" and the
> server can apply the updates on the Database back to the original data
> source.
>
> Or, maybe you are talking about using Javascript in the browser to
> directly manipulate XML? That's a different story. Then yes, you would
> need to do as we've described.
>
> -D
>
>
>
> "John Smith" <johnsmith@microsoft.com> wrote in message
> news:%23fo8WW$5EHA.3736@TK2MSFTNGP10.phx.gbl...
>> Hi Dino,
>>
>> thank you for your response. So there is no easy way. It is as I thought.
>> I like using the XML Dom in a web page, as it allows the user to add,
>> change and delete rows in a table with no server pulls. If I could do the
>> same thing with a dataset then I would be happy, but I guess that it
>> would not work in other browsers.
>>
>> Wow, I'm really stuck.
>> thank you
>> mark
>>
>>
>> "Dino Chiesa [Microsoft]" <dinoch@online.microsoft.com> wrote in message
>> news:ObbDcU35EHA.2012@TK2MSFTNGP15.phx.gbl...
>>> If you keep the data in a DataSet, allowing the user to change the data
>>> in that form, then you can just apply updates back to the DB, you're
>>> done.
>>>
>>> if however, you convert the data from SQL into some other XML schema
>>> (your own schema), then allow changes, then want to apply those changes,
>>> you, the apps programmer, will have to produce logic that extracts the
>>> updates from the XML data and applies them into a dataset. Then again,
>>> just apply updates to the database itself.
>>>
>>> You have to handle the impedance mismatch between the XML document and
>>> the DataSet.
>>> If the changes are simple, ie, do not involve re-ordering of records, or
>>> changes in indexes, etc, then this "logic" could be as simple as
>>> iterating through N rows of a DataTable, and N elements in an XML Dom
>>> Document, comparing the fields, and making changes where necessary.
>>>
>>> Or, it could get messy.
>>> -Dino
>>>
>>>
>>>
>>>
>>> "John Smith" <johnsmith@microsoft.com> wrote in message
>>> news:%23ksO$Xc5EHA.1396@tk2msftngp13.phx.gbl...
>>>> .Net 2003 C#
>>>> I get xml from a sql database pull.
>>>> I put the data into a XMLDomDocument and then the user changes it.
>>>> I now need to update the database correctly. I need to be able to get
>>>> the data back correctly including add, change and delete to the
>>>> original data.
>>>>
>>>> When I pull the data from the db, I store a copy in a Dataset. So I end
>>>> up with a Dataset (original data) and an XML DOM Document with the
>>>> changed data.
>>>>
>>>> I would appreciate knowing how to do this correctly. I understand that
>>>> the DataSet.Merge does not work for some of this.
>>>>
>>>> Is there an example?
>>>> thank you
>>>>
>>>>
>>>
>>>
>>
>>
>
>


Quantcast