Click here to Skip to main content
15,905,558 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have used stored procedure to delete the value in Gridview_RowDeleting event.

Record is deleted from DB. but I am getting this error.

Deleting is not supported by data source 'SqlDataSource1' unless DeleteCommand is specified.



how to resolve this?
Posted

As the error states, you haven't defined a command for delete. Try defining: SqlDataSource.DeleteCommand Property [^]
 
Share this answer
 
Comments
palraj001 14-Dec-11 2:46am    
actually i used SP for deleting the record. i have written delete query in SP. without using this delete command, Cant we delete it?
Wendelius 14-Dec-11 2:52am    
From MSDN: The DeleteCommand represents an SQL query or the name of a stored procedure, and is used by the Delete method

So you can use the stored procedure. Just define it (and it's parameters) in the DeleteCommand property
please change CommandName="delete" to CommandName="mydelete"
i sure solve your problem
 
Share this answer
 

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