title: Filtering data using EntityDataSource and WHERE
body: <p>Hi I have an EntityDataSource.</p>
  
  <p>I need programmatically SEND a variable (@SelectedValue) to be used in a WHERE Filter for the EntityDataSource .</p>
  
  <p>Can you post a simple core to show me how to do it? Thanks for your time!</p>
  
  <p>To create WhereParameters on EntityDataSource I use this code:</p>
  
  <pre><code>            Parameter parameter = new Parameter("SelectedValue", TypeCode.Int32, uxTreeView1.SelectedValue);
              parameter.DefaultValue = "0";
              uxEntityDataSourceNodes.WhereParameters.Add(parameter);`
  </code></pre>
  
  <p>Here the code for the Control:</p>
  
  <pre><code>        &lt;asp:EntityDataSource ID="uxEntityDataSourceNodes" runat="server" 
          ConnectionString="name=TestHierarchyEntities" 
          DefaultContainerName="TestHierarchyEntities" EnableFlattening="False" 
          EnableUpdate="True" EntitySetName="CmsCategories" Where="it.CategoryId = @SelectedValue" 
          EntityTypeFilter="" Select=""&gt;
      &lt;/asp:EntityDataSource&gt;
  </code></pre>