could not find a non-generic method 'Delete' that has parameters
<p>That's a string returned from .net when using a Gridview control bound to an ObjectDataSource. The ObjectDataSource is bound to a tableAdapter in a .net DataSet.</p>

<p>The dataset has a table adapter that is auto generated and has created an update, insert, select and delete stored proc in my database.</p>

<p>The grid is now using this source and should allow insert, updates and deletes.</p>

<p>Insert and updates are working but the delete specifically gives the error</p>

<p>ObjectDataSource 'odsCustomerAliases' could not find a non-generic method 'Delete' that has parameters: CustomerAlias, original_CustomerAlias. </p>

<p>Whilst I can read the error I have tried a number of things and cannot get this to work. I can't really see how it's expecting a parameter 'original_CustomerAlias'</p>

<p>I can confirm this parameter does not exist in the proc.</p>

<p>Here are some code snippets which seem to be correct.</p>

<pre><code>&lt;asp:ObjectDataSource ID="odsCustomerAliases" runat="server" DeleteMethod="Delete"
                InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
                TypeName="SLRDataAccess.dsTableAdapters.CustomerAliasesTableAdapter" UpdateMethod="Update"&gt;
                &lt;DeleteParameters&gt;
                    &lt;asp:Parameter Name="CustomerAlias" Type="String" /&gt;
                &lt;/DeleteParameters&gt;
                &lt;UpdateParameters&gt;
                    &lt;asp:Parameter Name="original_CustomerAlias" Type="String" /&gt;
                    &lt;asp:Parameter Name="CustomerAlias" Type="String" /&gt;
                &lt;/UpdateParameters&gt;
                &lt;SelectParameters&gt;
                    &lt;asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="Int32" /&gt;
                &lt;/SelectParameters&gt;
                &lt;InsertParameters&gt;
                    &lt;asp:Parameter Name="CustomerAlias" Type="String" /&gt;
                    &lt;asp:Parameter Name="CustomerID" Type="Int32" /&gt;
                &lt;/InsertParameters&gt;
            &lt;/asp:ObjectDataSource&gt;
</code></pre>

<p>The section from the auto generated dataset.</p>

<pre><code>&lt;DeleteCommand&gt;
              &lt;DbCommand CommandType="StoredProcedure" ModifiedByUser="False"&gt;
                &lt;CommandText&gt;dbo.usp_DeleteCustomerAlias&lt;/CommandText&gt;
                &lt;Parameters&gt;
                  &lt;Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current"&gt;
                  &lt;/Parameter&gt;
                  &lt;Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@CustomerAlias" Precision="0" ProviderType="VarChar" Scale="0" Size="100" SourceColumn="CustomerAlias" SourceColumnNullMapping="False" SourceVersion="Current"&gt;
                  &lt;/Parameter&gt;
                &lt;/Parameters&gt;
              &lt;/DbCommand&gt;
            &lt;/DeleteCommand&gt;
</code></pre>

<p>The final code snippet from the designer which I imagine is not actually relevant but...</p>

<pre><code>&lt;Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
     Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"),  _
     Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Delete, true)&gt;  _
    Public Overloads Overridable Function Delete(ByVal CustomerAlias As String) As Integer
        If (CustomerAlias Is Nothing) Then
            Me.Adapter.DeleteCommand.Parameters(1).Value = Global.System.DBNull.Value
        Else
            Me.Adapter.DeleteCommand.Parameters(1).Value = CType(CustomerAlias,String)
        End If
        Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State
        If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open)  _
                    &lt;&gt; Global.System.Data.ConnectionState.Open) Then
            Me.Adapter.DeleteCommand.Connection.Open
        End If
        Try 
            Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery
            Return returnValue
        Finally
            If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then
                Me.Adapter.DeleteCommand.Connection.Close
            End If
        End Try
    End Function
</code></pre>
