.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

How to execute a set of steps N time, in parallel?

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :Windows Application
I have a custom workflow activity that creates "tasks" for users to do.  Tasks are shown to a specified user when they log in to the web site.  When this step runs, it takes in a userId, creates a task in the database for that user, and then sets a bookmark.   When the user goes to the web site, they see their tasks.  When they push a button to complete a task, the bookmark is resumed and the step ends.   So far so good.  The problem is that the design now calls for the workflow to be able to kick off multiple tasks for multiple users, and that all the tasks be started at once (that is, its not good enough for user #1 to receive a task, complete it, user #2 receive a task, complete it, etc.  All the users should receive their task to start with, and then they can finish them in any order.)   I can't do this serial with a for loop, since then there'd only be one task "outstanding" at a time, and they'd have to be completed in order.  I can't simply modify the custom activity to take in the multiple pieces of data, because there's a lot of other items that happen in the workflow that need to be done before and after the custom activity for each task.  What I'd really like is something like the Parallel activity, where I create the branch and place all the tasks, but then I can assign the number of times

View Complete Post

More Related Resource Links

UI on the Fly: Use the .NET Framework to Generate and Execute Custom Controls at Run Time


Creating UI controls on the fly can be accomplished via run-time code generation. And there are lots of reasons to do so. Generating these controls once and then reusing them as needed is more efficient than generating the controls each time. Read on.

Morgan Skinner

MSDN Magazine December 2005

Automatically Execute Code at certain time from website


Is there a way to trigger a piece of code to execute at a certain time once a week?

I basically want my website to send out a reminder email every sunday. I have a function called SendReminder() and I would like to know if it is posible for it to run by itself because at the minute I have to press a button to run it.


Execute a function for specific time (not at specific time)


I have a function that does large amount of processing.

I just want that if it executes in specific time (say 10 min) then it should return "execution successful".

But if now then i want to stop the execution of that function and return "unsuccessful" and rollback my transactions.

Returning and rollback is fine.

But i dont know how to stop the execution of a function at specific time.

I am using asp.net with C#.

Any ideas would be really appreciated.


SQL Server 2008 query execution time is different if i execute it in management studio or from code

When I execute query from software which i wrote in c# it required lots of time to complete but if I execute exactly the same query from management studio it will be done in seconds. In both cases execution plan is the same. 

how to execute all the dataset in SSRS report in parallel.


hi All,

I have created report in SSRS R2 ,in which ihave used 7 dataset.

Individually each dataset took 10 sec to execute and hence when i ran the report ,report took 70 sec to execute,it gives a sense that each dataset execute in sequence ,though i want to execute the all the dataset in parallel so that it took only 10 sec to execute the report.


kindly Suggest


Can I write multiple queries in Execute SQL Task Editor at a time


Can I write multiple queries in Execute SQL Task Editor at a time???


Can I write these two queries???

ALTER Table [Islamabad_campus]. [dbo]. [BS_Students] ADD Location   VARCHAR ( 10);

UPDATE [Islamabad_campus]. [dbo]. [BS_Students]

SET Location = 'Islamabad' ;


Round off time to the nearest minute

How would you round this up to the nearest minute? There isn't a built in function to do this so you have to use a little bit of maths to get there. There are 60 seconds in a minute. We already have 38 seconds on the clock. So we need to add on 60 - 38 = 22 more seconds.

A better way to reference your wizard steps using named steps

Note: this article uses the plain vanilla but the concepts apply equally well to its popular counterpart .

By far the most common way that I see wizard steps reference in code snippets is by their index.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.

Date and Time Functions in SQLSERVER

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

1 DATEPART Function
2 DATENAME Function
3 DAY, MONTH, and YEAR Functions
5 DATEADD Functions
6 DATEDIFF Function
7 More SQL Server Functions

Data Types - Date and Time in SqlServer

Date and time values can be stored with either the DATETIME or SMALLDATETIME data type. The difference between the two is that SMALLDATETIME supports a smaller range of dates and does not give the same level of precision when accounting for time. The DATETIME data type can hold values from January 1st of 1753 to December 31st of 9999. The time is stored to the 1 three hundredths of a second and each value takes up 8 bytes of storage. The SMALLDATETIME data type can hold values between January 1st 1900 and June 6th of 2079. The time is tracked to the minute and each value takes up 4 bytes of storage. The majority of business applications can live happily with SMALLDATETIME, however, if you are in an environment where each second matters or you need to make estimates to the distant future (or past) then you have to resort to DATETIME. If you fail to specify the time when inserting a value into a DATETIME or SMALLDATETIME column, a default of midnight is used. If you fail to specify the date portion the default of January 1, 1900 is used.

HttpContext.Items and Server.Transfer/Execute

The problem was basically that when a Server.Transfer call was applied the script container (and also various ClientScriptProxy script embedding routines) would potentially fail to load up the specified scripts.

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:

.NET 4 Web Application Startup Time

I was chatting with Jonathan Hawkins and some of the folks on the ASP.NET team about performance and Jonathan mentioned the startup time for large ASP.NET applications is improved on .NET 4. There are some improvements in the CLR and in ASP.NET itself that helped. If you have a giant app, you should do some tests.

Built-in Functions - Date and Time Functions

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

Essential SQL Server Date, Time and DateTime Functions

The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any formatting considerations at all.

Date/Time Conversions Using SQL Server

There are many instances when dates and times don't show up at your doorstep in the format you'd like it to be, nor does the output of a query fit the needs of the people viewing it. One option is to format the data in the application itself. Another option is to use the built-in functions SQL Server provides to format the date string for you.
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