473,395 Members | 1,578 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,395 software developers and data experts.

Populating data set on background thread

Hi

I have a master data set. I need to populate a copy of this data set in the
background (via background thread?) and once filled to replace master data
set with the newly filled dataset. Is there a code example of this that can
see?

Thanks

Regards
Feb 22 '08 #1
5 1910
You might check out BackgroundWorker component.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"John" <Jo**@nospam.infovis.co.ukwrote in message
news:OC**************@TK2MSFTNGP04.phx.gbl...
Hi

I have a master data set. I need to populate a copy of this data set in
the background (via background thread?) and once filled to replace master
data set with the newly filled dataset. Is there a code example of this
that can see?

Thanks

Regards
Feb 22 '08 #2
Hi Miha

Thanks. How does one switch datasets?

Thank again.

Regards

"Miha Markic" <miha at rthand comwrote in message
news:eo**************@TK2MSFTNGP04.phx.gbl...
You might check out BackgroundWorker component.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"John" <Jo**@nospam.infovis.co.ukwrote in message
news:OC**************@TK2MSFTNGP04.phx.gbl...
>Hi

I have a master data set. I need to populate a copy of this data set in
the background (via background thread?) and once filled to replace
master data set with the newly filled dataset. Is there a code example of
this that can see?

Thanks

Regards

Feb 22 '08 #3

"John" <Jo**@nospam.infovis.co.ukwrote in message
news:OF*************@TK2MSFTNGP02.phx.gbl...
Hi Miha

Thanks. How does one switch datasets?
There is no automatic way. Perhaps you could fill one in the background and
when it is full you could merge it with original (perhaps clear original one
beforehand). Just make sure that merging or whatever you do you do in form's
thread.
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Feb 22 '08 #4
If you use a BindingSource to do the binding between your controls and your
data, you can just replace the data source of the binding source and it will
take care of repainting your controls.

RobinS.
GoldMail, Inc.
--------------------------------------------------------
"Miha Markic" <miha at rthand comwrote in message
news:Ol**************@TK2MSFTNGP02.phx.gbl...
>
"John" <Jo**@nospam.infovis.co.ukwrote in message
news:OF*************@TK2MSFTNGP02.phx.gbl...
>Hi Miha

Thanks. How does one switch datasets?

There is no automatic way. Perhaps you could fill one in the background
and when it is full you could merge it with original (perhaps clear
original one beforehand). Just make sure that merging or whatever you do
you do in form's thread.
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
Feb 23 '08 #5
One more thing. This is what I'm doing, and you replace the data source in
the event that gets fired when your thread completes its retrieval of the
new data.

RobinS.
GoldMail, Inc.
----------------------------------------------
"RobinS" <ro****@imnottelling.comwrote in message
news:Go******************************@comcast.com. ..
If you use a BindingSource to do the binding between your controls and
your data, you can just replace the data source of the binding source and
it will take care of repainting your controls.

RobinS.
GoldMail, Inc.
--------------------------------------------------------
"Miha Markic" <miha at rthand comwrote in message
news:Ol**************@TK2MSFTNGP02.phx.gbl...
>>
"John" <Jo**@nospam.infovis.co.ukwrote in message
news:OF*************@TK2MSFTNGP02.phx.gbl...
>>Hi Miha

Thanks. How does one switch datasets?

There is no automatic way. Perhaps you could fill one in the background
and when it is full you could merge it with original (perhaps clear
original one beforehand). Just make sure that merging or whatever you do
you do in form's thread.
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
Feb 23 '08 #6

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

Similar topics

0
by: Gomaw Beoyr | last post by:
Hello The book "C# Black Book" chapter about Threads says that a "background thread" cannot communicate directly with a visual element, e.g. a label, and thus has to use the BeginInvoke method,...
2
by: Janus | last post by:
Hello. I need a little advice for populating the treeview control. I dont want my application to hang while populating the treeview, there is a lot of data what's the best approach? Maybe...
3
by: Neil Guyette | last post by:
Hello, Everyone, I'm trying to find information on how to populate a combo box using a SqlDataReader. I want to be able to set the value of the combo's value property different then the...
5
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a...
0
by: Eric Sabine | last post by:
OK, I'm trying to further my understanding of threading. The code below I wrote as kind of a primer to myself and maybe a template that I could use in the future. What I tried to do was pass data...
0
by: Bob Davies | last post by:
Hi I have a webservice that retrieves data from a database, this is then returned to the calling client application built in windows forms within a dataset, however upon attempting to create...
10
by: Doug Bell | last post by:
Hi, I have an application that has a "Data Access Class" and "User Interface Class". It is for receiving Purchase Order data from one system and pushing processed transactions to another...
7
by: John J. Hughes II | last post by:
I have a DataGridView with a TextBoxColumn. I setting the data source to a List<stringvalue in a static class. The list is filled from a background thread. So far all is fine and it works...
5
by: lucius | last post by:
With ASP.NET/Framework 1.1, I would like to have a class that instances on application startup, and every 60 seconds after that does some work (actually a database fetch). Then any .aspx/.asmx page...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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...
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...

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.