ServiceStack ORM Lite calls a stored procedure with multiple parameters

I am using ORM Lite.SqlList method to call a stored procedure and map the results to my custom object. When I only use one parameter and the stored procedure call as it should work fine:

var results = conn.SqlList<CustomObject>("EXEC MyStoredProcedure @paramOne"), new { paramOne = "someParam" });

      

When I want to call a stored procedure with multiple parameters, and I call it like below, I get the error "The specified key was not in the dictionary."

var results = conn.SqlList<CustomObject>("EXEC MyStoredProcedure @paramOne, @paramTwo"), new { paramOne = "someParam", paramTwo = "someOtherParam" });

      

I have looked at a test page of an sql stored procedure on the ORM Lite Github repository but does not show how to call stored procedures with more than one parameter.

Thank.

EDIT:

I should add that the second parameter on the sql side is the type of the custom table and I am posting the type DataTable to C #.

+3


source to share





All Articles