473,386 Members | 1,846 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,386 software developers and data experts.

Importing Selected Data from XML

In order to achieve the archiving of old data from my database I have
exported the information from my dataset to an XML file using the
standard WriteXML method of the object. Now suppose in the future I
wish to restore only specific records (which all have a unique
reference) from that file back to the dataset so they can be restored
back to the database.

Can anyone tell me how I can allocate specific references so that only
those records are imported from the XML?

Regards

Lee
Nov 12 '05 #1
2 2003
This section of the programming guide talks about using datasets to update
the original data source:
http://msdn.microsoft.com/library/en...aseUpdates.asp

There is a ReadOnly property, RowState, attached to each row in the dataset.
RowState can be Unchanged, Added, Deleted, or Modified. When you Fill a
Dataset, the RowState for each row is set to "Unchanged". If you
subsequently change a row, the RowState for that row is then set to
"Modified". Later if you call da.Update() using that dataset, the rows that
have RowState=Modified will be re-applied to the original database. (using
the UpdateCommand on the data adapter).

But maybe you are talking about a "restore" case, or a scenario where you
want to slurp in a dataset from one source, and then push that dataset, or a
subset of it, into another datasource. In this case, updating any column
in the rows to be updated will allow you to do what you want. You could use
a timestamp column, for example.

But what if you don't want to update any of the columns? What if you want
EXACTLY the same data to be pushed back to a different datasource? The
problem is the RowState is readonly, so you cannot modify it directly.

This is a common scenario.
Here's an article on how to do it.
http://www.knowdotnet.com/articles/datasetmerge.html

-D
"Lee Ottaway" <le*********@nuesoft.co.uk> wrote in message
news:17**************************@posting.google.c om...
In order to achieve the archiving of old data from my database I have
exported the information from my dataset to an XML file using the
standard WriteXML method of the object. Now suppose in the future I
wish to restore only specific records (which all have a unique
reference) from that file back to the dataset so they can be restored
back to the database.

Can anyone tell me how I can allocate specific references so that only
those records are imported from the XML?

Regards

Lee

Nov 12 '05 #2
This section of the programming guide talks about using datasets to update
the original data source:
http://msdn.microsoft.com/library/en...aseUpdates.asp

There is a ReadOnly property, RowState, attached to each row in the dataset.
RowState can be Unchanged, Added, Deleted, or Modified. When you Fill a
Dataset, the RowState for each row is set to "Unchanged". If you
subsequently change a row, the RowState for that row is then set to
"Modified". Later if you call da.Update() using that dataset, the rows that
have RowState=Modified will be re-applied to the original database. (using
the UpdateCommand on the data adapter).

But maybe you are talking about a "restore" case, or a scenario where you
want to slurp in a dataset from one source, and then push that dataset, or a
subset of it, into another datasource. In this case, updating any column
in the rows to be updated will allow you to do what you want. You could use
a timestamp column, for example.

But what if you don't want to update any of the columns? What if you want
EXACTLY the same data to be pushed back to a different datasource? The
problem is the RowState is readonly, so you cannot modify it directly.

This is a common scenario.
Here's an article on how to do it.
http://www.knowdotnet.com/articles/datasetmerge.html

-D
"Lee Ottaway" <le*********@nuesoft.co.uk> wrote in message
news:17**************************@posting.google.c om...
In order to achieve the archiving of old data from my database I have
exported the information from my dataset to an XML file using the
standard WriteXML method of the object. Now suppose in the future I
wish to restore only specific records (which all have a unique
reference) from that file back to the dataset so they can be restored
back to the database.

Can anyone tell me how I can allocate specific references so that only
those records are imported from the XML?

Regards

Lee

Nov 12 '05 #3

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

Similar topics

1
by: Christine Mccormick | last post by:
Hello, I am trying to import an XML document into SQL Server. I have tried DTS, bulk loading into SQL server and anything else I can think of... The only thing that has worked slightly is : Dim...
2
by: steve | last post by:
Hello, I am trying to import an image file into a form. This would be a persons picture saved in the same directory for every unique record. I don't have any problems making an action button to...
2
by: Mr. Bungle | last post by:
When importing excel from access I am fully aware that one can import directly into a table. Can you get as specific via code or something to import data from an excel sheet to a FORM (Not Table)...
5
by: dixie | last post by:
If I sent a user an empty database container - dB with no tables and I needed them to import their tables into it and one of their tables was a hidden table with the prefix Usys, is there any way...
9
by: jillandgordon | last post by:
I am trying to import an excel file into Access 97. It looks perfectly all right but, every time I try to import it, I get to the lst step and am told that it was not imported due to an error. ...
1
by: Geoff Jones | last post by:
Hi I have a question which I hope somebody can answer. I have written a VB application with which I want to import an Excel file, analyze the data within it and do some calculations. There are...
17
by: OdAwG | last post by:
Just some questions regarding tables. I am new Access Database and need a little help. I have the following data listed below 01. I have a table called tbl_Customer with the following...
11
by: panic attack | last post by:
Hello everbody, Our system is using Sql Server 2000 on Windows XP / Windows 2000 We have a text file needs to be imported into Sql Server 2000 as a table. But we are facing a problem which is,...
2
by: drek01 | last post by:
hi i am trying to import access tables into my backend database( current database) which is sql server. i created file browser which browse access database from harddrive and places all the tables...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.