Usually, the way I approach this with a web application is to construct a SQL call to my database with the details needed for the delete. You can store a key field in the datagrid when you bind it. This way, when the user choose and row and clicks the delete button, you retrieve the key value from the datagrid (datagrid.DataKeys[rowindex]) and use that in your delete SQL statement. Then you execute the delete statement and requery the data to display in the grid. This is how most of the examples and demos I have found work as well. Do some searching for some ASP.NET database tutorials and you should be able to find all of these details with example code.
|