473,624 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Database programminf question...

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!!!

Oct 30 '07 #1
15 1728
"Andrew Meador" <am******@hotma il.comwrote in message
news:11******** **************@ v3g2000hsg.goog legroups.com...

Whatever solution you come up with will have to store the data on the HDD of
the laptop somehow. Just pick your method
1) XML
2) SQLExpress
3) MS Access
4) Some other method

Seeing it's free, I'd go with no 2 myself. It's also got replication
abilities built in, although these might be restricted for the free version.
You still get the full speed and flexibility of sqlserver and can execute
all your usual sql statements and use integrity, stored procs etc.
Oct 30 '07 #2
If you are working with simple data that is being added to datatables in a
dataset, you can simply use the DataSet.WriteXm l 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!!!

Oct 31 '07 #3
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...@yaho o.yohohhoandabo ttleofrum.comwr ote:
If you are working with simple data that is being added to datatables in a
dataset, you can simply use the DataSet.WriteXm l 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 -

Oct 31 '07 #4
"Andrew Meador" <am******@hotma il.comwrote in message
news:11******** *************@o 3g2000hsb.googl egroups.com...
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?
What about this. Add a column, say UpdateTime, to your database which stores
the date/time records are updated. Use a trigger to keep this column correct
so the time is always taken from the server, not the client. When copying
data to the laptop copy this column also. Then create a second column, say
UpdateTimeRemot e, in the data on the laptop only which stores the date/time
that updates are done on the laptop. Then when copying data back to the PC
grab all the records that have a NOT NULL UpdateTimeRemot e and copy each
back to the sqlserver database. For each row that you copy back check that
UpdateTime is the same, if it is not then you know the data has been changed
on the PC by another user and you can decide what to do (fail, overwrite or
prompt the user).

As a side note, this isn't really any different to when you have a direct
connection to the database because when your windows app grabs the data from
the database it makes a copy and when it saves it it can check the
UpdateTime column to see if another user has changed the data.

BTW, in answer to your question above, I don't think the XML will keep the
state of your datatable, if you have rows marked as changed then I believe
the changed flag will be cleared when you save.

Michael
Oct 31 '07 #5
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!!!
I would use an sql express database on the laptop which would (when
online) be synced to/from the master.
I would also have (in the master & client) a timestamp column on each
table that needed synching which would be used to determine the last
change/insert time.
You would need to keep your clock's in sync to preserve latest changes
though.
Check out the Timestamp datatype in MSSQL BOL.

JB
Oct 31 '07 #6
If you can wait for VS2008, then you might want to look at "Local
Database Cache". I haven't fully investigated it myself yet, other
than it appears as a template in VS2008 beta 2, and *sounds* like it
might do something along this line.

http://techedbloggers.net/News/19002.item

Marc

Oct 31 '07 #7
I think nntp ate my post... I don't know much about it, but if you can
wait for VS 2008, you might want to look into "Local Database Cache":
http://techedbloggers.net/News/19002.item

I haven't look into it yet (it is on my list...) - but it sounds like
it might be useful...

Marc

Oct 31 '07 #8
"Marc Gravell" <ma**********@g mail.comwrote in message
news:11******** **************@ d55g2000hsg.goo glegroups.com.. .
>I think nntp ate my post...
No, it's there.

Michael
Nov 1 '07 #9
On Oct 31, 5:30 pm, Marc Gravell <marc.grav...@g mail.comwrote:
I think nntp ate my post... I don't know much about it, but if you can
wait for VS 2008, you might want to look into "Local Database Cache":http://techedbloggers.net/News/19002.item

I haven't look into it yet (it is on my list...) - but it sounds like
it might be useful...

Marc
That looks awsome Marc - thanks for the heads up! I asked "The Elder"
about how this will be working with SQL Server 2005 Express (as well
as other OLE and ODBC datbases as well), as his post only discussed
this in relation to using SQL Server Compact Edition 3.5. I'll post
his response if/when he answers me. But yes, this looks like it will
do this type of thing very well. It even has controls/forms for
letting users decide how to handle update synchronozation issues
(where the data has been changed on the server since the initial
sync). This looks very nice from what his post showed. I may just work
on other parts of this project and hold off on implementing this part
until VS 2008 is released.

Thanks again.

Nov 1 '07 #10

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

Similar topics

18
7363
by: cjl | last post by:
Hey all: I know that it is silly in the age of Google to 'lose' something on the internet, but I recently checked out a project that had implemented a database with a subset of SQL in pure client-side javascript. I forgot to bookmark it, and now I can't find it. Anyone?
8
2562
by: Inspector | last post by:
I'm hoping I might be able to pick someone's brain out there. Our company is currently running an inhouse application in which data is being stored in SQL. Included in this data are thousands (over 100,000) of .jpg images. I am starting to run out of disk space and a developer suggested that we take the images out of SQL and put them in a file. In doing they indicated we could recover the SQL database faster if needed, we could also...
29
3561
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this one data field - but i'm not sure) :-) Background info:
8
1579
by: mesut | last post by:
Mybe it's a stupid question but : I'm starting to learn VB.NET. I have some basic skills. I'm from Mainframe world and I have same question to make my DATABASES (tables and relation) I would like to make ask my question by example. Let's say I'm a sales company I'm selling products to customers. Okay? I have these tables (databases) and fields and I have these questions. I have created these tables in VB.NET Database Connections IDE...
35
4828
by: Terry Jolly | last post by:
Web Solution Goal: Have a global database connection Why: (There will be 30+ tables, represented by 30+ classes) I only want to reference the database connection once. I put the connection string in the web.config. I created a class with a static database connection and the class opens and closes the database.
2
4713
by: clinttoris | last post by:
Hello, If someone could help me it would be appreciated as I am not having much luck. I'm struggling with my asp code and have some questions relating to asp and oracle database. First question. I have a web survey that I am working on and have successfully dynamically taken the info from a database, displayed it on the screen and then taken the users answers and inserted them into a
5
2325
by: Slant | last post by:
Here's a question that most will have different answers to. I'm just dying to find a solution that seems halfway automated!! There really are two seperate issues which might be answered by the same answer. Web App: - constants.php begin - define("DB_HOST", "locahost"); .... to include the standard connection info define("DB_NAME", "mydatabase");
4
2914
by: dgleeson3 | last post by:
Hello all I am creating a VB.Net distributed SQL server 2005 application. Each computer in the system has a database with a table of users and their telephone numbers. Each computer has a unique 4 digit identifying code. The central server runs an application which reads the database table on each computer.
2
2045
by: HeMan_Speaks | last post by:
I m currently developing a java based application and want to know how can i make client access database located on the server?
0
8233
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8675
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
8619
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8334
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6108
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
4078
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...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
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 we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.