Question

Using stored procedures in a business process

I am attempting to call a stored procedure via a script object in a Business Process. When the system complies, I get the error:‘

UserConnection’ is a type, which is not valid in the given context

Any suggestions on how to resolve this?

Below is my code:

StoredProcedure storedProcedure = new StoredProcedure(UserConnection, "mystoredprocedure") ;
storedProcedure.Execute();
return true;

Thanks in advance.

Like 1

Like

2 comments

In a script task in an interpretive business process you need to get "user connection"  with the following syntax:

var userConnection = Get<UserConnection>("UserConnection");

Additionally, please note that if you want to work with process parameters in a script task, you need to write in the following maner:

var parameter1 = Get<Guid>("Parameter1");

Set("Parameter2", parameter1.ToString());

var parameter2 = Get<string>("Parameter2");

 

That worked. Thanks Eugene!

Show all comments