I have an SqlDatasource that I am using with a GridView. Everything works fine except for the delete command on the SqlDatasource. I have two parameters on the DELETE command that I simply want it to delete from the table where those two parameters equal what the user selected to delete on the Gridview. Here is the code for the SqlDataSource:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MyConnectionString2 %>"
DeleteCommand="DELETE FROM table1 WHERE column1 = @param1 AND column2 = @param2"
<asp:Parameter Name="param1" />
<asp:Parameter Name="param2" />
It gives me an error telling me I need to declare the scalar variable "param2" and I cannot figure out why. I have it declared right there in the code