473,320 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Merge data

..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
Nov 12 '05 #1
4 2342
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" <jo*******@microsoft.com> wrote in message
news:%2****************@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

Nov 12 '05 #2
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]" <di****@online.microsoft.com> wrote in message
news:Ob**************@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" <jo*******@microsoft.com> wrote in message
news:%2****************@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


Nov 12 '05 #3
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" <jo*******@microsoft.com> wrote in message
news:%2****************@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]" <di****@online.microsoft.com> wrote in message
news:Ob**************@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" <jo*******@microsoft.com> wrote in message
news:%2****************@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



Nov 12 '05 #4
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]" <di****@online.microsoft.com> wrote in message
news:u%****************@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" <jo*******@microsoft.com> wrote in message
news:%2****************@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]" <di****@online.microsoft.com> wrote in message
news:Ob**************@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" <jo*******@microsoft.com> wrote in message
news:%2****************@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



Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Newbie | last post by:
Hi, I am trying to merge data from two tables (over two servers, using dblink). Approx 40,000 records in each. Server1(source) and Server2(dest) On Server1, db-link "dblink1" points to...
3
by: Kevin King | last post by:
I have a question about an assignment I have. I need to count the number of comparisons in my merge sort. I know that the function is roughly nlog(n), but I am definately coming up with too many...
2
by: Steve M | last post by:
I'm trying to do invoke the mail merge functionality of MS Word from a Python script. The situation is that I have a template Word document, and a record that I've generated in Python, and I want...
2
by: William Wisnieski | last post by:
Hi Everyone, Access 2000 I have some code behind a button that performs a word merge with a query data source. The merge works fine. But what I'd like to do somehow is after the merge is...
1
by: Lisa | last post by:
I have a query named QryDept where one of the fields is DeptID. The query is used for the data source of a mail merge letter. I would like to control which department is to get the mail merge...
8
by: Squirrel | last post by:
Hi everyone, I've created a mail merge Word doc. (using Office XP) , the data source is an Access query. Functionality I'm attempting to set up is: User sets a boolean field to true for...
9
by: Neil Ginsberg | last post by:
I have a strange situation using Access to automate a Word mail merge. Using Access 2000 and Word 2000, the code opens Word, opens the document in Word, sets a table in the calling Access...
8
by: Darryl Kerkeslager | last post by:
I hope that although this is 25% Access and 75% Word, that someone will know ... The whole problem here arises because 1) Microsoft acknowledges an 'issue' wherein TextInput type FormFields are...
3
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge...
6
by: crealesmith | last post by:
Firstly, I have no problem with mail merging to Word, VB code for that works perfectly. On one mail merge I need to merge 15 fields of data that are from 3 seperate records. The 3 records are all...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.