Link to home
Start Free TrialLog in
Avatar of SirReadAlot
SirReadAlot

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SirReadAlot
SirReadAlot

ASKER

will try the 1) option
thanks bob