title: C# Linq to SQL Stored Procedures
body: <p>I have a stored procedure that returns a scalar int.  I am using C# and Linq to get the resulting data, but I get the following error when I compile:</p>
  
  <p>foreach statement cannot operate on variables of type 'int' because 'int' does not contain a public definition for 'GetEnumerator'</p>
  
  <p>My question is how do I get the resulting data if the stored procedure only returns an int.  I can do this using a datatable and dataset, but I need to do this in LINQ.</p>
  
  <p>Here's a code sample:</p>
  
  <pre><code>AppDataContext app = new AppDataContext();
  var lookup = app.spLookupFrom400(numberType, number);
  foreach(lookupResult result in lookup)
  {
      ...
  }
  </code></pre>