title: Delete gridview row when datasource is the result from a join statement
body: <p>Since the datasource in question is the result of a join statement I have to specify the delete command. I tried to do the following but it's not working.</p>
  
  <pre><code>&lt;asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}" DeleteMethod="GridView1_RowDeleting" SelectMethod="GetSubjectPrerequisites" TypeName="EnrolSystemCore.SubjectPrerequisitesDSTableAdapters.subjectsTableAdapter"&gt;
          &lt;SelectParameters&gt;
              &lt;asp:QueryStringParameter DefaultValue="32113" Name="subjectid" QueryStringField="subjectid" Type="Int32" /&gt;
          &lt;/SelectParameters&gt;
      &lt;/asp:ObjectDataSource&gt;
      &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="sj_id" DataSourceID="ObjectDataSource1" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" AllowSorting="True"&gt;
          &lt;Columns&gt;
              &lt;asp:BoundField DataField="sj_id" HeaderText="sj_id" ReadOnly="True" SortExpression="sj_id" /&gt;
              &lt;asp:BoundField DataField="sj_name" HeaderText="sj_name" SortExpression="sj_name" /&gt;
              &lt;asp:ButtonField ButtonType="Button" CommandName="Delete" HeaderText="Delete" ShowHeader="True" Text="Delete" /&gt;
          &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>and created within the .cs file the following method to delete a row:</p>
  
  <pre><code>    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
      {
  
          int subjectID = Convert.ToInt32(Request.QueryString["subjectID"]);
          GridViewRow row = GridView1.SelectedRow;
          int prerequisite1 = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values[0].ToString());
  
          try
          {
              SubjectPrerequisites subjectPrerequisite1 = new SubjectPrerequisites();
              subjectPrerequisite1.removePreRequisite(subjectID, prerequisite1);
          }
          catch (Exception)
          {
  
          }
      }
  </code></pre>
  
  <p>But whenever i try to delete a row it gives me the following error:</p>
  
  <p><strong>ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'GridView1_RowDeleting' that has parameters: original_sj_id.</strong></p>
  
  <p>How should I solve this? I researched on existing solutions but they perform the delete procedure within the aspx page which i don't want. </p>