I'm using the AutoGenerateEditButton feature for a gridview and cannot get my update command to work. I have DataKeyNames="ID" set on my gridview. The delete command works fine. If I hard code an ID (example: WHERE [ID] = 4), the update command works fine. It just doesn't seem to be recognizing the parameter @ID. I'm using an Access database and ID is an autonumber field. I've tried changing the paramter "type" from int32 to string. I've tried setting OldValuesParameterFormatSt
ring="{0}"
and ="original_{0}" . I don't have any code in my code behind file. Thanks for your help.
Code snippet:
UpdateCommand="Update [Name] Set [EmpName] = @EmpName WHERE [ID] = @ID "
DeleteCommand="Delete * FROM Name WHERE [id]= @ID"
<UpdateParameters>
<asp:Parameter Name="ID" Type=int32 />
<asp:Parameter Name="EmpName" Type="String" />
</UpdateParameters>
Start Free Trial