Click here to Skip to main content
15,904,638 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am working on multiple project under one solution.
One project(USERFORM) containing the forms and other project(Operation) is having all the classes. In classes, using while loop for inserting values into database one by one. After inserting each record in Database it shows the message to the Forms which in other project(USERFORM).
In short I have to sent back the message from Operation Project to USERFORM project in between while loop.

Please help me how to do this.





Regards

Vikas
Posted

It's simple: Create an event in your class which you signal in your loop, and that the form can subscribe to. MSDN[^] has full instructions on how to do this.
 
Share this answer
 
You need to throttle one thread by another one to feed some "tasks" to it using a blocking queue.
Please see my Tips/Tricks article here: Simple Blocking Queue for Thread Communication and Inter-thread Invocation[^]. It's complete with full source code and usage example.

—SA
 
Share this answer
 
Comments
Freelancers 6-Sep-11 8:50am    
Is there any other way????

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900