Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You will need to add a <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.controlparameter.aspx" rel="nofollow noreferrer">ControlParameter</a> to <code>SelectParameters</code></p> <pre><code>&lt;asp:ControlParameter Name="entityId" ControlID="DropDownList1" PropertyName="SelectedItem" Type="String" /&gt; </code></pre> <p>Also see this question <a href="https://stackoverflow.com/questions/5326113/how-to-specify-parameter-value-for-stored-procedure-in-sqldatasource">How to specify parameter value for stored procedure in SqlDataSource</a></p> <p><strong>Edit</strong> you can use the Selecting event as shown here </p> <p><a href="https://stackoverflow.com/questions/6048983/writing-a-sqldatasource-in-code-behind-in-c-sharp-to-use-a-code-behind-value?rq=1">Writing a SQLdatasource in code behind in C# to use a code behind value</a></p> <p>You can also add a select parameter as </p> <pre><code>EntityGrid.SelectParameters.Add("entityId", DropDownList1.SelectedItem.Text); </code></pre> <p>Just rename "entityId" to the name of parameter to be used with SP</p> <p><strong>Edit2</strong> :</p> <p>Instead of </p> <pre><code>EntityGrid.DataSource = cmd.ExecuteReader(); EntityGrid.DataBind(); </code></pre> <p>Try this</p> <pre><code>SqlDataReader reader = cmd.ExecuteReader(); using (reader) { DataTable table = new DataTable(); table.Load(reader); EntityGrid.DataSource = table; } </code></pre> <p>See this link for more :<br> <a href="http://mentaljetsam.wordpress.com/2008/11/20/loading-an-sqldatareader-into-a-datagridview/" rel="nofollow noreferrer">http://mentaljetsam.wordpress.com/2008/11/20/loading-an-sqldatareader-into-a-datagridview/</a></p>
 

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