.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

If using PersistBeforeSend on SendReply activities and [Persist|Unload]OnIdle will I pay a double pe

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

If I'm using PersistBeforeSend on my SendReply activities and I have configured the workflow to unload immediately on idle  (UnloadOnIdle="00:00:00"), am I effectively paying a double persistence cost or is the persistence runtime smart enough to realize nothing has changed?

Clearly I want PersistBeforeSend to ensure that the action the caller just performed is committed succesfully within the scope of their call, but I'm curious to know if that's going to result in an extra hit on unload.

View Complete Post

More Related Resource Links

Unload without persist


Normally when I unload a workflow, I want to persist it, but I think I want to be able to unload one without persisting. Is it possible?

My main reason for doing this is for performance reasons. I'm currently testing about 130 running workflows. My application starts and loads all these in. They do some execution that doesn't happen to change any state, but does unload the workflow so that another runtime can pick it up later. With a method profiler, I found that this is one of my bottlenecks, I would guess due to lots of data being persisted.

I do have an idea for a bit of a hack. I could keep a list of instance guids that are "not available for persisting" and then override SaveWorkflowInstanceState in SqlWorkflowPersistenceService to ignore anything in that list. I think that would accomplish removing the workflow from the runtime, but not actually saving it. I was hoping for a slightly cleaner method though.

Persist large dataset across ASP.NET pages. No database


Can anyone give me suggestions on how to implement the following requirement?

1. A online wizard (step-by step operation) processes user requests across several ASP.NET pages.  The session data is stored in memory until the user submits the request.  Once the request is submitted, a XML file is created and the data are passed to XML.

# Case Study: The parent page has a "select" button.  Click "select" will pop up a child page.  The users can select 1000+ items from a datagrid in the child page.  Once the user clicks "confirm", the selected items in the child page will be populated to the selected item gridveiw in the parent page.  The user can keep selecting more in the child page and the selected items will be appended to the gridview in the parent page.


- What's the best way to extract strings from a text file and convert to a dataset in memory and then present it in a datagrid in UI?

- What's the best way to persist and manipulate a large dataset across pages?  Session? or ViewState? Can it be accomplished by LINQ?

The app doesn't interact with a DB.  Once the request is submitted, it will convert the in memory data to a XML file.  What technology can be used to accomplished this?&nb

Persist data in a dynamically populated ListBox in a user control


Hi All,

I am trying to persist data in a dynamically populated ListBox in a user control. Here are the details

I have a user control which contains a a listBox and button. On Page_Load of user control I am populating the ListBox control with some values. On Click of button, I am trying to fetch the values which I have selected in ListBox. Though this seems very simple and straight forward I am unable to fetch values.

My Page_Load Function

void Page_Load(object sender, EventArgs e)










My Click Function

Protected Void Button1_Click(object sender, EventArgs e)


       string strValue = listBox.SelectedValue



I have placed brake point at Page_Load and on click function, I am seeing that the moment the breakpoin

How do I persist custom complex types in design-time


Let's say that I've got one custom webcontrol called MyControl.

public partial class MyControl: WebControl {
public IComplex Complex { get; set; }

The control is a very simple control but it holds an instance of a complex type that is accessable through a property. The property has the propertytype IComplex

public interface IComplex {
string Name { get; set; }
List<IComplex> Children {get;}

Let's say that I am able to pick one of several different types of object that derives from IComplex in design-time and assign it to the controls property "Complex" property.

Naturally I would like to persist this information to the HTML-View in a user-friendly way.

Because we don't know what type the user has picked there is no way to instansiate the type if we don't persist the name of that type. The Type could also contain more properties than the Interface the controls property is refering.

<cc1:MyControl id="MyControl1" runat="server">
<Complex> <!-

Foundations: Unit Testing Workflows And Activities


Matt Milner takes a look at some of the challenges and techniques related to testing Windows Workflow Foundation activities, workflows, and associated components.

Matt Milner

MSDN Magazine November 2008

Windows Workflow: Build Custom Activities To Extend The Reach Of Your Workflows


This article covers the core components required for building custom activities in Windows Workflow Foundation.

Matt Milner

MSDN Magazine December 2006

Cutting Edge: A Tour of Windows Workflow Activities


Windows Workflow Foundation supports virtually any scenario where human opera¬tors are involved. Learn how to use it to tame your workflows.

Dino Esposito

MSDN Magazine November 2006

persist security info not available by a codebase odbc driver



I want to interface the software Sage ventpartner with sharepoint.

For that i have to use the odbc {codebaseStand} driver and i know that the following string is working :


The pb is when i construct my bdc xml file i have to enter :

        <Property Name="rdbconnectionDriver" Type="System.String">{CodeBaseOdbcStand}</Property>
        <Property Name="rdbconnectiondbq" Type="System.String">c:\ventpart\database</Property>
        <Property Name="rdbconnectionuid" Type="System.String">administrateur</Property>
        <Property Name="rdbconnection Trusted_Connection " Type="System.String">yes</Property>
        <Property Name="DatabaseAccessProvider" Type="Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAccessProvider">Odbc</Property>
        <Property Name="SsoApplicationId" Type="System.String">23</Property>

how to unload webform am having problems


I have a find form, from that find form i do response.redirect("MasterForm.aspx") navigate to a record on that form.


Now i get back to find screen via masterform.aspx, at that time i still see all my data on the find form, another thing teh compiler not even going to load event.

when i get back to response.redirect("findform.aspx")

when i do response.redirect does'nt it close the form and unload all controls etc. on the fidn form?

I am usign asp.net / vb.net as codebehind, vs 2008.

Thank you very much for the helpful, info.



Split List into sub lists of List of size n

Hi all,   I've been playing around for a little bit trying to find the best way of taking a List<double> of variable size and splitting it in to sub-lists of  size n. So maybe a method stub like   public List<List<double>> splitData(int width,List<double> data) { <br/> }<br/> The problem is i cant get my head around how to iterate through the parameter "data" properly when the data.count is not exactly divisible by the parameter "width". I have been trying for loops but i think i need to switch to do whiles.   I'm not massively familiar with LINQ but could anyone advise if LINQ would provide an alternative way of doing it?   Any help much appreciated   John

AppDomain.Unload effects Unable to evaluate expression because the code is optimized or a native fra

Hello, I create a custom AppDomain.Create().  I registered the Unhandled Exception Event from my custom AppDomain. In the Unhandled Exception Event i try to Unload my AppDomain with AppDomain.Unload. But this effects a "Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack." Have anyone a idea what i can do against this behaviour. greetints

two adjacent double quotes in json causes blue screen by JavaScriptSerializer

Hello, I am using System.Web.Script.Serialization.JavaScriptSerializer to deserialize  http requests.  I get the blue screen when the contents I am deserializing has two double quotes, for example:  ""country"". Is there a fix for this?  Currently I replace the "" with a special string and then I deserialization, then I put back the "".  I do this for a given field in the object which I've seen comes in with ""s.  The problem is that I should be doing this for all fields in the input json.  This is a lot of extra code to write as I could be deserializing many different types of Json objects.  The "" is needed by the client to specify a quoted string, so I can't ask for the input to be changed. Any help on this subject would be really appreciated. Many thanks.     I am using .Net framework 3.5.

OPEN SYMMETRIC KEY - Persist Across Sessions

We have a client .NET WPF application which connects to a local SQL 2008 Express server.  We are using symmetric SQL encryption to encrypt some columns.  In order to encrypt or decrypt, we must first open the symmetric key.  We have a logon trigger which opens the key automatically for us. Unfortunately, the key is opened A LOT due to the key being closed after each session closes.  This causes the CPU to peg at 100%.  We are using connection pooling and it would be wonderful to have the key remain open across sessions.  Anyone have any thoughts on how to do this?

WebMethods, sends to wrong address (activities.aspx.aspx)?

I'm verifying e-mail address using WebMethods, however, I'm getting a 404 not found (error console) saying that it can't find activities.aspx.aspx. I am using URL-Rewriting, but I tried adding a detect for 'activities.aspx.aspx' and redirect back to .activities.aspx' but it didn't do anything.Here is the error:[HttpException]: The file '/activities.aspx.aspx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandl

How do I process Child activities

Hi! I have built a for each loop to process to process two activities grouped in a sequence activity. When I step through this code and get to the executionContext.ExecuteActivity it recognizes the child sequence activity but I don't drop into it what have I missed? Thanks foreach (MissingResult MR in ChecklistResponse) { string NotamID = MR.NOTAMID.ToString(); string Acountbility = MR.AccountID.ToString(); // Build the Query URL SingleQueryURL = String.Format(SingleQueryBase, AIDAPAccount, AIDAPPassword, JournalType, Acountbility, NotamID); // Access the first Child Activity Activity a = this.EnabledActivities[0]; // Subscribe to the closed event a.Closed += ChildActivityCountinuation; // Execute the activity executionContext.ExecuteActivity(a); // Increment the Loop counter LoopCounter++; }

Worflow template with some predefined activities and a hole to add other activities

Hi,all,        I am trying to write a workflow template to simplify modeling a new workflow.  The workflow template include some predefiend activities and an empty ifelseactivity there. When the user wants to define a new workflow, it use this workflow as base workflow(something like NewWorkflow: WorkflowTemplate), and then add some ifelsebranchactivities in the empty ifElseActivity.        I tried to implement it. But I met some problems .  First, When I drag a new ifElseBranchActity into the hole, it was not permitted and said "Cannot add or remove child activities on a non-editable activity". Furthermore, in the InitializeComponent() function,the designer will generate all the elements that has in the template workflow again.  So there will be two activities with the same name, one is inherited from the workflow template, one is generated in the new workflow.       Is there any way to implement my requirement in workflow 3.5? or workflow 4?        Best wishes to you all!  

Serializaing/deserializing XOMLs with custom activities that have properties of ISerializable types

I have custom activities that have dependency properties of types that implement ISerializable. When they are serialized/deserialized to XOML, the ISerializable-implied functionality is ignored and the standard reflection-based SerializableAttribute behavior is invoked. This poses a serious problem since the types require precise control over their serialization to ensure that proper internal state is maintained across serialization boundaries. I am aware of the WF custom serialization methods as mentioned in Tom Lakes' blog post, but they seem to require the DesignerSerializerAttribute attribute on all custom types. This is a problem because the types are business objects shared across many (non-WF) applications and they are part of a seperate code base to which I have no access. Is there a different method for getting custom serialization? And what is the reasoning behind the WF team choosing to ignore the very basic ISerializable attribute which is supported by every other .NET API across the framework? Thanks in advance.
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