tags:

views:

450

answers:

1

HI all,

I'm having an issue with Linq and my stored procedures. The error I am getting is :

Could not find an implementation of the query pattern for source type 'int'. 'Select' not found.

Here is the code found in my DBClasses:

[Function(Name="dbo.findahostel_getHostelsByTags")]
public IEnumerable<hostel> findahostel_getHostelsByTags([Parameter(DbType="VarChar(150)")] string tags)
{
 IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), tags);
    return ((IEnumerable<hostel>)(result.ReturnValue));
}

Here is my Linq Code:

IQueryable<hostel> hostels = from h in db.findahostel_getHostelsByTags_Name(searchQuery)
                                         select h;

I cant find a refrence to an int anywhere.

Matt

+1  A: 

I think the issue is that you're trying to cast result.ReturnValue as an IEnumerable<hostel> and I'm pretty sure that ReturnValue is an int. It is what the stored procedure returns, which is not to be confused with the rows that a stored proc also "returns"

Ralph Shillington
Yep that would be correct mate; ended up being a cache issue on my hoste end.
bExplosion