Note that there are some explanatory texts on larger screens.

plurals
  1. POMoved to server: an sqlparameter with parametername is not contained by this sqlparametercollection
    text
    copied!<p>I moved a fully tested site to my web server and it keeps returning </p> <blockquote> <p>A SqlParameter with ParameterName 'Choices' is not contained by this SqlParameterCollection.</p> </blockquote> <p>Using VS 2010 I cannot replicate this error, everything works perfectly and passes all tests.</p> <p>The server is running IIS 6 and net 3.5. I have used it in the past and have not had any problems. The site is built in asp.net 3.5 using vb.net.</p> <p>Code:</p> <pre><code>&lt;SelectParameters&gt; &lt;asp:Parameter Name="UserID" Type="Object" /&gt; &lt;asp:ControlParameter ControlID="DropDownList1" Name="Active" PropertyName="SelectedValue" Type="Boolean" /&gt; &lt;asp:Parameter Name="Choices" Type="String" /&gt; &lt;/SelectParameters&gt; Protected Sub BoarListSQL_Selecting(sender As Object, e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles BoarListSQL.Selecting e.Command.Parameters("@UserId").Value = userId e.Command.Parameters("@Active").Value = DropDownList1.SelectedValue.ToString() e.Command.Parameters("@Choices").Value = lb_breeds.SelectedValue.ToString() 'breedChoice End Sub SelectCommand="If @Choices = 'ALL' BEGIN SELECT BoarID,Registration,Breed,Tag1,DOB,Name,BoarStudID,EntryDate,RemovalDate,Reason,Active,Location,BreedingHerdDate,Notes FROM [Table] WHERE ([UserID] = @UserID) AND ([Active] = @Active) END ELSE SELECT BoarID,Registration,Breed,Tag1,DOB,Name,BoarStudID,EntryDate,RemovalDate,Reason,Active,Location,BreedingHerdDate,Notes FROM [Table] WHERE ([UserID] = @UserID) AND ([Active] = @Active) AND ([Breed] = @Choices)" </code></pre> <p>I have Choices in the parameter list and I am adding a value when the select is ran.</p> <p>Any help is appreciated. Thanks.</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