悬赏园豆:10
[已解决问题]
解决于 2007-12-28 11:10
<P> <FONT color=#0000ff> //public IList<CategoryInfo> GetCategories()</FONT> //原文<BR> <FONT color=#ff0000> public Collection<CategoryInfo> GetCategories()//更改后<BR></FONT> {<BR> <FONT color=#0000ff>//IList<CategoryInfo> categories = new <FONT color=#000000>//原文</FONT><BR>List<CategoryInfo>();</FONT><BR> <FONT color=#ff0000> Collection<CategoryInfo> categories = new Collection<CategoryInfo>();</FONT> <FONT color=#ff0000>//更改后</FONT><BR> using(SqlDataReader rdr = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SQL_SELECT_CATEGORIES, null)) <BR> {<BR> while (rdr.Read()) <BR> {<BR> CategoryInfo cat = new CategoryInfo(rdr.GetString(0), rdr.GetString(1), rdr.GetString(2));<BR> categories.Add(cat);<BR> }<BR> } <BR> return categories;<BR> }<BR>我更改后可以正常运行,我想问下IList与Collection的区别,集合与数组的关系</P>
<P>【petshop】IList与Collection的区别,集合与数组的关系<BR>我看书后的理解:集合更好控制,安全,数组安全性差</P>
<P>还有些知识有些模糊,望大家帮我指正,谢谢</P>
问题补充:
集合与数组分别用在哪些地方
伊牛娃
|
菜鸟二级
|
园豆:
207
提问于:2007-12-26 18:24