ds = OUTPUT.DataSet.Copy();

            string strValue = string.Empty;
            string strText = string.Empty;

            SortedList sl = new SortedList();

            int iTBRowsCount = ds.Tables[0].Rows.Count;

            for (int i = 0; i < iTBRowsCount; i++)
            {
                strValue = ds.Tables[0].Rows[i]["YEAR"].ToString() + ds.Tables[0].Rows[i]["MONTH"].ToString().PadLeft(2, '0');
                strText = string.Format("- {0}년 {1}월호 -", ds.Tables[0].Rows[i]["YEAR"].ToString(), ds.Tables[0].Rows[i]["MONTH"].ToString().PadLeft(2, '0'));

                sl.Add(strValue.ToString(), strText.ToString());
            }

            for (int i = 0; i < iTBRowsCount; i++)
            {
                AKLDrop_Month.Items.Insert(i, new ListItem(sl.GetByIndex(iTBRowsCount - i - 1).ToString(), sl.GetKey(iTBRowsCount - i - 1).ToString()));
            }

            // 선택한 값을 설정해준다.
            AKLDrop_Month.SelectedValue = sYear + sMonth;

Posted by 사나에