.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

asp.net c# DELEGATE THREAD: Multi threading

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net


In my asp.net web application i have lengthy excution process like word merge. I want to merge the word documents and send to client in a procedure. Basically i am looking for run and forget kind of asynchronous process.

In my for loop i tried to create delegate and rstrat. like this

filenames is a string array, creating in the same loop and assiging values before calling delegate.


MailSender mail = new MailSender();



TestDelegate testdele = new

View Complete Post

More Related Resource Links

Multi-threading in .NET: Introduction and suggestions

This article uses the C# type shorthands throughout - int for Int32 etc. I hope this makes it easier for C# developers to read, and won't impede any other developers too much. It also only talks about the C# ways of declaring variables to be volatile and locking monitors. Developers using other languages can find the equivalents in their own preferred environment, I'm sure.

Can I multi-thread this?

I have the following scenario which works fine, however I wonder if I can improve the user experience further.I have an asp button which is wrapped in a <a> link.  It acts as a link button but it actually works when you turn javascript off.  The html is like this - <a><input></input></a>.  When a user clicks the button, an event is raised and a new wwindow is opened which does something else.The button event does a number of things itself,update page control (multiple)update sql table (multiple)update an update panel on the pageIn the above scenario the user has to wait to the end to see a page update. I could however, do this,update page control (multiple)update an update panel on the pageupdate sql table (multiple)In this scenario the page is updated, but might seem dead whilst the table updates are performed.  This could lead to users banging buttons etc.So the question is, when the update panel has been called, is there anything I ca do to submit the general table updates to batch whilst the user gets on with their activities?Thanks in advance.

Multi Threading



I have a DLL in which there are classes and classes have numerous methods.

I want to create 10 different instances of the DLL and pass a same variable to each of the instances. Every instance will loop through the same classes and same methods.

I want to use multi-threading for this purpose such that I can parallelly/simultaneously using all the 10 instances.


How do I go about it.


Detailed Explanation


I have 10 databases which store data about the Project Plans. my aim is to generate an XML file containg info about the plans. There is a variable that passes the name of the database to the DLL.

Now I want to use multi-threading such that I can generate files from all the databases simultaneously/parallely.

Note: I want to use the same variable to pass the name of the database to every instance.

 All the instances will use the same classes and methods for this purpose.


Thnx in advance.

Dynamic controls added at runtime, threading, The calling thread cannot access this object because a




My problem is on load I initialise a new thread. This thread create a new control then tries to add the control to a stackapnel and the error I receive is -

The calling thread cannot access this object because a different thread owns it.

Heres is my code e-




t = new

What is the advantage of Parallel Processing(Programming) aganist Multi threading

we are already getting parallel processing from w2k8 and the underlying intel processors evidenced by running an application on a single purpose machine and it showing all cores having equal usage Then why do we go for Parallel Programming in vs 2010?

Threading - how can thread update a variable shared with the Main thread


I'm new to threading and have used it successfully, but limited.  I can spawn a thread and have the main thread reference variables in the spawned thread, but I don't know how to allow the spawned thread to reference (and update) variables in the main thread.

Any example threading code I've seen on the web appears to be WAY more complicated than what I do, so I am unable to understand or integrate into my code.

Here is a quick example of how I use threading:


public partial class ThreadVariableSharing : System.Web.UI.Page


.Net Remoting multi threading issue



I have a Windows service running on the server. It allows client workstations access it via .Net remoting. The Server service is simply a gateway to the database. Clients call methods on the Server class via remoting to make database calls (Selects, Inserts etc.).

During load testing we've observed the calls to the server take longer when multiple clients make simultaneous requests. The analysis indicates the requests are actually getting queued up. If 2 clients call the same method on the Server object, the two requests are processed in sequence. We have tried both Singleton and Singlecall. Same results.

Is there a bug in .Net remoting that it cannot process simultaneous client requests? If yes, is there a workaround (a quick one)?

We are using .Net 2.0 and are willing to switch to a higher version if the bug has been resolved in 3.0 or 4.0.



System.Threading.ThreadAbortException: Thread was being aborted


In my ASP.Net web application, one of the function is calling the WCF service that has been developed by .Net framework 3.0 using VS2005.It works fine on production and user can make request 8 times(calls) between client and service after that the web application got hanged and generated the following error message. But it works fine on development even more than 8 requests.

I given the proxy time out 20 min in the client side proxy setting.

Error message:

Is SQL Compact Edition save to use in ASP.NET Web Apps - Multi-Threading?


I have a question:


Is SQL Compact Edition safe to use in ASP.NET WebApps?


And second if so, should i use transation isolation level or row locking hints to assure data quality during iniserts?


E.g. i want to assure that there is only one record named user2@domain2 and thus i want to make sure that my code

will not fail in a mutli-theaded scenario and insert second one or get a key exception back: see sample 


transaction or locking hit{

  select from users ....

  if no user found

  insert into users





Hello World to C# Threading Part 1

In this post we will see how we can implement simple threading. Why do we need threading? When you want you application to do more then one thing at same time, then you need to implement threading. One usual and common scenario would be when your application needs to get data from some other resource like web services and you don't want you application GUI to be freeze during this time. In that sort of case you will run the code to access web services in separate thread so your application GUI won't freeze. The System.Threading namespace .NET provide interfaces to implement multi threading.

Threading in C#

What is Threading?
-Parallel execution of code pieces on CPU, commonly compiled codes started in a single thread but it is possible to create multi-threads within a program.


Multi-core processors are new standards on the user's hardware. By taking advantage of the multi-processing capabilities of these machines you can achieve significant performance upgrade with some minor changes in your code. When an application does not make use of threading techniques it is wasting valuable resources. This tutorial will cover the basic threading concepts and threading methods and properties.

Multi File Upload Using JQuery!

Everyone knows about the file upload in .NET. But the multi file upload is some what difficult in .NET. For that purpose we can have some AJAX or JQuery!. Jquery is the latest advanced version. It will give some animated upload. You can try it for your own!!!!

Multiple Paramatized Threading issue


I need the funcitonality to have two methods run concurrently of each other and the parent thread (aka the method that makes these two calls) to halt until BOTH are done. After the threads are done, I need to perform logic on the returns of the method, so it is essential for both of them to be complete before the parent thread continues. I have searched the internet and tried varous attacks, and I always come up with the same result, this being the parent thread continues operation after the first thread finishes, leaving the second thread running.  Can someone show me a quick example of how I can do this. I have tried checking states of the threads, halting the threads, but I always end up with the same thing. Any help would be great. Thanks.

Change Button Text in Multi Language Website


Hi i developing multi language website

using Master pages

everything fine

Page_Load i set the Text property of Button Control from Resource file

like this

Button1.Text = GetLocalResourceObject("Button1")

then in the button click event i cnage the text of the Button control

Button1.Text = GetLocalResourceObject("Button1_new")

but the text doesn't change and no error messgae

what is the problem how to solve this


For Multi-Language website which process is better in asp.net


 I want to build multi-language website in asp.net 2008 and asp.net 2010. So, which process is better for building application? Using either Local and Global Resource or New Folder to make separate according to language?


Application performance should be good and also easy manageable.


Please suggest me in which way I will build the application either using resource or folder. If there is any other better solution then please share.

UI Frontiers: Multi-Touch Manipulation Events in WPF


Multi-touch has progressed from being a futuristic prop of sci-fi films to a mainstream means of user interface. We'll show you how support for multi-touch in Windows 7 has filtered down and settled into various areas of the .NET Framework.

Charles Petzold

MSDN Magazine August 2010

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend