title: C# MVC Datatype to pass for stored procedure output parameter
body: <p>I'm trying to call a SQL server stored procedure from a C# MVC controller. The parameters for the stored procedure are as follows:</p>
  
  <pre><code>ALTER procedure [dbo].[spVehicleSearch360]
      @strLocale          nvarchar(10),
      @xmlSearchCriteria  xml,
      @strSortBy          nvarchar(30),
      @strSortDir         nvarchar(5),
      @uidSessionId       uniqueidentifier,
      @iPage                int = 1,
      @iPageSize          int = 10,
      @iCount               int output,
      @iTotalCount        int output,
      @bShowResults       bit = 1,
      @xmlResults         xml = null output,
      @dtLastItemModified datetime = null output,
      @uidVehicleInList uniqueidentifier = null
  as
  begin 
  .........
  .........
  .........
  </code></pre>
  
  <p>When I call this from my controller:</p>
  
  <pre><code>var search_results = db.spVehicleSearch(strLocale, xmlSearchCriteria, strSortBy, strSortDir, uidSessionId, iPage, iPageSize, iCount, iTotalCount, bShowResults, xmlResults, dtLastItemModified, uidVehicleInList);
  </code></pre>
  
  <p>I am getting the following error for the stored procedure's output parameters (arguments 8,9,11,12)</p>
  
  <blockquote>
    <p>Arugment [n]: cannot convert from [int/string/system.DateTime] to
    'System.Data.Objects.ObjectParameter'</p>
  </blockquote>
  
  <p>What should I be passing in for these arguments?</p>
  
  <p>(Apologies if this is a very elementary question, I am very new to .net)</p>
  
  <p>Thank you</p>