title: Gridview Delete Button in ASP.NET
body: <p>I just asked a question about this subject; <a href="https://stackoverflow.com/q/4955759/447156">All Row has a Delete Button in Gridview</a></p>
  
  <p>I have a simple table <code>AVUKAT</code></p>
  
  <p>Columns --> <code>HESAP</code>, <code>MUSTERI</code>, <code>AVUKAT</code></p>
  
  <p>And I show the data in a Gridview.</p>
  
  <p>I activate <code>AutoGenerateDeleteButton</code>.</p>
  
  <p><img src="https://i.stack.imgur.com/u4U4G.jpg" alt="enter image description here"></p>
  
  <p>But when I click the Delete button for a row, I am getting an error like this.</p>
  
  <pre><code>Server Error in '/' Application.
  Deleting is not supported by data source 'GridviewDataSource' 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 'GridviewDataSource' unless DeleteCommand is specified.
  
  Source Error:
  
  An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
  </code></pre>
  
  <p>Which Function is activated when I click the delete button?</p>
  
  <p>What should be the code of this function?</p>