예제 #1
0
        private void GetCategory()
        {
            Shopping shopping = new Shopping();

            ddlCategory.DataSource = null;
            ddlCategory.DataSource = shopping.GetCategorie();
            ddlCategory.DataBind();
        }
예제 #2
0
        private void GetCategories()
        {
            Shopping  shopping = new Shopping();
            DataTable dt       = shopping.GetCategorie();

            if (dt.Rows.Count > 0)
            {
                DDLCategory.DataValueField = "CategoryID";
                DDLCategory.DataTextField  = "CategoryName";
                DDLCategory.DataSource     = dt;
                DDLCategory.DataBind();
            }
        }