示例#1
0
    private void FillDropDownList()
    {
        SupplierTransaction vnd    = new SupplierTransaction();
        CategoryTransaction subCat = new CategoryTransaction();

        DataSet   dsVendors       = vnd.GetAllVendors(connstring);
        DataTable dsSubCategories = subCat.GetAllCategories(connstring);

        ddlCompanies.DataSource     = dsVendors.Tables[0];
        ddlCompanies.DataTextField  = "VendorName";
        ddlCompanies.DataValueField = "VendorID";
        ddlCompanies.DataBind();
        ddlCompanies.Items.Insert(0, new ListItem("[Company]", "0"));

        ddlSubCat.DataSource = dsSubCategories;
        //ddlSubCat.DataTextField = "SubCategoryName";
        //ddlSubCat.DataValueField = "SubCategoryId";
        ddlSubCat.DataTextField  = "CategoryName";
        ddlSubCat.DataValueField = "CategoryId";
        ddlSubCat.DataBind();
        ddlSubCat.Items.Insert(0, new ListItem("[Sub-category]", "9999"));
    }
示例#2
0
    private void DisplaySuppliers()
    {
        SupplierTransaction s = new SupplierTransaction();

        s.GetAllVendors(connstring);
    }