473,725 Members | 2,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2028
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=Modifi ed 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*********@nu esoft.co.uk> wrote in message
news:17******** *************** ***@posting.goo gle.com...
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=Modifi ed 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*********@nu esoft.co.uk> wrote in message
news:17******** *************** ***@posting.goo gle.com...
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
4130
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 objSQLConn As New SqlConnection(Constants.ConnectionString) Dim objAdapter As SqlDataAdapter Dim objDataRow, objDBRow As DataRow
2
2117
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 open the directory where the images are but I am having problems putting the images in the form and also linking a field in a table to this image. I would rather not have the images saved in access2000 but simple linked to the file in the directory...
2
4990
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) through a command button. For example: cell C5 on the selected excel spread sheet = textbox2 in the current form. This is for a service repair type database. The service technicians work out in the field and currently create their service orders...
5
3180
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 in code I can get that table imported without them having to go to options and show hidden tables and then import it manually? dixie
9
3916
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. There is no further explanation. What are the kinds of things that make this happen? Thanks from an obvious rookie. Gordon
1
2458
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 in fact five sheets in the Excel file. My original idea was to import the file into access and create a database file; which I did and worked beautifully. It generated five tables in the database as expected. However, I then thought why not...
17
2026
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 information listed below 02. In that table I have three columns that have numeric data in it (City, State, Marital_Status) 03. I need to convert the numeric data in table tbl_customer (City, State, Marital_Status) to alpha numeric data 04. using the...
11
2943
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, Sql Server claims that it has a character size limit ( which is 8060 ) so it cant procceed the import operation if the text file has a record bigger then 8060. The records , in the text file, have a size bigger then 8060. So we wont be able to...
2
2552
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 into listbox. and upon clicking table name in list box, i want it to import it to my current database( which is sql server). in order i used this code: Private Sub ListTables_AfterUpdate() docmd.TransferDatabase acLink, "Microsoft Access",...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9116
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.