title: LINQ to SQL - 'Select' not found
body: <p>I have been looking to solve this for hours with no luck. </p>
  
  <p>I have a very simple scenario - I am trying the following in LINQ-to-SQL</p>
  
  <pre><code> var qry = (from row 
     in DBConnect.SEARCHhash("test", "1234")  
      select row);
  </code></pre>
  
  <p>Where the <code>SEARCHhash</code> is a stored procedure - Unfortunately, I can't even put <code>.ToList()</code> at the end because IntelliSense shows the following error</p>
  
  <blockquote>
    <p>Could not find an implementation of the query pattern for source type 'void'.  'Select' not found.</p>
  </blockquote>
  
  <p>All my other stored procedures work fine, just this one doesn't work.</p>
  
  <p>Then I remember that when I dragged and dropped the stored procedure to Designer I got the following warning </p>
  
  <blockquote>
    <p>The return types for the following stored procedures could not be detected. Set the return type for each stored procedure in the Properties window.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/UifGc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UifGc.png" alt="enter image description here"></a></p>
  
  <p>So, I opened the properties and clicked on dropdown and only available option was int(int32) so selected int </p>
  
  <p><a href="https://i.stack.imgur.com/OSeUu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OSeUu.png" alt="enter image description here"></a></p>
  
  <p>But now then I started getting the following error </p>
  
  <blockquote>
    <p>Could not find an implementation of the query pattern for source type 'int'.  'Select' not found</p>
  </blockquote>
  
  <p>The following is the code from Designer </p>
  
  <pre><code>[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.SEARCHhash")]
          public int SEARCHhash([global::System.Data.Linq.Mapping.ParameterAttribute(Name="Keywords", DbType="VarChar(540)")] string keywords, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UserId", DbType="NVarChar(128)")] string userId)
          {
              IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), keywords, userId);
              return ((int)(result.ReturnValue));
          }
  </code></pre>
  
  <p>I also started comparing my stored procedures and I noticed that this stored procedure has <code>JOIN</code> in it and of course it is using `FREETEXT'</p>
  
  <p>Here is my stored procedure code:</p>
  
  <pre><code>SELECT 
      [dbo].[SEARCHMLinksData].PageID, 
      [dbo].[SEARCHMLinksData].PageTitle, 
      [dbo].[SEARCHMLinksData].PageDescription, 
      [dbo].[SEARCHMLinksData].PageType
  FROM 
      [dbo].[SEARCHMLinksData] 
  LEFT JOIN 
      [dbo].[SEARCHMLinksTags] ON [SEARCHMLinksData].PageID = [SEARCHMLinksTags].PageID
  WHERE 
      (FREETEXT([SEARCHMLinksData].*, @Keywords) OR  
       FREETEXT([SEARCHMLinksTags].*,@Keywords) ) 
      AND
      ([SEARCHMLinksData].UserID = @UserId OR [SEARCHMLinksTags].[user_id] = @UserId)
  </code></pre>
  
  <p>Any idea or help will be appreciated</p>
  
  <p>Cheers</p>
  
  <p>In addition, I tried so many things including the following 
  <a href="https://www.mssqltips.com/sqlservertip/1542/using-stored-procedures-with-linq-to-sql/" rel="nofollow noreferrer">https://www.mssqltips.com/sqlservertip/1542/using-stored-procedures-with-linq-to-sql/</a>
  <a href="https://stackoverflow.com/questions/7035669/the-return-types-for-the-following-stored-procedures-could-not-be-detected">The return types for the following stored procedures could not be detected</a>
  <a href="https://stackoverflow.com/questions/31241541/could-not-find-an-implementation-of-the-query-pattern-for-source-type-system-da">Could not find an implementation of the query pattern for source type &#39;System.Data.Entity.DbSet&#39;</a></p>