处理多用户环境的最佳方式 [英] Best way to handle multi-user environment

查看:62
本文介绍了处理多用户环境的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在多用户环境中处理数据的最佳方法是什么?我们

的表单允许用户在SQL服务器上的

表中添加编辑和删除数据。数据可以在多台机器上同时在
进行编辑。如何使数据集不断更新?

对数据所做的更改?我正在玩只是调用填充方法,

但有时看起来很不稳定。特别是当删除记录时,他们似乎没有从网格中移除

来自另一种形式。我试图在Position_Changed事件中调用数据

适配器上的fill方法。这似乎有点工作。

添加和删除记录时出现问题。如果我转到新的

记录并调用填充方法,如果有新记录,它们会在网格中放入

,但之后没有新行开始添加新记录。


正如你所看到的,我在这里遇到了多个问题..那么这个

怎么办呢?安全?有一个简单的程序,我只是

没找到?


Aaron

-

---

Aaron Smith

删除-1-给我发电子邮件。垃圾邮件很糟糕。

What is the best way to handle data in a multiple user environment? We
have forms that will allow users to add edit and delete data from a
table on SQL server. The data could be edited on multiple machines at
the same time. How do you keep the dataset constantly updated with
changes made to the data? I''m playing with just calling the fill method,
but it seems pretty unstable at times. Especially when deleting records,
they don''t seem to remove themselves from the grid when it is deleted
from another form. I am trying to call the fill method on the data
adapter in the Position_Changed event. This seems to work a little bit.
The problem comes in when adding and deleting records. If I go to a new
record and call the fill method, if there is a new record, they get put
in the grid, but then there is no new line to start adding a new record.

As you can see, I''m having multiple problems here.. So how is this
supposed to be done safely? Is there an easy procedure that I am just
not finding?

Aaron
--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.

推荐答案

嗨Aaron,


填充方法可用于刷新数据来自数据源。回顾

各种论点。


至于数据网格,你应该尝试这样的事情:


MyGrid .DataSource = ds;

MyGrid.DataBind();


HTH,


Bernie Yaeger

" Aaron Smith" <第********** @ smithcentral.net>在消息中写道

新闻:Uc ******************* @ newssvr33.news.prodigy。 com ...
Hi Aaron,

The fill method can be used to refresh the data from the datasource. Review
its various arguments.

As for the datagrid, you should try something like this:

MyGrid.DataSource = ds;
MyGrid.DataBind();

HTH,

Bernie Yaeger

"Aaron Smith" <th**********@smithcentral.net> wrote in message
news:Uc*******************@newssvr33.news.prodigy. com...
在多用户环境中处理数据的最佳方法是什么?我们的表单允许用户在SQL服务器上的表中添加编辑和删除数据。可以在同一时间在多台机器上编辑数据。如何通过对数据进行更改来不断更新数据集?我正在玩只是调用填充方法,但有时似乎很不稳定。特别是当删除记录时,当它们从另一个表单中删除时,它们似乎不会从网格中移除它们。我试图在
Position_Changed事件中调用数据适配器上的fill方法。这似乎有点工作。添加和删​​除记录时会出现问题。如果我转到新记录并调用
填充方法,如果有新记录,它们会被放入网格中,但是后来没有新行开始添加新记录。

正如你所看到的,我在这里遇到了多个问题..那么这个怎么安全地完成呢?有一个简单的程序,我只是没有找到?

Aaron
-
---
Aaron Smith
删除 - 1-给我发电子邮件。 Spam糟透了。
What is the best way to handle data in a multiple user environment? We
have forms that will allow users to add edit and delete data from a table
on SQL server. The data could be edited on multiple machines at the same
time. How do you keep the dataset constantly updated with changes made to
the data? I''m playing with just calling the fill method, but it seems
pretty unstable at times. Especially when deleting records, they don''t
seem to remove themselves from the grid when it is deleted from another
form. I am trying to call the fill method on the data adapter in the
Position_Changed event. This seems to work a little bit. The problem comes
in when adding and deleting records. If I go to a new record and call the
fill method, if there is a new record, they get put in the grid, but then
there is no new line to start adding a new record.

As you can see, I''m having multiple problems here.. So how is this
supposed to be done safely? Is there an easy procedure that I am just not
finding?

Aaron
--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.



嗨Aaron,


fill方法可用于刷新数据源中的数据。回顾

各种论点。


至于数据网格,你应该尝试这样的事情:


MyGrid .DataSource = ds;

MyGrid.DataBind();


HTH,


Bernie Yaeger

" Aaron Smith" <第********** @ smithcentral.net>在消息中写道

新闻:Uc ******************* @ newssvr33.news.prodigy。 com ...
Hi Aaron,

The fill method can be used to refresh the data from the datasource. Review
its various arguments.

As for the datagrid, you should try something like this:

MyGrid.DataSource = ds;
MyGrid.DataBind();

HTH,

Bernie Yaeger

"Aaron Smith" <th**********@smithcentral.net> wrote in message
news:Uc*******************@newssvr33.news.prodigy. com...
在多用户环境中处理数据的最佳方法是什么?我们的表单允许用户在SQL服务器上的表中添加编辑和删除数据。可以在同一时间在多台机器上编辑数据。如何通过对数据进行更改来不断更新数据集?我正在玩只是调用填充方法,但有时似乎很不稳定。特别是当删除记录时,当它们从另一个表单中删除时,它们似乎不会从网格中移除它们。我试图在
Position_Changed事件中调用数据适配器上的fill方法。这似乎有点工作。添加和删​​除记录时会出现问题。如果我转到新记录并调用
填充方法,如果有新记录,它们会被放入网格中,但是后来没有新行开始添加新记录。

正如你所看到的,我在这里遇到了多个问题..那么这个怎么安全地完成呢?有一个简单的程序,我只是没有找到?

Aaron
-
---
Aaron Smith
删除 - 1-给我发电子邮件。 Spam糟透了。
What is the best way to handle data in a multiple user environment? We
have forms that will allow users to add edit and delete data from a table
on SQL server. The data could be edited on multiple machines at the same
time. How do you keep the dataset constantly updated with changes made to
the data? I''m playing with just calling the fill method, but it seems
pretty unstable at times. Especially when deleting records, they don''t
seem to remove themselves from the grid when it is deleted from another
form. I am trying to call the fill method on the data adapter in the
Position_Changed event. This seems to work a little bit. The problem comes
in when adding and deleting records. If I go to a new record and call the
fill method, if there is a new record, they get put in the grid, but then
there is no new line to start adding a new record.

As you can see, I''m having multiple problems here.. So how is this
supposed to be done safely? Is there an easy procedure that I am just not
finding?

Aaron
--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.



感谢Bernie ..我打算用DataBind()方法试一试。

之前我没有那个。我只是设置

grid.DataSource = Nothing,然后将它设置为数据集并获得

勾选它没有在网格中显示任何内容。 : - /


Bernie Yaeger写道:
Thanks Bernie.. I''m going to give it a shot with that DataBind() method.
I didn''t have that in there before. I was just setting the
grid.DataSource = Nothing, then Setting it to the dataset and getting
ticked off that it didn''t display anything in the grid. :-/

Bernie Yaeger wrote:
嗨Aaron,

填充方法可以用来刷新数据来自数据源。回顾它的各种论点。

对于datagrid,你应该尝试这样的事情:

MyGrid.DataSource = ds;
MyGrid.DataBind ();

HTH,

Bernie Yaeger

Aaron Smith <第********** @ smithcentral.net>在消息中写道
新闻:Uc ******************* @ newssvr33.news.prodigy。 com ...
Hi Aaron,

The fill method can be used to refresh the data from the datasource. Review
its various arguments.

As for the datagrid, you should try something like this:

MyGrid.DataSource = ds;
MyGrid.DataBind();

HTH,

Bernie Yaeger

"Aaron Smith" <th**********@smithcentral.net> wrote in message
news:Uc*******************@newssvr33.news.prodigy. com...
在多用户环境中处理数据的最佳方法是什么?我们的表单允许用户在SQL服务器上的表中添加编辑和删除数据。可以在同一时间在多台机器上编辑数据。如何通过对数据进行更改来不断更新数据集?我正在玩只是调用填充方法,但有时似乎很不稳定。特别是当删除记录时,当它们从另一个表单中删除时,它们似乎不会从网格中移除它们。我试图在
Position_Changed事件中调用数据适配器上的fill方法。这似乎有点工作。添加和删​​除记录时会出现问题。如果我转到新记录并调用
填充方法,如果有新记录,它们会被放入网格中,但是后来没有新行开始添加新记录。

正如你所看到的,我在这里遇到了多个问题..那么这个怎么安全地完成呢?有一个简单的程序,我只是没有找到?

Aaron
-
---
Aaron Smith
删除 - 1-给我发电子邮件。垃圾邮件糟透了。
What is the best way to handle data in a multiple user environment? We
have forms that will allow users to add edit and delete data from a table
on SQL server. The data could be edited on multiple machines at the same
time. How do you keep the dataset constantly updated with changes made to
the data? I''m playing with just calling the fill method, but it seems
pretty unstable at times. Especially when deleting records, they don''t
seem to remove themselves from the grid when it is deleted from another
form. I am trying to call the fill method on the data adapter in the
Position_Changed event. This seems to work a little bit. The problem comes
in when adding and deleting records. If I go to a new record and call the
fill method, if there is a new record, they get put in the grid, but then
there is no new line to start adding a new record.

As you can see, I''m having multiple problems here.. So how is this
supposed to be done safely? Is there an easy procedure that I am just not
finding?

Aaron
--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.




-

---

Aaron Smith

删除-1-给我发电子邮件。垃圾邮件糟透了。


--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.


这篇关于处理多用户环境的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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