Call stored procedure with parameters in script task

Hi. I am getting the this error :

When I compile the script task:

What is missing ? Please help.

Like 0

Like

4 comments

IIRC the DataValueType param expected here isn't an enum. Try changing the code to add this:

var dataValueTypeManager = (DataValueTypeManager)userConnection.AppManagerProvider.GetManager("DataValueTypeManager");
var textDataValueType = (TextDataValueType)dataValueTypeManager.GetInstanceByName("Text");

 

Then use:

storedProcedure.WithOutputParameter("res_msg", textDataValueType);

Ryan

Ryan Farley,

Thanks. Now it runs.

But sorry, I still need some help on recovering the output prm from the stored procedure. It always returns "Core.DB.QueryParameter", instead of the string returned by the SP.

 

Ricardo Bigio,

You can capture that using this:

var resultParameter = (string)storedProcedure.Parameters.FindByName("res_msg").Value;

Ryan

Perfect. Thanks

Show all comments