0

I am using a gridview where i am calling a stored procedure which has 4 input parameters.

Out of these 4 parameters, values are to be given such that

DomainId = This has to be the row which is to be deleted. This is a primary key

Domain = This field has to be passed to SP as NULL.

Description= This field has to be passed as NULL.

OperationType= This field has to be passed by programmer as some static value say 4

How to i need to specify these here...

More details of the Question are here.

Please help me out.

<DeleteParameters>
                        <asp:ControlParameter ControlID="GridView1" Name="DomainId" 
                            PropertyName="SelectedValue" Size="4" Type="Int32" />  
                        <asp:Parameter DefaultValue="" Name="Domain"  Size="16" Type="String" />
                        <asp:Parameter DefaultValue="" Name="Description" Type="String" />
                        <asp:Parameter DefaultValue="4" Name="OperationType" Type="Byte" />
                    </DeleteParameters>

On running my code using this

I gets an error

Procedure or Function 'spOnlineTest_Domain' expects parameter '@Domain', which was not supplied

1 Answer 1

2

you would need to prefix your parameter name with a "@"

your parameters would look like this instead.

<asp:Parameter DefaultValue="" Name="@Domain"  Size="16" Type="String" />
<asp:Parameter DefaultValue="" Name="@Description" Type="String" />
<asp:Parameter DefaultValue="4" Name="@OperationType" Type="Byte" />
Sign up to request clarification or add additional context in comments.

1 Comment

If you are passing in null for those two parameters (@Domain, @Description), try removing the @Domain and @Description parameters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.