Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>try this <a href="http://msdn.microsoft.com/en-us/library/bb345303.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb345303.aspx</a></p> <pre><code>using (AdventureWorksEntities context = new AdventureWorksEntities()) { // Call the constructor with a query for products and the ObjectContext. ObjectQuery&lt;Product&gt; productQuery1 = new ObjectQuery&lt;Product&gt;("Products", context); foreach (Product result in productQuery1) Console.WriteLine("Product Name: {0}", result.Name); string queryString = @"SELECT VALUE product FROM AdventureWorksEntities.Products AS product"; // Call the constructor with the specified query and the ObjectContext. ObjectQuery&lt;Product&gt; productQuery2 = new ObjectQuery&lt;Product&gt;(queryString, context); foreach (Product result in productQuery2) Console.WriteLine("Product Name: {0}", result.Name); // Call the constructor with the specified query, the ObjectContext, // and the NoTracking merge option. ObjectQuery&lt;Product&gt; productQuery3 = new ObjectQuery&lt;Product&gt;(queryString, context, MergeOption.NoTracking); foreach (Product result in productQuery3) Console.WriteLine("Product Name: {0}", result.Name); } </code></pre> <p>you might take a look at this section</p> <pre><code>string queryString = @"SELECT VALUE product FROM AdventureWorksEntities.Products AS product"; // Call the constructor with the specified query and the ObjectContext. ObjectQuery&lt;Product&gt; productQuery2 = new ObjectQuery&lt;Product&gt;(queryString, context); foreach (Product result in productQuery2) Console.WriteLine("Product Name: {0}", result.Name); </code></pre> <p>don't forget to mark it answered if it works for you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload