?
Solved

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

Posted on 2006-07-03
3
Medium Priority
?
589 Views
Last Modified: 2012-05-05
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
Comment
Question by:SirReadAlot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 17030791
1) An empty string ""
2) Overload the method calls to define 2 methods both with and without ID argument

Bob
0
 

Author Comment

by:SirReadAlot
ID: 17030813
will try the 1) option
0
 

Author Comment

by:SirReadAlot
ID: 17030822
thanks bob
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month13 days, 5 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question