title: Proc Not Returning Output Parameter Value using PetaPoco
body: <p>If I execute this from SQL Server, I get the output parameter with no problem:</p>
  
  <pre><code>exec [dbo].[SelectByRecipient] @0, @1, @2, @TotalCount = @3 output
  </code></pre>
  
  <p>The output parameter returns 18.  However, if I do this from PetaPoco, the output parameter returns null.  I tried these combinations:</p>
  
  <pre><code>var total = new SqlParameter("TotalCount", System.Data.SqlDbType.Int);
  total.Direction = System.Data.ParameterDirection.Output;
  
  var results = ctx.Query&lt;X&gt;("exec [dbo].[SelectByRecipient] @0, @1, @2, @TotalCount = @3 output", var0, var1, var2, total);
  //var results = ctx.Query&lt;X&gt;("exec [dbo].[SelectByRecipient] @0, @1, @2, @@TotalCount = @3 output", var0, var1, var2, total);
  //var results = ctx.Query&lt;X&gt;("exec [dbo].[SelectByRecipient] @0, @1, @2, @3 output", var0, var1, var2, total);
  //var results = ctx.Query&lt;X&gt;("exec [dbo].[SelectByRecipient] @0, @1, @2, @3 out", var0, var1, var2, total);
  
  //Blows up because total.Value is null
  var totalCount = (int)total.Value;
  </code></pre>
  
  <p>The three statements I tried fail.  They were working, but I don't know what changed...  all of a sudden, I get these errors now...</p>
  
  <p>Any ideas why?</p>