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

Post New Web Links

Pick Activity doesn't cancel other branches when first Branch Trigger completes

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :Windows Application

I have a Pick Activity with 2 branches:

Branch 1 contains a Trigger an Delay activity with TimeSpan of 1 minute and a WriteLine before and after so I can check the executing times.

Branch 2 contains a Trigger with an InvokeMethod activity which performs some action, that when it takes longer than 1 minute should be cancelled. Also this Trigger has 2 Writelines to check the executing times. The InvokeMethod has the flag RunAsynchronously set to true.

Both branches Action activities contain another WriteLine.

When I run the Workflow, I see the following:

12:24:47 Branch 1 started
12:24:47 Branch 2 started
12:25:47 Branch 1 ended
12:26:46 Exception on my client The request channel timed out while waiting (sendTimeout="

View Complete Post

More Related Resource Links

How to Cancel a Workflow Activity - LogToHistoryListActivity


How can I cancel a LogToHistoryListActivity? I don't understand how to get access to the ActivityExecutionContext. I guess one way is to add an IfElse before entry to avoid the activity completely. Casting the sender object does not work. Help anyone?

  private void logToHistoryListActivity_WorkflowActivated_MethodInvoking(object sender, EventArgs e)
   LogToHistoryListActivity log = (LogToHistoryListActivity)sender;
   string msg = string.Format("Work Request has been SAVED by {0}. Awaiting submittal.", workflowProperties.Originator);
   WFHelper.LogMessageToHistoryList(log, msg, null);

Activity to handle SQL Trigger firing

Hello, Does anyone have a recommended best practice for how a workflow should "watch for" the event of a SQL (2005) trigger's firing -- rather like the FileWatcher sample?  Or better, perhaps a code sample? Thanks in advance for your thoughts. John

SqlCommand.Cancel() method doesn't do what its supposed to do

Hi guys!

I have some issues with cancelling the execution of a long-during sql-query.
Please take a look at the winforms-code below.

When I open up the SQL-Profiler, the execution of the query isn't cancelled by calling Cancel() on the command-object.
Does anyone have an idea, why not? Is it a feature which I have to enable on the sql-server?

Regards, Florian
  public partial class Form1 : Form
    string _commandText;
    SqlConnection _connection;
    IAsyncResult _result;
    SqlCommand _command;

    public Form1()

    private void Form1_Load(object sender, EventArgs e)
      _commandText = "select * from HugeTable";

    private void InitializeOpenedConnection()
      if (_connection == null || _connection.State == ConnectionState.Closed)
        _connection = new SqlConnection(GetConnectionString());
      if (_connection.State != ConnectionState.Open)

    private void btnStart_Click(object sender, EventArgs e)
      _command = new SqlCommand(_commandText, _connection);

      _result = _command.BeginExecuteReader();
      _command.StatementCompleted += new StatementCompletedEventHandler(_command_StatementCompleted);

Need quick "Pick Activity" Explanation if someone has time :)


I have a workflow I want to call with Invoker...now depending on where it's called I want it to run one of two sequence activities to the end then complete the flow

Is pick not the right Activity to accomplish this?  I'm getting caught up on what the "Trigger" would be.  I could also do it in a flowchart with a Switch...is that the PROPER place to do it?



"Send Email" activity doesn't send email to Google App mail only!



Suddenly i faced this issue this morning, SPD workflow can send email to all the domains except my Google App Mail domain.

It can send to gmail, yahoo, hotmail but it doesn't succeed my google app email!

i didn't change anything in google app mail setting or the local SMPT setting.


this is my IIS SMPT configuration

Fully qualified domain name:  mail.***

Smart host: smtp.gmail.com

TCP Port: 587

While Loop Activity Doesn't Work in SharePoint Workflow


Hi ,

i use the following method in While activity


private void WhileCondition(object sender, ConditionalEventArgs e)
      e.Result = !isFinished;

and while debugging the workflow e.Result is equal True !!!!

i don't know why the workflow exit the while loop and make the status of the workflow Completed ?

please advise 


Best Regards


Transactions in services with request reply pattern in a pick branch


How can I enclose activities in a transaction within a body of a pick-branch (i.e. Action of PickBranch activity), where the Trigger of pick-branch receives a message via Receive activity and the Action of pick-branch sends reply via SendReply activity? Transaction scope must be placed within the Action of PickBranch, right before SendReply.

I cannot use TransactionScope between Receive and SendReply (see here for explanation: http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/96c048bf-06d4-44ac-a60c-e2e77f7a7060 )

On the other hand, TransactedReceiveScope activity does not seem to fit to the pick-branch pattern.

Thanks for help,
Greg Jasinski

ASP.Net Gridview Edit Update Cancel Commands

In ASP.Net 2.0, GridView Control also provides the functionality to edit and update the data retrieved from the database using CommandField template. You can cancel the action using Cancel Command of the CommandField. GridView consists of events that can be used to perform the actions like edit, update and cancel upon the Data items displayed in the ASP.Net GridView Data Control.

Beginner: this doesn't make sense to me


Do you need and "empty" script tag in the head to run scripts that are in the body?  Also, can you run JQuery scripts if they're in the <head> tag?  The first sample only works if the JQuery script is in the form (and body) tag, not in the head - even if I add $(document).ready(function() { });

This works

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
<script type="text/javascript">
<form id="form1" runat="server">
<a href="">Here is a link</a>
<script type="text/javascript">
$('a').click(function () {
alert("you clicked me!");


This doesn't work.  Notice I removed the second <script> tag from the head

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="serve

replacing ok and cancel button of an alert message with YES an NO button in asp.net web application.


i want to replace ok and cancel button of an alert message with YES an NO button in asp.net web application.When a user will click yes the data will be saved in the database and if user clicks that will act as a reset button and do not save the data in database and the control will move with as usual to the redirect page.Any pointers will be highly appreciated.I am usin g C# language.

Using a trigger or anything else to populate two tables


Hi! I'm creating an application that's supposed to first add a record to table1, and then get the ID from that record to use when adding a record to table2, to be able to associate these two records with eachother.

The user gets to type in some values that goes to table1, and some values that goes to table2, but before the insert statement for table2 is executed i need the ID from the recently added record in table1. Some dude told me to use a trigger for the autopopulate purpose, but does that really work when i also need to save some values that's user input, and when those values doesn't get saved in table1?

Are there any other way to do this or can i send values to a trigger? I'm new to triggers and stored procedures, i don't have any particular knowledge of this, any help is appreciated!


Regards, Monsterbadboll

how to get id value from the row inserted in a table with thr trigger.


I have a reports table with column report id and and report version. I created a trigger on this table to execute an application to do some processing each time a row is inserted in reports table. I need to pass the new report id execute this application from the trigger. How do I get the report id from the row that was inserted?


C++ at Work: Addin a Combobox Cancel Feature


This month Paul DiLascia codes some Microsoft Office-style dialog box features.

Paul DiLascia

MSDN Magazine August 2006

{ End Bracket }: Legal Doesn't Think the Way You Do


If you develop software for a large company, you've undoubtedly experienced the joys of dealing with "Legal. " The meetings, the endless explanations, the long waits. I'm here to report from the other side.

Don McGowan

MSDN Magazine March 2006

Advanced Basics: Building a Progress Bar that Doesn't Progress


In many situations, accurately estimating the length of a certain process (copying a large file, loading data from a server, retrieving files from the Internet) would be both difficult and inefficient.

Duncan Mackenzie

MSDN Magazine October 2004

A Simple XML-driven Tool: Monitor Your Web Site's Activity with COM and Active Scripting


This article describes a simple Web site monitoring tool built with XML, JScript, Windows Script Host, and COM objects. Although it is not intended to replace complete Web site monitoring software products, it has many useful features that help to keep Web servers up and running. An XML configuration file specifies which Web sites to monitor and the actions to be taken if the site isn't functioning properly. In addition, the tool can be scheduled to run at any specified interval using the Windows Task Scheduler. Functions that probe the sites, log events, and send e-mail notifications are written in JScript.

Panos Kougiouris

MSDN Magazine July 2000

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