Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This isn't so much an "answer" as a "needs more context", but: with the code as posted, it works fine (below). I suspect the issue here is specific to something inside the stored procedure - something peculiar it is doing:</p> <pre><code>public void TestIssue17648290() { var p = new DynamicParameters(); int code = 1, getMessageControlId = 2; p.Add("@Code", code); p.Add("@MessageControlId", getMessageControlId); p.Add("@SuccessCode", dbType: DbType.Int32, direction: ParameterDirection.Output); p.Add("@ErrorDescription", dbType: DbType.String, direction: ParameterDirection.Output, size: 255); connection.Execute(@"CREATE PROCEDURE #up_MessageProcessed_get @Code varchar(10), @MessageControlID varchar(22), @SuccessCode int OUTPUT, @ErrorDescription varchar(255) OUTPUT AS BEGIN Select 2 as MessageProcessID, 38349348 as StartNum, 3874900 as EndNum, GETDATE() as StartDate, GETDATE() as EndDate SET @SuccessCode = 0 SET @ErrorDescription = 'Completed successfully' END"); var result = connection.Query(sql: "#up_MessageProcessed_get", param: p, commandType: CommandType.StoredProcedure); var row = result.Single(); ((int)row.MessageProcessID).IsEqualTo(2); ((int)row.StartNum).IsEqualTo(38349348); ((int)row.EndNum).IsEqualTo(3874900); DateTime startDate = row.StartDate, endDate = row.EndDate; p.Get&lt;int&gt;("SuccessCode").IsEqualTo(0); p.Get&lt;string&gt;("ErrorDescription").IsEqualTo("Completed successfully"); } </code></pre> <p>which outputs:</p> <pre><code>Running TestIssue17648290 - OK! </code></pre> <p>(which is to say: that works fine)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload