• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 604
  • Last Modified:

No overload for method 'BindGrid' takes '0' arguments

hi experts,

I created a bindGrid() like this  
private void BindGrid(string Id)================> I passed it a string id
            {

                  string ConnectionString = ConfigurationSettings.AppSettings["connectLocal"];
                  SqlConnection  myConnection = new SqlConnection(ConnectionString);

                  SqlCommand myCommand = new SqlCommand("sp_DestinationElements", myConnection);
                  myCommand.CommandType = CommandType.StoredProcedure;
                  SqlParameter param = new SqlParameter( "@employerId", SqlDbType.VarChar, 50);
                  
                  param.Value = Id;
                  myCommand.Parameters.Add(param);

                  try
                  {
                        myConnection.Open();
                        dgCompensation.DataSource = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
                        dgCompensation.DataBind();
                  }
                  catch
                        (SqlException Sqlexc)
                  {
                        lblStatus.Text = "Error while Generating Data. Error is " + Sqlexc.ToString();
                  }
            }
            #endregion


When It comes to creating the edit control
      public void dgCompensation_Edit (object sender, DataGridCommandEventArgs e)
            {
                  dgCompensation.EditItemIndex = e.Item.ItemIndex;
                  BindGrid();      
            }

What can i pass here BindGrid() apart from BindGrid(null);

THANKS AGAIN GUYS
0
SirReadAlot
Asked:
SirReadAlot
  • 2
1 Solution
 
Bob LearnedCommented:
1) An empty string ""
2) Overload the method calls to define 2 methods both with and without ID argument

Bob
0
 
SirReadAlotAuthor Commented:
will try the 1) option
0
 
SirReadAlotAuthor Commented:
thanks bob
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now