Santosh Kumar

Santosh Kumar

  • NA
  • 561
  • 2.6m

no overload for method takes '1' arguments

Oct 24 2013 12:51 PM
Hi all! 
I have a problem, I am using this code in a software and I am getting a error in GetData(cmd).
I have done it another way but I want to know what's really problem, can anybody help me?

string dbconnection = ConfigurationManager.ConnectionStrings["ConString"].ConnectionString;
    
    private void BindData()
    {
        SqlConnection con = new SqlConnection(dbconnection);
        string strQuery = "select CustomerID,ContactName,CompanyName " + " from customers";
        SqlCommand cmd = new SqlCommand(strQuery);
        GridView1.DataSource = GetData(cmd);
// => getting eror (no overload for method 'GetData' takes '1' arguments)

        GridView1.DataBind();
    }

    private void GetData()
    {
        GridView1.DataBind();
    }


Thanks

Answers (2)