Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello,
I have the following code for SqlDataSource:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connectionString %>"
    SelectCommand="SelectDetails"
    InsertCommand="InsertDetails"
    UpdateCommand="UpdateDetails"
    DeleteCommand="DeleteDetails"
    SelectCommandType="StoredProcedure">
    <InsertParameters>
        <asp:ControlParameter Name="Name" ControlID="nameTxt" Type="String" />
        <asp:ControlParameter Name="ID" ControlID="idTxt" Type="Decimal" />
   </InsertParameters>
    <UpdateParameters>
       <asp:ControlParameter Name="Name" ControlID="nameTxt" Type="String" />
        <asp:ControlParameter Name="ID" ControlID="idTxt" Type="Decimal" />
    </UpdateParameters>
    <DeleteParameters>
        <asp:ControlParameter Name="ID" ControlID="idTxt" Type="Decimal" />
    </DeleteParameters>
</asp:SqlDataSource>


Stored procedures parameters are @Name, @ID, but I get error of missing parameters when I try to call InsertDetails, UpdateDetails and DeleteDetails.

Any suggestions?

Thank you in advance.
Posted

1 solution

You need to set the InsertCommandType, UpdateCommandType and DeleteCommandType properties to StoredProcedure.
 
Share this answer
 
Comments
Chriz12 16-Sep-15 0:51am    
Thank you:)
Derek Elliott 14-Jun-21 17:29pm    
Did you get an answer to this? I have the same issue using 'Insert Parameters' to call a Stored procedure.
Richard Deeming 15-Jun-21 3:51am    
The OP accepted the solution over five years ago, so this was the answer to their question.

If you have a different question, then ask a question[^]. You'll need to provide a proper description of the problem.
Derek Elliott 14-Jun-21 17:30pm    
BTW... I already had a InsertCommandType

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900