为每个用户提供自己的数据集的最佳实践 [英] Best practice to give each user his own dataset

查看:64
本文介绍了为每个用户提供自己的数据集的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们正在使用vs2005,Ado.net 2.0

在数据库中是一个数据量的定义。
用户可以请求这些数据并对其进行更改。

当他保存此数据时,原始数据不得更改。
从那一刻开始,用户必须处理他自己的"自己"数据集。

此时,我们制作预定义数据的副本,并向用户提供此副本(他自己的数据)进行处理。
但是用户数量和数量数据是高的。
在启动时(存储过程)复制这些数据的过程现在需要几秒钟。
在这些数据中例如是500人的记录。用户最多只能改变10人。
因此我们复制了大量数据,因为我们不知道哪些改动会被改变。

我正在寻找一种方法检索预定义数据,并仅存储更改的记录。 
即使如此,请保留所有引用。

Hi,

We are using vs2005, Ado.net 2.0

In the database is a definition of a amount of data.
A user can request this data and make changes to it.

When he saves this data, the original data must not be altered.
From that moment on, the user must work on his 'own' dataset.

At this moment, we make a copy of the predefined data and give the user this copy (his own data) to work on.
But the amount of users and the amount of data is to high.
The proces to copy this data at start up (stored procs) now take up to several second.
In this data are for example 500 person records. The user wil only change up to 10 persons.
So we copy way to much data, because we don't know which recods will be altered.

I'm looking for a method to retrieve the predefined data, and only store the changed records. 
Even so keep all references.

推荐答案

您好,

在将数据从DataSet更新到DataBase之前,您可以在要更新的DataSet或DataTable上调用GetChanges,这将仅在更改时生成DataSet或DataTable。

如果这有帮助,请告知我们Juan
Hello,

Before updating the data from the DataSet to the DataBase you could call GetChanges on the DataSet or DataTable that you want to update, this will generate a DataSet or DataTable only with the changes.

Please let me know if this helps
Juan


这篇关于为每个用户提供自己的数据集的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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