用 dataset 或者 arraylist 好像可以?

解决方案 »

  1.   

    举个例子如下:class Person
    {
        private String _Name, Nickname,_Initials;    public Person(String name, String nickname, String initials)
        {
            this._Name     = name;
            this._Nickname = nickname;
            this._Initials = initials;
        }    public String Name     { get { return _Name;     } }
        public String Nickname { get { return _Nickname; } }
        public String Initials { get { return _Initials; } }
    }Person[] customers = new Person[3] {
        new Person("George Washington",  "George", "GW"), 
        new Person("Abraham Lincoln",    "Abe",    "AL"),
        new Person("Theodore Roosevelt", "Teddy",  "TR")
    };private void Page_Load(object sender, System.EventArgs e)
    {
        if(!IsPostBack)
        {
            // bind the array to the list
            List1.DataSource    = customers;
            List1.DataTextField = "Name";
            List1.DataBind();
        }
    }您可以在以下MSDN网页找到更多信息:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mwsdk/html/mwlrfListClass.asp希望对您有所帮助。- 微软全球技术中心本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款
    (http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)