posted on 2012-03-13 21:37 青蛙學堂 阅读(1044) 评论(1) 编辑 收藏 引用 所属分类: 數據庫 、軟件布袋
ArrayList myList = new ArrayList();//创建ArranList while (dr.Read()) { Info myinfo = new Info();//创建类Info的实例 myinfo.Name = dr["Name"].ToString(); myinfo.VoteCount = Int32.Parse(dr["VoteCount"].ToString()); myList.Add(myinfo);//添加Arranlist } dr.Close(); mygridView.DataSource = myList;//arrayList绑定到Gridview mygridView.DataBind(); 回复 更多评论
Powered by: IT博客 Copyright © 青蛙學堂