title: Error Procedure getSearch has no parameters and arguments were supplied
body: <p>I am developing a simple search page that runs off a stored procedure, but I keep getting this error: </p>
  
  <blockquote>
    <p>Procedure getSearch has no parameters and arguments were supplied.</p>
  </blockquote>
  
  <p>This is my stored procedure:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[getSearch] 
  AS
  BEGIN
     Declare @ProjectCode varchar;
  
     SELECT [name],[address],[results]
     FROM [myTb]
     WHERE [name] like '%' + @ProjectCode + '%'
     ORDER BY [name] ASC
  END
  </code></pre>
  
  <p>...this is my code:</p>
  
  <pre><code>protected void Button1_Click(object sender, EventArgs e)
  {
          DataSet ds = new DataSet();
  
          using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["myDbConnectionString1"].ToString()))
          {
              using (SqlCommand command = new SqlCommand())
              {
                  command.CommandType = CommandType.StoredProcedure;
                  command.CommandText = "getSearch";
                  command.Connection = connection;
  
                  command.Parameters.AddWithValue("@ProjectCode", TbProjectCode.Text);
  
                  connection.Open();
                  SqlDataAdapter a = new SqlDataAdapter(command);
                  a.Fill(ds);
              }
          }
  
          gvResults.DataSource = ds;
          gvResults.DataBind();
      } 
  </code></pre>
  
  <p>The design:</p>
  
  <pre><code>&lt;div style="width: 375px; height: 66px"&gt;
      &lt;asp:TextBox ID="TbProjectCode" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Search" /&gt;&lt;br /&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;asp:GridView ID="gvResults" runat="server" Width="718px"&gt;&lt;/asp:GridView&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Could I please get some help as to what the issue is with my stored procedure? I was following an example from a previous post, however, I'm still getting this error. </p>