Re: Database programminf question...
- From: Andrew Meador <ameador1@xxxxxxxxxxx>
- Date: Tue, 30 Oct 2007 18:06:52 -0700
Does writing the data to the XML files on the laptop retain the
original and changed states of the data so that it can be updated to
the server later? Also, I would have to create a new DataSet instance
and DataAdaptor instance to read the XLM file and push them back to
the database, will this work? All of the status is retained in the XML
files allowing them to be read back in without loosing any database
update potential?
Also, another thought I had, somewhat related to Michael C's post,
was: Is there a way to put an instance of SQL Server 2005 Express on
the laptop and have the DataSets/DataAdaptors be able to pull the data
from the server SQL instance and be able to maintain their state in
the laptop SQL instance in a way that would allow using the DataSet/
DataAdaptor (or another set) to finally update the changes back to the
server SQL instance? I would think that would be the faster more
efficient way (as far as using the data on the laptop), but I'm
inclined to think that the DataSet/DataAdaptors are not able to handle
that as they currently are designed. Am I wrong?
Thanks!
On Oct 30, 8:36 pm, Peter Bromberg [C# MVP]
<pbromb...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
If you are working with simple data that is being added to datatables in a
dataset, you can simply use the DataSet.WriteXml and ReadXml methods to store
and retrieve the contents of your dataset to an xml file.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
"Andrew Meador" wrote:
I am working on an application that will store data in SQL Server
2005 Express. The database will reside on our server at the office. I
need to write an application that can work with this data off site
during the day and then synch the changes back to the database at the
end of the day (or next morning).
I have been reading up on ADO.NET and see that you can use a
DataSet and a DataAdaptor to manage change tracking and updating of
the database with the changes. However, what I have read seems to
imply that this is all done in RAM. The laptop that will go out during
the day needs to be able to safeguard the changes to file, so in case
the laptop goes off, needs restarted, or whatever, the data (and
specifically the changes to the data) will not be lost. But, in the
end, I still need to push these changes back to the database when the
network is available again.
We are operating in an area that does not permit cellular based
internet access, so we have to do this based on no network access,
except for in the morning before going out, and later when we return
to the office.
I was wondering about having two DataAdaptors to work with the one
DataSet; one to pull the data from the database into the DataSet, and
another one to push/pull the data from to DataSet to XML files stored
on the laptop (the working set while out of the office). I can see how
to deal with reading and writing to the XML files and how to pull the
data from the database into the DataSet, but if the program closes and
thus the DataAdaptor that handles the link between the database and
the DataSet is killed, how can I get the changes abck to the database?
Another question here is how well the overall idea will work
performance wise. We will have about a dozen tables that need to be
worked with, two of which will have as many as 10,000 records each (at
~1.5KB per record). If these would have to be completely re-written
with every change I'd imagine this would get to be pretty slow. The
laptop is brand new with 2GB RAM, 120GB Hard Drive, and 2.2GHz Intel®
Core® 2 Duo Processor, so maybe it wouldn't be tooo bad, but...
I am looking for ideas here. If you have a better appraoch that has
nothing to do with XML that's fine, just so long as it is not costly,
crazy complex, or something I can't do with VS 2005 Pro and SQL Server
2005 Express (can't afford SQL Server 2005 Standard) ;) You know what
I mean...
Thanks in advance!!!- Hide quoted text -
- Show quoted text -
.
- Follow-Ups:
- Re: Database programminf question...
- From: Michael C
- Re: Database programminf question...
- References:
- Database programminf question...
- From: Andrew Meador
- Database programminf question...
- Prev by Date: Re: URGENT .NET requirement in Columbia, SC and Baltimore, MD
- Next by Date: Re: ?? Definite Assignment of Structs -- Language Spec Issue ??
- Previous by thread: Re: Database programminf question...
- Next by thread: Re: Database programminf question...
- Index(es):
Relevant Pages
|