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
stored-procedures servicestack ormlite-servicestack


source to share


No one has answered this question yet

Check out similar questions:

1504
Inserting Stored Procedure Results into a Temporary Table
784
Function vs. Stored Procedure in SQL Server
679
Finding text in a stored procedure in SQL Server
23
Stored procedures and ORM
4
Call a stored procedure with a UDT parameter from C #?
3
SqlScalar <T> and SqlList <T> issue when calling a stored procedure with parameters
2
C # DataTable with ushort field as parameter to SQL Server stored procedure
2
Call Stored Procedure With Additional Parameters Using OrmLite
0
Share table variable between stored procedure in SQL Server
0
SQL stored procedure returns multiple rows as errors



All Articles
Loading...
X
Show
Funny
Dev
Pics