About CS1061 error (XX does not contain the definition of XXX, and cannot find the first parameter of type XX ...). ) A possible solution to the scheme __ programming

Source: Internet
Author: User

In my programming, I encountered one such error,

But the product class I'm referencing does define a method that

protected void Bindpagedata (int categoryid)
    {
        Product Product = new product ();
        DataTable dt = product. Getproductbyfenlei (CategoryID);
        if (dt = NULL | | | dt. Rows.Count <= 0) return;

        Set up by sales order
        DataView dv = dt. DefaultView;
        Dv. Sort = "Salenumber DESC";
        Gvproduct.datasource = DV;
        Gvproduct.databind ();
    }

Method code in a class

   public class product
    {public
        product () 
        {
            ///
            TODO: Add constructor logic here
            //
        }
        dbhelp db = new Dbhelp ();
        Public DataTable getproducts ()
        {
            String sql = ' pr_getproducts ';
            return db.getdatatablebysql (SQL);
        Public DataTable getproductbyfenlei (int categoryid)
        {
            String sql = "EXEC pr_getproductbyfenlei  " + CategoryID + "";
            return db.getdatatablebysql (SQL);
        


Search on the internet to solve the cs1061 error, did not solve the problem, in the observation, I in addition to the definition of a Product.cs class, but also defined a Web form with the same name as Product.aspx,

Is there a conflict in the compilation process because it is the same name? I have changed the name of the class below, Ctrl+f5 perfect operation. So everyone in the face of this error is whether to consider whether it is the same name of the problem. In addition, whether or not the right way to refuse, should try more.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.