数据库程序问题... [英] Database programminf question...

查看:81
本文介绍了数据库程序问题...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个将数据存储在SQL Server中的应用程序

2005 Express。数据库将驻留在办公室的服务器上。我需要写一个可以在现场使用这些数据的应用程序

白天然后将更改同步到数据库

结束当天(或第二天早上)。


我一直在阅读ADO.NET,看到你可以使用

DataSet和DataAdaptor用于管理更改跟踪和更新数据库的更改。但是,我所看到的似乎是

暗示这都是在RAM中完成的。那天将在

期间外出的笔记本电脑需要能够保护对文件的更改,所以万一笔记本电脑熄火,需要重启,或者其他什么,数据(和

特别是对数据的更改)不会丢失。但是,在

结束时,当

网络再次可用时,我仍然需要将这些更改推回到数据库。


我们在一个不允许基于蜂窝网络的区域运营

互联网接入,所以我们必须在没有网络接入的情况下这样做,

除了早上外出之前,以及之后当我们返回办公室的时候。


我想知道有两个DataAdaptors可以用一个

DataSet;一个用于将数据从数据库中提取到DataSet中,另一个用于将数据从DataSet推送/拉出到XML文件存储在笔记本电脑上(工作时间为
)离开办公室时设置)。我可以看到如何处理读取和写入XML文件以及如何将数据库中的数据从数据库中提取到DataSet中,但是如果程序关闭并且

因此DataAdaptor处理数据库和

之间的链接DataSet被杀死了,我怎样才能将更改发送到数据库?


这里的另一个问题是整体想法将如何运作

表现明智。我们将有大约十几张需要与b $ b一起工作的桌子,其中两张桌子每张将有多达10,000张记录(每张记录的价格为每张b $ 1.5KB)。如果这些必须完全重写

我会想象每次改变都会变得相当缓慢。

笔记本电脑全新配备2GB内存,120GB硬盘和2.2GHz英特尔?

核心? 2 Duo处理器,所以也许它不会太糟糕,但是......


我在这里寻找想法。如果你有一个更好的appraoch和

无关,那就好了,只要它不贵,

疯狂的复杂,​​或者我的东西不能用VS 2005 Pro和SQL Server

2005 Express(买不起SQL Server 2005标准版);)你知道吗

我的意思是.. 。


提前致谢!!!

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

推荐答案

" Andrew Meador" < am ****** @ hotmail.comwrote in message

news:11 ********************** @ v3g2000hsg .googlegro ups.com ...

您提出的任何解决方案都必须以某种方式将数据存储在笔记本电脑的硬盘上。只需选择你的方法

1)XML

2)SQLExpress

3)MS Access

4)其他一些方法


看到它是免费的,我自己也没有2。它也有内置的复制功能,虽然这些功能可能会受到免费版本的限制。

您仍然可以获得sqlserver的全部速度和灵活性并且可以执行

所有常用的sql语句并使用完整性,存储过程等。
"Andrew Meador" <am******@hotmail.comwrote in message
news:11**********************@v3g2000hsg.googlegro ups.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.


如果您正在使用添加到数据表中的简单数据一个

数据集,您只需使用DataSet.WriteXml和ReadXml方法来存储

并将数据集的内容检索到xml文件。


- Peter

递归:见递归

网站: http://www.eggheadcafe.com

unBlog: http://petesbloggerama.blogspot.com

BlogMetaFinder: http://www.blogmetafinder.com


" Andrew Meador"写道:
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:

我正在开发一个将数据存储在SQL Server中的应用程序

2005 Express。数据库将驻留在办公室的服务器上。我需要写一个可以在现场使用这些数据的应用程序

白天然后将更改同步到数据库

结束当天(或第二天早上)。


我一直在阅读ADO.NET,看到你可以使用

DataSet和DataAdaptor用于管理更改跟踪和更新数据库的更改。但是,我所看到的似乎是

暗示这都是在RAM中完成的。那天将在

期间外出的笔记本电脑需要能够保护对文件的更改,所以万一笔记本电脑熄火,需要重启,或者其他什么,数据(和

特别是对数据的更改)不会丢失。但是,在

结束时,当

网络再次可用时,我仍然需要将这些更改推回到数据库。


我们在一个不允许基于蜂窝网络的区域运营

互联网接入,所以我们必须在没有网络接入的情况下这样做,

除了早上外出之前,以及之后当我们返回办公室的时候。


我想知道有两个DataAdaptors可以用一个

DataSet;一个用于将数据从数据库中提取到DataSet中,另一个用于将数据从DataSet推送/拉出到XML文件存储在笔记本电脑上(工作时间为
)离开办公室时设置)。我可以看到如何处理读取和写入XML文件以及如何将数据库中的数据从数据库中提取到DataSet中,但是如果程序关闭并且

因此DataAdaptor处理数据库和

之间的链接DataSet被杀死了,我怎样才能将更改发送到数据库?


这里的另一个问题是整体想法将如何运作

表现明智。我们将有大约十几张需要与b $ b一起工作的桌子,其中两张桌子每张将有多达10,000张记录(每张记录的价格为每张b $ 1.5KB)。如果这些必须完全重写

我会想象每次改变都会变得相当缓慢。

笔记本电脑是全新的2GB内存,120GB硬盘和2.2GHz英特尔??

核心? 2 Duo处理器,所以也许它不会太糟糕,但是......


我在这里寻找想法。如果你有一个更好的appraoch和

无关,那就好了,只要它不贵,

疯狂的复杂,​​或者我的东西不能用VS 2005 Pro和SQL Server

2005 Express(买不起SQL Server 2005标准版);)你知道吗

我的意思是.. 。


提前致谢!!!

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


将数据写入XML文件在笔记本电脑上保留了原始数据并更改了数据的状态,以便以后可以更新到服务器上的
?另外,我必须创建一个新的DataSet实例

和DataAdaptor实例来读取XLM文件并将它们推回到数据库的
,这会有效吗?所有状态都保留在XML

文件中,允许在不丢失任何数据库的情况下读回来

更新潜力?


另外,我有一个想法,有点与Michael C的帖子有关,

是:有没有办法把一个SQL Server 2005 Express实例放在

笔记本电脑并让DataSets / DataAdaptors能够从服务器SQL实例中提取数据

,并能够在笔记本电脑的SQL实例中保持其状态。允许使用DataSet /

DataAdaptor(或其他设置)最终将更改更新回

服务器SQL实例的方式?我认为这将是更快的更多

有效方式(就使用笔记本电脑上的数据而言),但是我很/>
倾向于认为DataSet / DataAdaptors无法处理当前设计的

。我错了吗?


谢谢!


10月30日晚上8:36,Peter Bromberg [C#MVP]

< pbromb ... @ yahoo.yohohhoandabottleofrum.comwrote:
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...@yahoo.yohohhoandabottleofrum.comwrote :

如果您正在处理正在添加到

数据集,您可以简单地使用DataSet.WriteXml和ReadXml方法来存储

并将数据集的内容检索到xml文件。


- 彼得

递归:见递归

网站:
http://www.eggheadcafe.com

unBlog: http://petesbloggerama.blogspot.com

BlogMetaFinder: http://www.blogmetafinder.com


" Andrew Meador"写道:
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:

我正在开发一个将数据存储在SQL Server中的应用程序

2005 Express。数据库将驻留在办公室的服务器上。我需要写一个可以在现场使用这些数据的应用程序

白天然后将更改同步到数据库

结束当天(或第二天早上)。
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).


我一直在阅读ADO.NET,看看你可以使用

DataSet和DataAdaptor来管理更改跟踪和更新

数据库的更改。但是,我所看到的似乎是

暗示这都是在RAM中完成的。那天将在

期间外出的笔记本电脑需要能够保护对文件的更改,所以万一笔记本电脑熄火,需要重启,或者其他什么,数据(和

特别是对数据的更改)不会丢失。但是,在

结束时,当

网络再次可用时,我仍然需要将这些更改推回到数据库。
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.


我想知道有两个DataAdaptors可以使用一个

DataSet;一个用于将数据从数据库中提取到DataSet中,另一个用于将数据从DataSet推送/拉出到XML文件存储在笔记本电脑上(工作时间为
)离开办公室时设置)。我可以看到如何处理读取和写入XML文件以及如何将数据库中的数据从数据库中提取到DataSet中,但是如果程序关闭并且

因此DataAdaptor处理数据库和

之间的链接DataSet被杀死了,我怎样才能获得对数据库的更改?
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?


这里的另一个问题是整体想法将如何运作

性能明智。我们将有大约十几张需要与b $ b一起工作的桌子,其中两张桌子每张将有多达10,000张记录(每张记录的价格为每张b $ 1.5KB)。如果这些必须完全重写

我会想象每次改变都会变得相当缓慢。

笔记本电脑全新配备2GB内存,120GB硬盘和2.2GHz英特尔?

核心? 2 Duo处理器,所以也许它不会太糟糕,但是......
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...


我在这里寻找想法。如果你有一个更好的appraoch和

无关,那就好了,只要它不贵,

疯狂的复杂,​​或者我的东西不能用VS 2005 Pro和SQL Server

2005 Express(买不起SQL Server 2005标准版);)你知道吗

我的意思是.. 。
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 -



这篇关于数据库程序问题...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆