473,660 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1221
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 ThreadAbortExce ption so that your
app doesn't fall over.

Regards,
Fergus
Nov 20 '05 #2
* "Frank" <an*******@disc ussions.microso ft.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 ThreadAbortExce ption so that yourapp doesn't fall over.

Regards,
Fergus
.

Nov 20 '05 #4
* "Frank" <an*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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
6680
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 be able to place the PHP file on the server, and I guess you probably can't do that either. Talk about catch 22... The only other way I can think of is to install MySQL on a machine you control, then import the data there using the method I...
1
16065
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 is for the sake of security. What does that mean ?
1
5885
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 data type. The load command with 'delprioritychar' option does not seem to help much on the loading process.
5
1077
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 workflow of my application is as follows: Login -> View Items -> Edit Item -> Save Item The following should be noted about each step: 1) Login
1
2304
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: Public Class Form1 Inherits System.Windows.Forms.Form
3
1260
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 be showed up. But after I debug the first form, it will be closed without going to next form. I would like to keep track of the flow of the whole program. Thank you for your help.
8
1220
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 interrupting Thanks for any response
13
1759
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 wondering how to recognize if the user presses an Escape (or even just a Shift key if that is simpler) so I may then abort the remaining foreground operations. To recognize a shift key I tried: if ((Control.ModifierKeys & Keys.Shift) ==...
3
3570
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 completely)... do you guys have an idea how i could implement the interruption as cleanly as possible? thanks!
0
8341
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8754
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8542
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2760
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.