473,467 Members | 1,303 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DataSet.WriteXML

I have an app that a tiny xml file for each transaction. These files are
put in a pick-up folder for another app which takes the xml files out of
the pick-up folder and processes them.

My question is a simple (and perhaps stupid) one: when DataSet.WriteXML
executes, does it (A) write the XML file in a temp folder and then transfer
it to my target, or (B) write the XML file directly to the target?

My reason for asking is because I don't want to run into a situation where
my polling app is trying to pick up a file that my main app is in the
middle of writing.
Mar 7 '08 #1
2 1223

This is probably a hack...but I'll mention it.

You could write the file as
"file_0001111.txt"
and then after it finishes writing out..
rename it to
"file_0001111.xml"

and then only poll for .xml

Maybe someone else can offer a better solution.

...

My guess is that a rename is faster then a write.
Have you had trouble, or just anticipating trouble?

"Scott McNair" <sm*****@beachexpress.takethispartout.comwrote in message
news:Xn**********************************@207.46.2 48.16...
>I have an app that a tiny xml file for each transaction. These files are
put in a pick-up folder for another app which takes the xml files out of
the pick-up folder and processes them.

My question is a simple (and perhaps stupid) one: when DataSet.WriteXML
executes, does it (A) write the XML file in a temp folder and then
transfer
it to my target, or (B) write the XML file directly to the target?

My reason for asking is because I don't want to run into a situation where
my polling app is trying to pick up a file that my main app is in the
middle of writing.

Mar 7 '08 #2
One more thing you could do is to write the xml file as xml but it will
have one name during the writing. After the main app has completed
writing the xml file, then rename it to something that the target app
would look for. If you write it as text, you won't have the xml tags.
So I would stay with the xml write. And another thing as long as you
are always picking up an xml file with the same name each time is to
check the create date of the file on the target app. This will help
prevent picking up the same file multiple times (unless you are already
deleting the file after you pick it up). Either way, it is always a
good practice to check the create date when picking up the same named
file.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Mar 7 '08 #3

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

Similar topics

4
by: Simon | last post by:
Hi all, I have a process, where I take a dataset from an SQL call, and need to write an XML file from that dataset. The data set can contain 10's of tables, each with 100's of rows, and I have...
1
by: Rahul Agarwal | last post by:
Hi I am trying to write data back to the client using dataset.WriteXML and I have set the Thread.CurrentThread.CurrentCulture to "no" (norwegian) just before writing the data using WriteXML....
3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
2
by: Andreas Palm | last post by:
I have a dataset that has DBNull in certain columns, now when I write out this one to XML, I only get the columns as elements that do have data in it. However I do need also the empty colums as...
3
by: Joe98765 | last post by:
I have data coming from SQL Server and need to write out some XML. I have a schema(xsd) for this XML file. Right now I am bringing in the DataSet and writing out the elements and attributes myself...
4
by: Wes | last post by:
Hello, I have an application using an xml dataset to store app and user settings. The problem I am having is related to writexml. I have a save button on my application that updates the dataset...
3
by: jcrouse | last post by:
I have the following code that creates a couple of XML files: Dim dt1 As New DataTable("P1JoyUp") If H = True Then Dim dsH As New DataSet("HCPViewer") dsH.Tables.Add(dt1)
17
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
2
by: David Richards | last post by:
Hi, I was wondering if anyone could help me. I have DataSet that contains the following data tables Customers, Calls, Quotes, QuoteDetails, Competitors, Contacts, Notes, and I have setup...
4
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I've got a DataSet that I save as XML using the DataSet DataTable's WriteXml method. If I say XmlWriteMode.IgnoreSchema, it shows up great in Excel, but I can not reopen the file in my...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.