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:
foreach statement cannot operate on variables of type 'int' because 'int' does not contain a public definition for 'GetEnumerator'
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.
Here's a code sample:
AppDataContext app = new AppDataContext();
var lookup = app.spLookupFrom400(numberType, number);
foreach(lookupResult result in lookup)
{
...
}