title: SQL Server 2005 Assembly Cast Invalid
body: <p>I'm trying to call my assemblys SP and receive the following error:</p>
  
  <pre><code>A .NET Framework error occurred during execution of user-defined routine or aggregate "Pmt_ImportJournal": 
  System.InvalidCastException: Specified cast is not valid.
  System.InvalidCastException: 
     at JournalImport.Pmt_ImportJournal(Int32 orderno)
  </code></pre>
  
  <p>My SP in the assembly is defined like so:</p>
  
  <pre><code>[SqlProcedure(Name = "Pmt_ImportJournal")]
  public static void Pmt_ImportJournal(int orderno)
  </code></pre>
  
  <p>Should I be using the SQL* datatypes instead of simply an int in the signature? For example SqlInt32?</p>