title: Query returns SQL expression and not value from database?
body: <p>I have an integer column in my table in the database, and I want to select it but it give me exception that can't convert from int to string </p>
  
  <p>Example I want to select <code>CategoryID</code> from <code>Category</code> table where <code>CategoryName="Cat"</code></p>
  
  <p><code>categoryID</code> is int &amp; <code>categoryName</code> is string </p>
  
  <p>my linq query which I tried </p>
  
  <pre><code>string Category_ID = (from p in StaticVa.new_data_context.Categories
                                where p.CategoryName == Category_Name
                                select p.CategoryID).ToString();
  </code></pre>
  
  <p>It returned <code>"SELECT [t0].[CategoryID]\r\nFROM [dbo].[Category] AS [t0]\r\nWHERE [t0].[CategoryName] = @p0\r\n"</code></p>