473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Refilling dataset without changing context

Hi

I have a winform db app that is "bound" to a dataset...via data adpater,
binding source and all that. As this is a multi-user app I need to refill
dataset from time to time so the newest data is available for user to view.
My problem is that I

a) do not wish the app to become unresponsive while re-fill is being
performed so need to do it as background task if possible.

b) do not want the record context to change for user so user does not notice
any disruption.

My question is, are the above possible? If so, how? If not what is an
alternate strategy?

Thanks

Regards



Feb 4 '08 #1
6 1579
On Mon, 4 Feb 2008 01:53:48 -0000, "John" <Jo**@nospam.infovis.co.uk>
wrote:
>Hi

I have a winform db app that is "bound" to a dataset...via data adpater,
binding source and all that. As this is a multi-user app I need to refill
dataset from time to time so the newest data is available for user to view.
My problem is that I

a) do not wish the app to become unresponsive while re-fill is being
performed so need to do it as background task if possible.

b) do not want the record context to change for user so user does not notice
any disruption.

My question is, are the above possible? If so, how? If not what is an
alternate strategy?
No matter how you refill the dataset, while it is refilling the user
will see effects in the bound controls.

It might be better if you have two datasets. Bind one to the
controls, then refill the other. When it is refilled switch the
binding.

I have no experience with trying to fill a dataset asynchronously and
don't know if it is possible.
Feb 4 '08 #2
This must be a very common scenarios.What do other people do to achieve
this?

Thanks

Regards

"Jack Jackson" <jj******@cinnovations.netwrote in message
news:ue********************************@4ax.com...
On Mon, 4 Feb 2008 01:53:48 -0000, "John" <Jo**@nospam.infovis.co.uk>
wrote:
>>Hi

I have a winform db app that is "bound" to a dataset...via data adpater,
binding source and all that. As this is a multi-user app I need to refill
dataset from time to time so the newest data is available for user to
view.
My problem is that I

a) do not wish the app to become unresponsive while re-fill is being
performed so need to do it as background task if possible.

b) do not want the record context to change for user so user does not
notice
any disruption.

My question is, are the above possible? If so, how? If not what is an
alternate strategy?

No matter how you refill the dataset, while it is refilling the user
will see effects in the bound controls.

It might be better if you have two datasets. Bind one to the
controls, then refill the other. When it is refilled switch the
binding.

I have no experience with trying to fill a dataset asynchronously and
don't know if it is possible.

Feb 4 '08 #3
I rarely have a large number of records in a datatable, so refreshing
doesn't take a noticeable amount of time.

On Mon, 4 Feb 2008 14:44:30 -0000, "John" <Jo**@nospam.infovis.co.uk>
wrote:
>This must be a very common scenarios.What do other people do to achieve
this?

Thanks

Regards

"Jack Jackson" <jj******@cinnovations.netwrote in message
news:ue********************************@4ax.com.. .
>On Mon, 4 Feb 2008 01:53:48 -0000, "John" <Jo**@nospam.infovis.co.uk>
wrote:
>>>Hi

I have a winform db app that is "bound" to a dataset...via data adpater,
binding source and all that. As this is a multi-user app I need to refill
dataset from time to time so the newest data is available for user to
view.
My problem is that I

a) do not wish the app to become unresponsive while re-fill is being
performed so need to do it as background task if possible.

b) do not want the record context to change for user so user does not
notice
any disruption.

My question is, are the above possible? If so, how? If not what is an
alternate strategy?

No matter how you refill the dataset, while it is refilling the user
will see effects in the bound controls.

It might be better if you have two datasets. Bind one to the
controls, then refill the other. When it is refilled switch the
binding.

I have no experience with trying to fill a dataset asynchronously and
don't know if it is possible.
Feb 4 '08 #4
Hi Andrej

Thanks. Would it have any effect on user experience in that user's editing
at the time of dataset population will be lost for example?

Any idea if I can populate dataset as a background task without problem?

Thank again.

Regards
"Andrej Tozon" <an**********@gmail.comwrote in message
news:f8**********************************@f10g2000 hsf.googlegroups.com...
Hi John,

try calling your BindingSource's SuspendBinding() method before re-
populating dataset, and ResumeBinding() after it's done.

Andrej

Feb 6 '08 #5
Just one question; if the user is in the middle of an edit is that
information not lost when UISet has been updated from
the BGSet?
Basically what we do is throw away the BGSet whenever the user is in the
middle of editing.

So I'll have some code that detects when an edit is started and finished and
update some global bool that will let the UI thread delegate know not to do
anything with the BGSet when an edit is in progress. The UISet will only be
updated when an edit is not in progress.

Also in the case where the process of rebinding the UISet to controls may a
short time you may conversely want to prevent editing while the delegate
method is actually rebinding the UISet.

Another way to handle this if you can't afford to ignore new BGSets is to
push new BGSets onto a stack when the delegate method is called and an edit
is in progress. Once any edit is finished you can check the stack for
entries and pop the last BGSet and rebind when one exists.

HTH
--
Gregg Walker
Feb 7 '08 #6
Thanks. Makes perfect sense.

Regards
"Gregg Walker" <xy***@newsgroup.nospamwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>Just one question; if the user is in the middle of an edit is that
information not lost when UISet has been updated from
the BGSet?

Basically what we do is throw away the BGSet whenever the user is in the
middle of editing.

So I'll have some code that detects when an edit is started and finished
and update some global bool that will let the UI thread delegate know not
to do anything with the BGSet when an edit is in progress. The UISet will
only be updated when an edit is not in progress.

Also in the case where the process of rebinding the UISet to controls may
a short time you may conversely want to prevent editing while the delegate
method is actually rebinding the UISet.

Another way to handle this if you can't afford to ignore new BGSets is to
push new BGSets onto a stack when the delegate method is called and an
edit is in progress. Once any edit is finished you can check the stack
for entries and pop the last BGSet and rebind when one exists.

HTH
--
Gregg Walker

Feb 7 '08 #7

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

Similar topics

1
by: ofer | last post by:
Hi, I am working with the beta version of the new .net framework (Whidbey) and I encountered a problem with serialization that did'nt exist in the .net 2003 the situation is like this : I have...
0
by: Frosty | last post by:
Hi I am using the VS xsd designer to create a strongly typed dataset. The dataset is apparently successfully created, with no warnings or errors given. Is it not then to be expected that this...
1
by: Patrik | last post by:
Hi I want to return a dataset from a webservice and exclude the schema. How can I do this? /Patrik
2
by: ofer | last post by:
Hi, I am working with the beta version of the new .net framework (Whidbey) and I encountered a problem with serialization that did'nt exist in the .net 2003 the situation is like this : I have...
14
by: Bihn | last post by:
I was reading about datareader which is said to be slimmer & faster then dataset. Since the datareader have to go fetching the dat from the database every time it need it, the data it gets then...
7
by: Dan Sikorsky | last post by:
How do you iterate thru a dataset to change money fields to a different value? Here's what I have. My dataset is filled directly from a stored procedure. ' Create Instance of Connection and...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
15
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 ...
4
by: =?Utf-8?B?V2lsc29uIEMuSy4gTmc=?= | last post by:
Hi Experts, I am doing a prototype of providing data access (read, write & search) through Web Service. We observed that the data storing in SQL Server 2005, the memory size is always within...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.