title: Delete parameters in SqlDatasource in asp.net
body: <p>I have a <code>Gridview</code> which is connected with <code>SqlDataSource</code> for Data.<br>
  I have <code>Edit</code> and <code>Delete</code> built in functionality. I have passed the <code>Stored Procedure</code> for the <code>SelectCommand</code>. </p>
  
  <p>Now I want to delete record and simultaneously update another table, now I do not get how to pass the values for the delete parameters in <code>DeleteCommand</code></p>
  
  <p>I also added <code>DataKeyNames</code> wherein I have provided the field (which is <code>Primary Key and Auto Increment</code>), but that too does not works.
  While deleting it simply says, <code>Deleting is Supported, because no DeleteCommand is Specified</code>.</p>
  
  <p>I also tried creating a <code>StoredProcedure</code> for the delete task, but my StoredProcedure need to have some parameters so that I can update the records in another table.</p>
  
  <p>Can anyone tell how could I pass the value for the Delete parameter.</p>
  
  <p><strong>UPDATED with SqlDataSource Markup</strong></p>
  
  <pre><code>&lt;asp:SqlDataSource ID="StudAllotmentDataSource" runat="server" 
      ConnectionString="&lt;%$ ConnectionStrings:SiteSqlServer %&gt;" 
      SelectCommand="user_GetStudAllotment" SelectCommandType="StoredProcedure" DeleteCommand="user_DeleteAllottedStudBook" DeleteCommandType="StoredProcedure"&gt;
     &lt;DeleteParameters&gt;
          &lt;asp:Parameter Name="BookCode" Type="String" /&gt; 
          &lt;asp:Parameter Name="Quantity" Type="String" /&gt; 
      &lt;/DeleteParameters&gt;
  &lt;/asp:SqlDataSource&gt;
  </code></pre>