title: InvalidOperationException: ObjectDataSource could not find a non-generic method that has parameters:
body: <p>I'm trying to code an <a href="http://msdn.microsoft.com/en-US/library/system.web.ui.webcontrols.objectdatasource.aspx" rel="nofollow">ObjectDataSource</a> for a local ASP.NET page.</p>
  
  <p>Reading the Help files on MSDN always leave me scratching my head, wondering what exactly they might be implying. For example, I am not sure what my <a href="http://msdn.microsoft.com/en-US/library/system.web.ui.webcontrols.objectdatasource.typename.aspx" rel="nofollow">TypeName</a> should be (though that link has an interesting example).</p>
  
  <p>Once I get the basics to work, I will venture into deeper waters.</p>
  
  <p>The first line of my *.aspx file contains my definitions:</p>
  
  <pre><code>&lt;%@ Page Title="Reporter" Language="C#" MasterPageFile="~/local.Master"
      AutoEventWireup="true" CodeBehind="Reporter.aspx.cs"
      Inherits="AcpServiceNS.Reporter" %&gt;
  </code></pre>
  
  <p>In this page, I have TextBox controls named <code>txtStartDate</code> and <code>txtEndDate</code> and a number of DropDownList controls named <code>ddlStartTime</code>, <code>ddlEndTime</code>, <code>ddlAction</code>, <code>ddlFilter1</code>, and <code>ddlFilter2</code>.</p>
  
  <p>I also have the following <a href="http://msdn.microsoft.com/en-US/library/system.web.ui.webcontrols.objectdatasource.aspx" rel="nofollow">ObjectDataSource</a>:</p>
  
  <pre><code>&lt;asp:ObjectDataSource ID="dsReport" runat="server"
       SelectMethod="GetData"
       TypeName="System.Data.DataTable"
       ConvertNullToDBNull="True" &gt;
    &lt;SelectParameters&gt;
      &lt;asp:ControlParameter ControlID="txtStartDate" Name="startDate" PropertyName="Text" Type="String" DefaultValue="" /&gt;
      &lt;asp:ControlParameter ControlID="ddlStartTime" Name="startTime" PropertyName="Text" Type="String" DefaultValue="" /&gt;
      &lt;asp:ControlParameter ControlID="txtEndDate" Name="endDate" PropertyName="Text" Type="String" DefaultValue="" /&gt;
      &lt;asp:ControlParameter ControlID="ddlEndTime" Name="endTime" PropertyName="Text" Type="String" DefaultValue="" /&gt;
      &lt;asp:ControlParameter ControlID="ddlAction" Name="action1" PropertyName="Text" Type="String" DefaultValue="" /&gt;
      &lt;asp:ControlParameter ControlID="ddlFilter1" Name="filter1" PropertyName="Text" Type="String" DefaultValue="" /&gt;
      &lt;asp:ControlParameter ControlID="ddlFilter2" Name="filter2" PropertyName="Text" Type="String" DefaultValue="" /&gt;
    &lt;/SelectParameters&gt;
  &lt;/asp:ObjectDataSource&gt;
  </code></pre>
  
  <p>A <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx" rel="nofollow">GridView</a> control is going to be on the *.aspx page, and will be used to display the data:</p>
  
  <pre><code>&lt;asp:GridView ID="gvReport" AllowSorting="true" AutoGenerateColumns="false" AllowPaging="true" Font-Size="Small" PageSize="30" Width="100%"
    OnRowDataBound="Report_RowDataBound"
    OnRowCommand="Report_RowCommand"
    DataKeyNames="Op_ID,Serial_Number,Date_Time,Test_Result"
    DataSourceID="dsReport"
    runat="server"&gt;
    &lt;Columns&gt;
      &lt;asp:TemplateField HeaderText="Op_ID" HeaderStyle-Width="20%"&gt;
        &lt;ItemTemplate&gt;
          &lt;asp:LinkButton ID="lbOp_ID" runat="server" CommandArgument='&lt;%# Container.DataItemIndex %&gt;' CommandName="Op_ID" /&gt;
        &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
      &lt;asp:TemplateField HeaderText="Serial_Number" HeaderStyle-Width="20%"&gt;
        &lt;ItemTemplate&gt;
          &lt;asp:LinkButton ID="lbSerial_Number" runat="server" CommandArgument='&lt;%# Container.DataItemIndex %&gt;' CommandName="Serial_Number" /&gt;
        &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
      &lt;asp:BoundField DataField="Date_Time" HeaderText="Date_Time" SortExpression="Date_Time" HeaderStyle-Width="20%" /&gt;
      &lt;asp:BoundField DataField="Test_Result" HeaderText="Test_Result" SortExpression="Test_Result" HeaderStyle-Width="40%" /&gt;
    &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>To get this to load an empty dataset, I have created this simple stub in my codebehind:</p>
  
  <pre><code>namespace AcpServiceNS {
  
    public partial class Reporter : System.Web.UI.Page {
  
      protected void Page_Load(object sender, EventArgs e) {
      }
  
      [DataObjectMethod(DataObjectMethodType.Select)]
      protected static DataTable GetData(string startDate, string startTime, string endDate, string endTime,
        string action1, string filter1, string filter2) {
        var table = new DataTable();
        table.Columns.Add("Op_ID", typeof(string));
        table.Columns.Add("Serial_Number", typeof(string));
        table.Columns.Add("Date_Time", typeof(DateTime));
        table.Columns.Add("Test_Result", typeof(string));
        return table;
      }
  
    }
  
  }
  </code></pre>
  
  <p>Yes! All that is above is basically a Table Definition, but it should be enough to start my *.aspx page.</p>
  
  <p>When I try to run this, I get the following Exception:</p>
  
  <blockquote>
    <p>System.InvalidOperationException: ObjectDataSource 'dsReport' could not find a non-generic method 'GetData' that has parameters: startDate, startTime, endDate, endTime, action1, filter1, filter2.</p>
  </blockquote>
  
  <p>It appears that I have spelled and cased all of the parameters correctly, so what have I done wrong? Is <a href="http://msdn.microsoft.com/en-US/library/system.web.ui.webcontrols.objectdatasource.typename.aspx" rel="nofollow">TypeName</a> used incorrectly?</p>