In Visual Studio 2K8, my app calls a stored proc using LinqToSql. The inferred return type was ISingleResult. I upgrade the project to 2k10 and now the inferred return type of the stored procedure is int. When I look at the .dbml, the return type is int for both versions of the project. I’m not sure why visual studio 2k10 does it one way and 2008 does it the other because the stored procedure does a ‘select distinct’. I would think LinqToSql would return a type where I can iterate through the result.
Here is the LinqToSql
var recordSet = context.GetNearbyLocations(Convert.ToChar(networkId), latitude, longitude, searchDistance);
How do I change the result to accept the multiple results the stored proc will return?
Added a line in the stored procedure to do a simple select from the output table to trick the L2S schema generator. Regenerated the schema, then removed the line from the proc. Somehow the data types from the stored procedure didn’t translate directly over so, with some monkeying with the select statement, I was able to get it to work properly.
Appears to be a Linq To Sql metadata interpretation difference between VS2k8 and VS2k10.