不要用循环,谢谢。list1.AddRange()??谁知道,谢谢!

解决方案 »

  1.   

    假设DataSet的Table[0]有两列Text和Value
    this.ListBox1.DataSource = ds.Tables[0].DefaultView;
            this.ListBox1.DataTextField = "Text";
            this.ListBox1.DataValueField = "Value";
            this.ListBox1.DataBind();
      

  2.   

    哥们,我说的是LIST不是LISTBOXDA层用不了LISTBOX的
      

  3.   

    你的这个list到底是什么类型的?
    是像ListBox,ListView那样的控件,还是一种数据类型?
      

  4.   

    list是类型,谢谢。属于System.Collections.Generic空间
      

  5.   

    dataset好像没有默认的copy到string数组的函数
    你又要不用循环所以只好先把datarow赋值到list
    取的时候用datarow对象取        DataSet ds = new DataSet();
            DataRow[] datarows = ds.Tables[0].Select();
            ICollection collection = (ICollection)datarows;
            ArrayList al = new ArrayList();
            al.AddRange(collection);        Response.Write(((DataRow)al[0])[0].ToString());