예제 #1
0
        private void Setuppage()
        {
            CarCollection carlst = new CarCollection();
            CarDao cardao = new CarDao();
            carlst = cardao.Load();

            //ComboBox1.DataTextField = "Name";

            for (int i = 0; i < 500; i++)
            {

                foreach (Car item in carlst)
                {

                    lstCars.Items.Add(new ListItem(item.Name, item.CarId));
                    //ComboBox1.Items.Add(new ListItem(item.Name, item.CarId));
                }
            }

            //ObjectDataSource ods = new ObjectDataSource("CarDao", "Load");

            //ComboBox1.DataTextField = "Name";
            //ComboBox1.DataValueField = "CarId";
            //ComboBox1.DataSource = this.carcollection;

            this.carcollection = carlst;
        }
예제 #2
0
        private void Setup()
        {
            CarDao cardao = new CarDao();
            CarCollection carlst = cardao.Load();

            this.grdCars.DataSource = carlst;
            this.grdCars.DataBind();
        }