PDA

View Full Version : Resolved Datagrid delete button in asp net


Zpixel
09-01-2009, 03:44 PM
after adding a delete button to a datagrid in a asp net website, i want to know how to enable deleting a record of database table using this button. this is the error message after clicking that button:

Deleting is not supported by data source 'SqlDataSource1' unless DeleteCommand is specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: Deleting is not supported by data source 'SqlDataSource1' unless DeleteCommand is specified.

--------------

how can i specify delete command? is this a good way to delete a database record? what do you usually do? i prefer old style tables and links. like what i do in php.

Zpixel
09-02-2009, 01:21 PM
I found my answer here.

http://codingforums.com/showthread.php?t=91354

3 things are needed. 1) delete command 2) DataKeyNames 3) DeleteParameters