Home » SQL Server

Assign guid to variable in control flow

How do I assign a script task generated GUID to an ssis variable and then pass it to sql server via a stored proc? I've only been able to find info on how to do it in a data flow task (derived column)

There doesn't seem to be a GUID type in the Data Type drop down in the Variables tab

I get the following error whether I create the variable as an object or string & setting the data type of the variable to either object,guid or string in the parameter mapping tab of the execute sql task don't do much either

Error: 0xC002F210 at Log Fail, Execute SQL Task: Executing the query "EXEC dbo.spLogGenericExtractControlOnComplete
    ..." failed with the following error: "Conversion failed when converting from a character string to uniqueidentifier.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Task failed: Log Fail


What magic combination of settings do I have to use to make it work?


2 Answers Found


Answer 1

You can put the guid  value into a String variable.  If you look at the System variables, there are a couple that have GUID in their name.  They are String variable.

Next try mapping  the variable  to the parameter  using the NVARCHAR datatype:  http://www.proteanit.com/b/2008/05/12/ssis-system-variable-executioninstanceguid/.


Answer 2

That's with 2005 though, I'm using 2008. I verified that the ExecutionInstanceGUID that i'm logging in my custom table matches the guid  in the sysssislog(or is it ssissyslog) table


But nevermind!! I got it working.. It was the curly brackets after all


My user variable  is of type  String & called FileExecutionGUID

my custom script  task =

Dts.Variables["FileExecutionGUID"].Value = '{'+System.Guid.NewGuid().ToString().ToUpper()+'}';


my stored  proc has the parameter  defined as uniqueidentifier

the execute  sql task  parameter mapping  has

User::FileExecutionGUID | Input | GUID


It'll probably work  without the upper, but I threw in a breakpoint and compared the System::ExecutionInstanceGUID value to my generated  guid and noticed that mine was missing {} and that it was in lower case



I have a Foreach loop liked this:


I trying to replace the script task with a Data Flow Task.  In the DataFlow Task, I wanted to use Derived Column to change the value from the variable objProduct, either index 1 or 0, from Foreach

What do I need to do to provide the input to the Derived Column the value from objProduct in Foreach as the feed?


-- IBM has jobs for USA employee to work oversea (India) and get their wages.

I would like to know if there is a solution to create a Guid and assign the same Guid to different fields in destination message. This should be done in Mapping. I know that I can use Inline C# and the following function:

public string GetGUID()
     return System.Guid.NewGuid().ToString();

But when I link the scripting functoid to different fields it generates a unique GUID for every linked field. My purpose is to generate a GUID which should be the same for linked elements(fields). Maybe there is a way of saving the generated Guid into a variable and assign this value to the elements I want?!

My xslt structure looks like this (this is just a snippet of my XSLT):

<xsl:for-each select="ElementA">
 <xsl:for-each select="ElementB">
    <xsl:value-of select="$var:Guid" />
<xsl:for-each select="ElementA">
 <xsl:for-each select="ElementB">
    <xsl:value-of select="$var:Guid" />


Hello everybody,

The following activity generates the design time error below:


newAssign  {

    To = newOutArgument<Req>(this.RequestData),

    Value = newInArgument<Req>(requestData)



Where requestData is a private Variable, internal to my Operation activity and this.RequestData is a public variable of it.


Error      43          

The private implementation of activity '856: OperationActivityInterop<RichiestaListaDipendenzePerBanca,RispostaListaDipendenzePerBanca>' has the following validation error:  

The referenced Variable object (Name = 'RequestData') is not visible at this scope

There may be another location reference with the same name that is visible at this scope, but it does not reference the same location.

                D:\Creval.ABC\Mainline\Servizi\ServiziComuni\Creval.ABC.Servizi.ServiziComuni.Struttura.Tasks\StrutturaService.xamlx                0             0            



Also, a quite similar statement

newAssign  {

    To = newOutArgument<Req>(ctx => this.Request.Get(ctx)),

    Value = newInArgument<Req>(requestData)



Seems to work fine when assigning the same private Variable to the this.Request public Argument of the operation.


So, I wish to understand:

1.  Why is this.RequestData (the public activity variable) not visible at the inner scope of the Assign statement?

2.  Why is, public the argument this.Request visible to the same Assign statement?



I tried then to bind this.Request argument my Imported child interop activity with the following code:


InArgument<Req> requestIn = newLambdaValue<Req>(ctx => this.Request.Get(ctx));

this.Body.ActivityProperties["Request"] = requestIn;


but I get the following error


Error  44    

The private implementation of activity '857: Interop' has the following validation error in the activity '861: LambdaValue<RichiestaListaDipendenzePerBanca>':  

An error occurred while attempting to extract the target object of type 'System.Activities.InOutArgument`1[Creval.ABC.Messaggi.ServiziComuni.Struttura.RichiestaListaDipendenzePerBanca]' from the method call expression '856: OperationActivityInterop<RichiestaListaDipendenzePerBanca,RispostaListaDipendenzePerBanca>.Request.Get(ctx)'.  Note that the expression determining the object of type 'System.Activities.InOutArgument`1[Creval.ABC.Messaggi.ServiziComuni.Struttura.RichiestaListaDipendenzePerBanca]' must not require the runtime context.  Error: The sub-expression for the object of type 'System.Activities.InOutArgument`1[Creval.ABC.Messaggi.ServiziComuni.Struttura.RichiestaListaDipendenzePerBanca]' resulted in a null value.

       D:\Creval.ABC\Mainline\Servizi\ServiziComuni\Creval.ABC.Servizi.ServiziComuni.Struttura.Tasks\StrutturaService.xamlx       0      0            


So, here, I wish to understand:

·         What does the error really mean?

·         is there a way to bind the Imported child Body activity directly to the Operation Request parameter (without having to assign the parameter value to a variable)?


Thank you very much for your help.



PS. I attach the activity code, for better clarity.

Should you need any information please, let me know.



    #region OperationActivityInterop


    publicclass OperationActivityInterop<Req, Res> : Activity

        where Req : RichiestaBase, new()

        where Res : RispostaBase, new()


        #region .ctor

        public OperationActivityInterop() {

            this.RequestData = newVariable<Req> { Name = "RequestData" };

            this.ResponseData = newVariable<Res> { Name = "ResponseData" };




        #region Implementation

        protectedoverrideFunc<Activity> Implementation




                DelegateInArgument<Exception> ex = newDelegateInArgument<Exception>();


                Func<Activity> implementation = () =>


                    Variable<Req> requestData = newVariable<Req> { Name = "RequestDataInternal" }; // internal variable used for the Receive and SendReply

                    Variable<Res> responseData = newVariable<Res> { Name = "ResponseDataInternal" };


                    IDictionary<string, Argument> bodyProps = this.Body != null ? this.Body.ActivityProperties : null;

                    if (bodyProps != null)


                        InArgument<Req> requestIn = newLambdaValue<Req>(ctx => this.Request.Get(ctx)); // this gives Error 44!!!!!

                        //InArgument requestIn = new InArgument<Req>(this.RequestData); // ok (design time) but requires the assignment that gives Error 43!!!!

                        this.Body.ActivityProperties["Request"] = requestIn;


                        OutArgument<Req> requestOut = newLambdaReference<Req>(ctx => this.Request.Get(ctx)); // this gives Error 44 !!!!!

                        //OutArgument requestOut = new OutArgument<Req>(this.RequestData); // ok (design time) but requires the assignment that gives Error 43!!!!

                        this.Body.ActivityProperties["RequestOut"] = requestOut;


                        InArgument<Res> responseIn = newLambdaValue<Res>(ctx => this.Response.Get(ctx)); // this gives Error 44!!!!!

                        // InArgument responseIn = new InArgument<Res>(this.ResponseData); // ok (design time) but requires the assignment that gives Error 43!!!!

                        this.Body.ActivityProperties["Response"] = responseIn;


                        OutArgument<Res> responseOut = newLambdaReference<Res>(ctx => this.Response.Get(ctx)); // this gives Error 44       !!!!!

                        // OutArgument responseOut = new OutArgument<Res>(this.ResponseData); // ok (design time) but requires the assignment that gives Error 43!!!!

                        this.Body.ActivityProperties["ResponseOut"] = responseOut;



                    Receive receive = newReceive()


                        DisplayName = "ReceiveRequest",

                        CanCreateInstance = true,

                        Action = this.Action,

                        OperationName = this.OperationName,

                        ServiceContractName = this.ServiceContractName,

                        Content = ReceiveContent.Create(newOutArgument<Req>(requestData))


                    Sequence imp = newSequence()


                        Variables = { requestData, responseData },

                        Activities = {


                            newAssign  {

                                To = newOutArgument<Req>(ctx => this.Request.Get(ctx)),

                                Value = newInArgument<Req>(requestData)


                            //new Assign  { // this gives Error 43 !!!!!

                            //    To = new OutArgument<Req>(this.RequestData),

                            //    Value = new InArgument<Req>(requestData)


                            newTryCatch() {

                                DisplayName = "TryCatch",

                                Try = this.Body,

                                Finally = newSequence() {

                                    Activities = {

                                        newAssign  {

                                            To = newOutArgument<Res>(ctx => this.Response.Get(ctx)),

                                            Value = newInArgument<Res>(responseData)


                                        newSendReply() {

                                            Request = receive,

                                            Content = newSendMessageContent() {

                                                DeclaredMessageType = typeof(Res),

                                                Message = newInArgument<Res>(ctx => this.Response.Get(ctx))









                    return imp;



                return implementation;


            set { }




        #region CacheMetadata

        protectedoverridevoid CacheMetadata(ActivityMetadata metadata)



            if (this.Body != null)


                RuntimeArgument reqArgument = newRuntimeArgument("Request", typeof(Req), ArgumentDirection.InOut, false);

                metadata.Bind(this.Request, reqArgument);



                RuntimeArgument resArgument = newRuntimeArgument("Response", typeof(Res), ArgumentDirection.InOut, false);

                metadata.Bind(this.Response, resArgument);











        #region Request

        publicInOutArgument<Req> Request { get; set; }


        #region Response

        publicInOutArgument<Res> Response { get; set; }


        #region RequestData // public variable (at Operation activity scope)

        publicVariable<Req> RequestData { get; set; }


        #region ResponseData // public variable (at Operation activity scope)

        publicVariable<Res> ResponseData { get; set; }



        #region Body // Interop activity (it must be bound to Request and Response data)

        publicInterop Body { get; set; }



        #region Action


        publicstring Action { get; set; }


        #region OperationName


        publicstring OperationName { get; set; }


        #region ServiceContractName

        [TypeConverter(typeof(ServiceXNameTypeConverter)), DefaultValue((string)null)]

        publicXName ServiceContractName { get; set; }







Hi Guyz,

                  I have a dataview webpart.                  

I am trying to Declare a variable in xslt and assign a value to it and reuse the variable instead of passing the value.But unfortunately it is not recognising the variable.




[contains(@ListB_x0020_List, $dvt_ParentRow/@Title) and @ListA_x0020_Years = '2011']


so instead of passing value 2011 i want to pass a variable holding the value like something below i am not sure my syntax is correct or not


 <<xsl:variable name="Byear">
      <xsl:value-of select="2011"/>

<xsl:param name = "Byear">2011</xsl:param>


so can some one help me out




Hi Can you tell me except  ALT PRNT screen how can i take full data flow and control flow image without any menu item or connection manager

This morning, I started having problems with Visual Studio 2005 on XP when I tried to create an SSIS project; I was getting an error message about the failure to create an SSIS runtime object, with the reference "Unable to cast COM of type 'Microsoft.SqlServer.DTS.Runtime.Wrapper.PackageNeutralClass' to interface type". Digging here and elsewhere on the Net, I used regsvr32 to re-register msxml3.dll, msxml6.dll, and dts.dll. This allowed me to create a new SSIS project, but I was unable to add a data flow task to the Control Flow pane -- when I dragged the control onto the pane, nothing happened, and when opened the Data Flow pane and clicked on the 'No data flow task has been defined. Click here to create a data flow task" link, I got a 'Failed to create the task. The designer could not be initialized." error. Searching here and on the Net, I uninstalled and reinstalled the SQL Server 2005 workstation tools.

After doing this, I am still unable to create a data flow task by dragging the task out of the toolbox; the pointer assumes the right form for the drag-and-drop, as it does for other tasks, but when I release the mouse button, nothing happens. However, when I go to the Data Flow pane and click on the 'click here to create a new data flow task', it creates the task, and I am able to use copy-and-paste to make copies of the data flow task and then change them as I want, so I've got a sort of workaround, but I want to identify why I can't just drag the task onto the pane.

Other suggestions for addressing related problems suggested using regsvr32 to reregister DTSPipeline.dll, but that failed to do anything visible.

I was using the program without a problem yesterday, and had made no configuration changes; I suspect that a GPO update may have been pushed to the computer overnight, causing the problem, but I don't know what could do this.



I am having the GUID, I need to assign this value to Lookup field in MSCRM.

How can i assign this in c# code.




 I am still new to ASP.net and it has been some time since i worked with code in general, so please forgive me for sounding stupid.  I am using SQL to populate several drop down lists in a form, and later using the values selected to populate a datagrid.  My issue is that the value i am trying to assign is a GUID in the database.  So when I:

Do While (reader.Read())

Dim newListItem AsNew ListItem()Loop

newListItem.Value = reader.GetGuid(0)

newListItem.Text = reader.GetString(1)


I get an error stating :"Value of type 'System.Guid' cannot be converted to 'String'".   My solution to this was to change "newListItem.Value = reader.GetGuid(0)" to 

newListItem.Value = reader.GetGuid(0).ToString


that worked to generate the drop downs which was great, but now i am trying to use that value in a sql statement to populate a listbox and since the value is now a string, i cannot use it in my where clause to against a GUID field in the database.  I would prefer to not have to convert the GUID in the first place, but have no idea how i could keep it in that format for my drop down list, and if that is not possible how can i convert the data back to GUID from String? 


I have a simple SSIS package that does the following. 

On the control flow tab, there is an Execute SQL task that calls a stored procedure and returns a GUID. 

I have a package scoped variable that stores a UNIQUEIDENTIFIER output from the stored procedure. It appears that the package variable data type does not include a GUID data type so I tried to use string instead.

Next, the Execute SQL task is mapped to a data flow task. 
Within that data flow task I have an OLE DB Source which connects to a SQL Server Destination task.

On the OLE DB Source Editor screen I have a query that performs the following:

SELECT ID, SessionKey, ....
FROM dba_DroppedLoginsLog
WHERE SessionKey = ?

I have clicked on the parameters button to map the Parameter to my variable called User::SessionKey. This is the output variable from my Execute SQL Task component on the Control Flow tab. This value should be a GUID, but again, I don't see a data type for that.

When I execute the package it fails on the OLE DB Source with the following error:
[OLE DB Source [1908]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E21. An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80040E21  Description: "Invalid character value for cast specification". 

I believe the problem is that I am translating that GUID to a string. Is there a smarter way to handle that? 

The main question is: How do you use a UNIQUEIDENTIFIER data type that comes from an output of a stored procedure in a query in a data flow component?

Thanks in advance for any guidance that can be offered.



Good day, i need help.

I have a few variables, so in a dataflow task i have a few OELDB sources that i would like to within the dataflow update the variable

I do not want to update by using rowcount, i need to update the variable with the result of the OLEDB Sources

Is this possible, if so how please?


Nested GridView Control returns "Object variable or With block variable not set" when outer GridView returns rows.

The Nested GridView Control works as long as the outer GridView returns rows, the following code works:

Protected Sub GridViewReport_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridViewReport.RowCreated
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim myStatus_ID As SqlDataSource = CType(e.Row.FindControl("sqlDeviceStatusAssign"), SqlDataSource)
            If Not e.Row.DataItem("Status_ID") Is Nothing Then
                myStatus_ID.SelectParameters(0).DefaultValue = e.Row.DataItem("Status_ID")
            End If
        End If
    End Sub

Object variable or With block variable not set.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object variable or With block variable not set.

Source Error:


Line 118:        If e.Row.RowType = DataControlRowType.DataRow Then
Line 119:            Dim myStatus_ID As SqlDataSource = CType(e.Row.FindControl("sqlDeviceStatusAssign"), SqlDataSource)
Line 120:            If Not e.Row.DataItem("Status_ID") Is Nothing Then
Line 121:                myStatus_ID.SelectParameters(0).DefaultValue = e.Row.DataItem("Status_ID")
Line 122:            End If  

I have tried checking for IsDbNull and insta checking to see if a label exists in a given row. 

This code  *If Not e.Row.DataItem("Status_ID") Is Nothing Then* appears to do nothing.

Same with the following:

*Dim localLblItemReference As Label = CType(e.Row.FindControl("lblItemReference"), Label)

*If Not localLblItemReference Is Nothing Then

Thanks for your time,




Hey All

Been getting this on and off for a while, usually after I perform a save to the project.

When the forms that I am working on refreshes is usually when I see it.

It goes away after I close the form and reopen it.

My project is quite large, app file is 61mb.

Any thoughts?

Davids Learning

How do I convert a string like this "nodeA:valueA|nodeB:valueB|...." to array or map [SOLVED],

then loop the array with key and value and assign nodeA and valueA below, using pointer[Still working hard to find answer]?

int nodeA = net.FindNode("nodeA");

Thank you.
How can I assign a variable which may contain a null value to a varaible which is declared as Dim var1 as String and then use that variable to insert into access database table?


heys all, i was wondering if we could assign variables into the values of attribute properties like say:


 <System.Xml.Serialization.XmlType(namespace:="Result" + x)> where x is a string with value "qwe" so basically we get the output:


or is there any other method to be able to do something like this. if i could do this, i could solve my problem at http://social.msdn.microsoft.com/Forums/en/asmxandxml/thread/6f803690-8f61-4707-adfd-17c43b3f977e i had been googling non-stop for 4-5 hours now to no avail. Every single link is purple yet i still couldn't solve something simple like resolving name conflicts with xml serialization of generic classes. it doesn't have to look pretty. its great as long as it can run!




I have one variable name called

@[User::max_seqid]  integer value value=30


Now I have a new declared new variable called sql and inside expression i wrote following query but somehow it is getting failing can you help me with evaluate expression


" SELECT sbp.[Seq_Id]
  FROM [dbo].[Stg] sbp

 JOIN  (select Opportunity_Id,max(Seq_Id) AS maxseq_id from dbo.Stg where

Seq_Id > @[User::max_seqid]   group by Opportunity_Id) AS Lt
   ON sbp.Opportunity_Id = Lt.Opportunity_Id
AND sbp.Seq_Id = Lt.maxseq_id"



Good Morning

I hopefully have an easy question that I cant find the answer to

I have a large text file that I iterate through line by line seeking some text. I then want to perform a count of how many times this text appears in the document and asign it to a variable before recording the total number of instances in a table for subsequent reporting

The just of this is as follows where I want to return variables of TotalNo00, TotalNo01...etc

Public Sub AssignVar()

strSearchParameters = "00,01,02,03,04,05"

intStringStart = 1
While InStr(intStringStart, strSearchParameters, ",") > 0
    DoCmd.SetWarnings False
    intStringEnd = InStr(intStringStart, strSearchParameters, ",")
    strSearchString = Mid(strSearchParameters, intStringStart, intStringEnd - intStringStart)
    Dim varValue As Long
    Dim varStringName As String
    varStringName = "TotalNo" & strSearchString
    varValue = 10 * Int(strSearchString)
    varStringName = varValue
    Debug.Print varStringName & "  " & varValue
    intStringStart = intStringEnd + 1

Sorry if this seems overly simple, but cnt seem to get it to work through in my simple understanding of vb

Many Thanks for your time



In a TransactedTeceiveScope I write to a DB table (via a custom activity SaveApprovalRequest using EF) and want to execute some other activities.

With SaveApprovalRequest being the only acitivty workflow persistance works fine. As soon as I addionally assign a value to a variable the workflow no longer gets persisted. Why?

I am using EF to write to a table in the same DB where .

Below a minimal test case. With the assign activity the workflow does not persist. Without the assign activity the workflow does persist.

<WorkflowServicemc:Ignorable="sap"ConfigurationName="ApprovalWorkflow"sap:VirtualizedContainerService.HintSize="355.617391304348,1127.79130434783"Name="ApprovalWorkflow"mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces"xmlns="http://schemas.microsoft.com/netfx/2009/xaml/servicemodel"xmlns:ac="clr-namespace:ApprovalWorkflowService.Contracts;assembly=ApprovalWorkflowService.Contracts"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System"xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"xmlns:p="http://tempuri.org/"xmlns:p1="http://schemas.microsoft.com/netfx/2009/xaml/activities"xmlns:s="clr-namespace:System;assembly=mscorlib"xmlns:s1="clr-namespace:System;assembly=System"xmlns:s2="clr-namespace:System;assembly=System.Xml"xmlns:s3="clr-namespace:System;assembly=System.Core"xmlns:s4="clr-namespace:System;assembly=System.ServiceModel"xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities"xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities"xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System"xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel"xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core"xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib"xmlns:sd="clr-namespace:System.Data;assembly=System.Data"xmlns:sl="clr-namespace:System.Linq;assembly=System.Core"xmlns:snm="clr-namespace:System.Net.Mail;assembly=System"xmlns:ssa="clr-namespace:System.ServiceModel.Activities;assembly=System.ServiceModel.Activities"xmlns:ssx="clr-namespace:System.ServiceModel.XamlIntegration;assembly=System.ServiceModel"xmlns:st="clr-namespace:System.Text;assembly=mscorlib"xmlns:w="clr-namespace:WorkflowService;assembly=WorkflowService"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"><p1:SequenceDisplayName="Sequential Service"sad:XamlDebuggerXmlReader.FileName="D:\00_Projekte\00_LeanWork\Workflow\Approval\ApprovalWorkflow\WorkflowService\ApprovalWorkflow.xamlx"sap:VirtualizedContainerService.HintSize="325.565217391304,1097.73913043478"mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces"><p1:Sequence.Variables><p1:Variablex:TypeArguments="CorrelationHandle"Name="handle"/><p1:Variablex:TypeArguments="ac:ApprovalRequest"Name="ApprovalRequest"/><p1:Variablex:TypeArguments="x:Int32"Name="ApprovalID"/><p1:Variablex:TypeArguments="CorrelationHandle"Name="ApprovalIDHandle"/><p1:Variablex:TypeArguments="snm:MailAddress"Name="RequestorMailAddress"/></p1:Sequence.Variables><sap:WorkflowViewStateService.ViewState><scg3:Dictionaryx:TypeArguments="x:String, x:Object"><x:Booleanx:Key="IsExpanded">True</x:Boolean></scg3:Dictionary></sap:WorkflowViewStateService.ViewState><TransactedReceiveScopeRequest="{x:Reference __ReferenceID0}"sap:VirtualizedContainerService.HintSize="303.026086956522,585.182608695652"><p1:Sequencesap:VirtualizedContainerService.HintSize="277.147826086957,375.652173913043"><sap:WorkflowViewStateService.ViewState><scg3:Dictionaryx:TypeArguments="x:String, x:Object"><x:Booleanx:Key="IsExpanded">True</x:Boolean></scg3:Dictionary></sap:WorkflowViewStateService.ViewState><p1:Assignsap:VirtualizedContainerService.HintSize="254.608695652174,57.6"><p1:Assign.To><p1:OutArgumentx:TypeArguments="snm:MailAddress">[RequestorMailAddress]</p1:OutArgument></p1:Assign.To><p1:Assign.Value><p1:InArgumentx:TypeArguments="snm:MailAddress">[New MailAddress("test@test.com")]</p1:InArgument></p1:Assign.Value></p1:Assign><w:SaveApprovalRequestApprovalRequest="[ApprovalRequest]"sap:VirtualizedContainerService.HintSize="254.608695652174,21.704347826087"Result="[ApprovalID]"/><SendReplyDisplayName="SendResponse"sap:VirtualizedContainerService.HintSize="254.608695652174,91.8260869565217"><SendReply.CorrelationInitializers><QueryCorrelationInitializerCorrelationHandle="[ApprovalIDHandle]"><XPathMessageQueryx:Key="key1"><XPathMessageQuery.Namespaces><ssx:XPathMessageContextMarkup><x:Stringx:Key="xg0">http://schemas.microsoft.com/2003/10/Serialization/</x:String></ssx:XPathMessageContextMarkup></XPathMessageQuery.Namespaces>sm:body()/xg0:int</XPathMessageQuery></QueryCorrelationInitializer></SendReply.CorrelationInitializers><SendReply.Request><Receivex:Name="__ReferenceID0"CanCreateInstance="True"DisplayName="ReceiveApprovalRequest"sap:VirtualizedContainerService.HintSize="277.147826086957,91.8260869565217"OperationName="RequestApprovals"ServiceContractName="p:IService"><Receive.CorrelationInitializers><RequestReplyCorrelationInitializerCorrelationHandle="[handle]"/></Receive.CorrelationInitializers><ReceiveMessageContent><p1:OutArgumentx:TypeArguments="ac:ApprovalRequest">[ApprovalRequest]</p1:OutArgument></ReceiveMessageContent></Receive></SendReply.Request><SendMessageContent><p1:InArgumentx:TypeArguments="x:Int32">[ApprovalID]</p1:InArgument></SendMessageContent></SendReply></p1:Sequence></TransactedReceiveScope><p1:Sequencesap:VirtualizedContainerService.HintSize="303.026086956522,348.104347826087"><p1:Sequence.Variables><p1:Variablex:TypeArguments="CorrelationHandle"Name="__handle1"/></p1:Sequence.Variables><sap:WorkflowViewStateService.ViewState><scg3:Dictionaryx:TypeArguments="x:String, x:Object"><x:Booleanx:Key="IsExpanded">True</x:Boolean></scg3:Dictionary></sap:WorkflowViewStateService.ViewState><Receivex:Name="__ReferenceID1"DisplayName="ReceiveApproval"sap:VirtualizedContainerService.HintSize="254.608695652174,91.8260869565217"OperationName="Approve"ServiceContractName="p:IService"><Receive.CorrelationInitializers><RequestReplyCorrelationInitializerCorrelationHandle="[__handle1]"/></Receive.CorrelationInitializers></Receive><SendReplyRequest="{x:Reference __ReferenceID1}"DisplayName="SendReplyToReceive"sap:VirtualizedContainerService.HintSize="254.608695652174,91.8260869565217"/></p1:Sequence></p1:Sequence></WorkflowService>



I am writing xslt to create HTML by using input xml data. The input XML looks like this

ID Name  Description 
1 Name1 Description Something
1 Name1 Description another text
2 Name2 Some text
2 Name2 Some text2
2 Name2 Some text2

Here Id is primary, where Name is unique as per ID. I want to show the output the following way

   * Description Something
   * Description another text
   * Some text
   * Some text2
   * Some text2

So I want to declare a variable in XSLT and make a loop in records and store the previous record ID. IF the previous record id is same, then no need to show the name.
But when I declare in the following xslt, I am getting 'The variable or parameter 'xxx' was dublicated within the same scope' error

<xsl:output method ="html" media-type="text/html" encoding="iso-8859-1" />
  <xsl:template match="Details">
    <xsl:variable name="counter" select="0"/>
       <xsl:for-each select="XMLParentNode/XMLDetailNode/XMLSubDetailNode">
            <xsl:if test="$counter = 1">
                <b style='text-color:red;'>
                  <xsl:value-of select="NAME" disable-output-escaping="yes" />
              <br />
                    <xsl:value-of select="DESCRIPTION" disable-output-escaping="yes" />
            <xsl:if test="$vCategoryId!=0">
              <br />
                  <xsl:value-of select="NAME" disable-output-escaping="yes" />
           <xsl:variable name="counter" select="0"/>


Plese let me know where I am making issue. Also if possible pls provide me some example on the same.

Many Thanks,


xamount is receiving this message on the last line.  The session is being set in the previous page.  Is there a way to resolve the message or should I just use a previous page

        Dim subAmt As String = Session("MembType")
        Dim xamount As String

        Select Case subAmt
            Case "0"
                xamount = "40"
            Case "1"
                xamount = "5"
            Case "2"
                xamount = "20"
            Case "3"
                xamount = "2"
        End Select

        post_values.Add("x_amount", xamount)



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure