Esempio n. 1
0
        public ComboBox GetTerNameCmb(ComboBox cmb)
        {
            DataSet ds = areadal.GetTerNameDataSet();

            if (ds.Tables != null && ds.Tables.Count > 0)
            {
                cmb.DataSource = null;
                DataRow dr = ds.Tables[0].NewRow();
                dr[0] = 0;
                dr[1] = "所有";
                ds.Tables[0].Rows.InsertAt(dr, 0);
                cmb.DataSource    = ds.Tables[0];
                cmb.DisplayMember = "TerritorialName";
                cmb.ValueMember   = "TerritorialID";
            }
            return(cmb);
        }