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

Notifying the user of the current action

Hi!

I have a db-query which takes too long to complete. In this process, it
will not be bad notifying the user that something is being done so as
to exercise some patience. How can I realise this? With the help of
thread, but how?

Thanks in advance...
Stropher

Nov 17 '05 #1
1 1057
Hi,
btw msdn samples and even if you write "thread class" on index can guide you
to the use of threads. Its really very simple (although synchroniztion can
be from simple to very hard based on the kind of work u r doing). But the
notification may not be there in the code. So I'm writing a little code for
you here that may help you out trying to do your work:

we start a thread like this:

Thread thread = new Thread ( new ThreadStart ( this.threadproc));
thread.Start ();

The thread proc is defined as:
void threadproc()
{
// add thread execution logic here, maybe your query execution code or
whatever.

/* NOTIFICATION PART: This is important. Assuming that you r writing this
code inside a windows form class.
Than "this" would refer to windows form itself. I'm going to make an
"asynchronous" call to a method of the form class so that it knows that the
thread is finished execution and the rest of the logic based on the thread's
results can be started.
*/

this.BeginInvoke(new dlgcallwhendone (this.callwhendone) );
}

here I'v declared the delegate "dlgcallwhendone" with callwhendone()
signatures which is our custom method here.

delegate void dlgcallwhendone();

void callwhendone()
{
MessageBox.Show ( "Thread is done executing.");
}

Well I hope this helps.

Ab.
http:://joehacker.blogspot.com

"Stropher" <hm***@gmx.net> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hi!

I have a db-query which takes too long to complete. In this process, it
will not be bad notifying the user that something is being done so as
to exercise some patience. How can I realise this? With the help of
thread, but how?

Thanks in advance...
Stropher

Nov 17 '05 #2

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

Similar topics

15
by: Deano | last post by:
I've posted about this subject before but haven't really got anywhere yet. I have now come up with a plan of action that takes into account my strong desire to implement save/discard functionality...
1
by: David P. Donahue | last post by:
What is the best way (or what ways have been successful for you) to notify a user on a website that their session has timed out? I've seen various sites around the internet (my bank, for example)...
3
by: idletask | last post by:
I have an application that has many windows. One window is used for order processing. I would like this window to display the other users who are also performing order processing (the idea is to...
26
by: beporter | last post by:
First time poster here! Let me get straight to it... I'm currently not in a position that lets me interact with other developers face to face on a regular basis, and I am in need of some "round...
2
by: underground | last post by:
Hi, everyone I've been trying to figure out a way for a user to update there information. I'm using sections to identify the specific user..Here is the form <? include("include/session.php");...
1
by: =?Utf-8?B?Q3JhaWc=?= | last post by:
What's the best design/pattern to use for a windows app that has different types of users, and where different things happen according to what type of user you are. For example: If you're User A...
9
by: phopman | last post by:
Hello! I am currently working on a project. And have been assigned to get up to speed quickly on php. And even though I love the language, it's not easy to get up to speed in like 2 seconds :-) ...
2
MattFitzgerald
by: MattFitzgerald | last post by:
Hi hope some one can help I have 2 questions:- Question 1) When saving a file in access to excel how do I specify current date Question2) When saving a file in access to excel how do I specify...
0
by: Steven Cheng [MSFT] | last post by:
Hi Nick, From the description in your first message, I think what you want to do the let the webservice server-side proactively notify the webservice client for some changing, correct? I'm...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
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,...

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.