none
"No overload for method 'Add' takes 2 arguments

    Question

  • Getting "No overload for method 'Add' takes 2 arguments

     

    using System;
    using System.Data;
    using System.Configuration;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;

    namespace WebApplication3
    {
        public class Class2
        {
            int price;
            int quantity;
            public Class2(int p, int q)
            {
                price = p;
                quantity = q;
            }
        }
    }

    +++++++++++++++++++

    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using System.Collections.Generic;
    using container2;

    namespace WebApplication3
    {
        public partial class _Default : System.Web.UI.Page
        {
           static int i = 0;
           private static List<Class2> L = new List<Class2>();
           protected void Page_Load(object sender, EventArgs e)
            {

            }

                protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
                {

                }

                protected void Button1_Click(object sender, EventArgs e)
                {
                   *** L.Add(10, 2);
                   *** L.Add(20, 3);
                    GridView1.DataSource = L;
                    GridView1.DataBind();
     
                }


            }
        }

     

    Thursday, December 01, 2011 4:21 PM

Answers

All replies