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

Interrupting a data load

I have made an application that loads data through an
OleDbDatareader. I would like the user to be able to
interupt the load.

Now, I could of course include an interrupt button in the
form. However, once the load starts program excution will
be in the object of my dataload class. And so I suspect
that the users interaction with an interrupt button
(which could set a flag in the load object) will not be
handled.

Instead of a lot of experimenting, I thought that I would
ask for some hints, from those who might already know how
to do this.
Regards,

Frank
Nov 20 '05 #1
6 1214
Hi Frank,

Sorry, I'm busy on another query and then off to bed, so ...

The quick answer (ie. not telling you exactly how) is to spin off a Thread
to do the load. If the User hits that [Interrupt] button, then abort the
Thread.

You'll have to have a Try .. Catch ex As ThreadAbortException so that your
app doesn't fall over.

Regards,
Fergus
Nov 20 '05 #2
* "Frank" <an*******@discussions.microsoft.com> scripsit:
I have made an application that loads data through an
OleDbDatareader. I would like the user to be able to
interupt the load.

Now, I could of course include an interrupt button in the
form. However, once the load starts program excution will
be in the object of my dataload class. And so I suspect
that the users interaction with an interrupt button
(which could set a flag in the load object) will not be
handled.

Instead of a lot of experimenting, I thought that I would
ask for some hints, from those who might already know how
to do this.


I think you got very good answers in your previous thread.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Hi Fergus,

Thanks, I'll work out how. Just needed to know, if
threading was neccesary or there was another way. I'll
read up on handling threads and then get to it.

Regards,

Frank

-----Original Message-----
Hi Frank,

Sorry, I'm busy on another query and then off to bed, so ...
The quick answer (ie. not telling you exactly how) is to spin off a Threadto do the load. If the User hits that [Interrupt] button, then abort theThread.

You'll have to have a Try .. Catch ex As ThreadAbortException so that yourapp doesn't fall over.

Regards,
Fergus
.

Nov 20 '05 #4
* "Frank" <an*******@discussions.microsoft.com> scripsit:
threading was neccesary or there was another way. I'll
read up on handling threads and then get to it.


Notice that msdn contains a big chapter about threading of you want to
know the background information:

Threading (.NET Framework Developer's Guide)
<http://msdn.microsoft.com/library/en-us/cpguide/html/cpconthreading.asp>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
Thanks, this looks good!

Frank
-----Original Message-----
* "Frank" <an*******@discussions.microsoft.com> scripsit:
threading was neccesary or there was another way. I'll
read up on handling threads and then get to it.
Notice that msdn contains a big chapter about threading

of you want toknow the background information:

Threading (.NET Framework Developer's Guide)
<http://msdn.microsoft.com/library/en- us/cpguide/html/cpconthreading.asp>
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #6
In general I don't like the idea of Aborting a thread too much - it would be
much better to stick a flag in the thread main loop to terminate cleanly.

"Frank" <an*******@discussions.microsoft.com> wrote in message
news:08****************************@phx.gbl...
I have made an application that loads data through an
OleDbDatareader. I would like the user to be able to
interupt the load.

Now, I could of course include an interrupt button in the
form. However, once the load starts program excution will
be in the object of my dataload class. And so I suspect
that the users interaction with an interrupt button
(which could set a flag in the load object) will not be
handled.

Instead of a lot of experimenting, I thought that I would
ask for some hints, from those who might already know how
to do this.
Regards,

Frank

Nov 20 '05 #7

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

Similar topics

0
by: Donald Tyler | last post by:
Then the only way you can do it that I can think of is to write a PHP script to do basically what PHPMyAdmin is trying to do but without the LOCAL in there. However to do that you would need to...
1
by: Ray in HK | last post by:
What are the differences between LOAD DATA INFILE and LOAD DATA LOCAL INFILE ? I found some web hosting company do not allow using LOAD DATA INFILE but allow LOAD DATA LOCAL INFILE. The reason...
1
by: Uthuras | last post by:
Greetings, Machine : Pentium IV Os Windows 2000 server Product : DB2 UDB Release : 7.2 We are fail to load the following data file format into db2 database table that has long varchar...
5
by: kaburke | last post by:
My application is a simple create/update/delete system, with user authentication. Everything is working well, except session timeouts are creating user-experience nightmares. The standard...
1
by: Angus Lepper | last post by:
I'm writing a stock ticker for a stock market simulation, and can load the data into the xmlreader in the first place, but can't figure out how to refresh/update the data in it. Any ideas? Code:...
3
by: Tim | last post by:
Can you show me how to debug a whole vb program without stopping at the end of the first form? I have many vb forms, i.e., 5 forms, that after the first form have done its job, the next form will...
8
by: andreas | last post by:
When I do a long calculation is there a possibility to interrupt this calculation properly? For i as integer = 1 to 100000000 do something next and retrieve the i at the moment of the...
13
by: michael sorens | last post by:
I have a lengthy sequence of operations that are executed and reported on in a status window in a Windows Form application. Some work is done by background threads but other work is not. I am...
3
by: Florian Demmer | last post by:
Hi! I have a number of ftp uploads running in parallel using ftplib.storbinary and threading and in case one of them fails I need to interrupt all the others (but not exit the program...
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?
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
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
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.