title: LINQ-to-SQL: Stored Procedure that returns a single scalar value?
body: <p>I am using LINQ-to-SQL for an application that queries a legacy database. I need to call a stored procedure, that selects a single integer value. Changing the stored procedure is not an option.</p>
  
  <p>The designer creates a method with this signature:</p>
  
  <pre><code>private ISingleResult&lt;sp_xal_seqnoResult&gt; NextRowNumber([Parameter(DbType="Int")] System.Nullable&lt;int&gt; increment, [Parameter(DbType="Char(3)")] string dataset)
  </code></pre>
  
  <p>I would like the return type to be int. How do I do this using LINQ-to-SQL ? </p>