ShuiYinDeng 0 Newbie Poster
public List<Data.ListBoxData> Size()
        {
            List<Data.ListBoxData> result;
            Data.ListBoxData data;
            result = new List<Data.ListBoxData>();
            var query = from a in base.MyEntities.style_sz select new { a.id, a.size };

            foreach (var itm in query)
            {
                data = new Data.ListBoxData();
                data.DisplayText = itm.size.ToString();
                data.ValueText = itm.size.ToString();

                ArrayList list1 = new ArrayList(itm.size.Split(','));
                
                foreach (string i in list1)
                {
                    string tempo = i;
                    data.DisplayText = tempo;
                    data.ValueText = tempo;
                    result.Add(data);  
                }
                
            }
            return result;

my problem when i bind to dropdownlist
the result is 3,3,3,6,6,6,9,9,9
the result should is is 1,2,3,4,5,6,,7,8,9
here i using the split.
any one can help me or give me solution

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.