views:

273

answers:

2

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  A: 

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" />
clyc
@clyc Added prefix to my code error is stil the same.
vaibhav
If you are passing in null for those two parameters (@Domain, @Description), try removing the @Domain and @Description parameters.
clyc
A: 

What does your stored procedure look like?

Jordan Johnson
@Jordan Plz check detailed description on given link.
vaibhav