<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Improved Fast Access to Small Lists On ASPX Pages</title>
	<atom:link href="http://peterkellner.net/2006/10/27/smalllistaccessimproved/feed/" rel="self" type="application/rss+xml" />
	<link>http://peterkellner.net/2006/10/27/smalllistaccessimproved/</link>
	<description>Specializing in Microsoft Web and Database Technologies</description>
	<lastBuildDate>Fri, 30 Jul 2010 08:27:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter Kellner</title>
		<link>http://peterkellner.net/2006/10/27/smalllistaccessimproved/comment-page-1/#comment-5800</link>
		<dc:creator>Peter Kellner</dc:creator>
		<pubDate>Sat, 11 Oct 2008 16:38:20 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2006/10/27/smalllistaccessimproved/#comment-5800</guid>
		<description>I suggest IEnumberable. Here is an example:

protected void Page_Load(object sender, EventArgs e)
    {
        // this happens everytime.  Hopefully, ObjectDataSource will be caching the data for us.
        AddressTypeDictionary = new Dictionary();
        IEnumerable someData = ObjectDataSourceAddressType.Select() as IEnumerable;
        foreach (var stuffData in someData)
        {
            AddressTypeDictionary.Add(stuffData.Id,stuffData.Name);
        }

    }</description>
		<content:encoded><![CDATA[<p>I suggest IEnumberable. Here is an example:</p>
<p>protected void Page_Load(object sender, EventArgs e)<br />
    {<br />
        // this happens everytime.  Hopefully, ObjectDataSource will be caching the data for us.<br />
        AddressTypeDictionary = new Dictionary();<br />
        IEnumerable someData = ObjectDataSourceAddressType.Select() as IEnumerable;<br />
        foreach (var stuffData in someData)<br />
        {<br />
            AddressTypeDictionary.Add(stuffData.Id,stuffData.Name);<br />
        }</p>
<p>    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Administrator</title>
		<link>http://peterkellner.net/2006/10/27/smalllistaccessimproved/comment-page-1/#comment-559</link>
		<dc:creator>Administrator</dc:creator>
		<pubDate>Fri, 28 Sep 2007 13:58:36 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2006/10/27/smalllistaccessimproved/#comment-559</guid>
		<description>Here is the StuffData Class:

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.ComponentModel;
using System.Collections.Generic;

/// &lt;summary&gt;
/// Summary description for Stuff
/// &lt;/summary&gt;
///
[DataObject]
public class Stuff
{

	public Stuff()
	{

	}

    [DataObjectMethod(DataObjectMethodType.Select,true)]
    public List&lt;stuffdata&gt; GetStuff()
    {
        List&lt;/stuffdata&gt;&lt;stuffdata&gt; li = new List&lt;/stuffdata&gt;&lt;stuffdata&gt;();
        li.Add(new StuffData(1,&quot;peter&quot;,&quot;3443 Yuba Ave&quot;));
        li.Add(new StuffData(1,&quot;tammy&quot;,&quot;3443 Yuba Ave&quot;));
        li.Add(new StuffData(1,&quot;roger&quot;,&quot;3443 Yuba Ave&quot;));
        return li;


    }

}

public class StuffData
{
    public StuffData(int id, string name, string address)
    {
        this.id = id;
        this.name = name;
        this.address = address;
    }

    private int id;

    public int Id
    {
        get { return id; }
        set { id = value; }
    }

    private string name;

    public string Name
    {
        get { return name; }
        set { name = value; }
    }

    private string address;

    public string Address
    {
        get { return address; }
        set { address = value; }
    }

}

-Peter Kellner&lt;/stuffdata&gt;</description>
		<content:encoded><![CDATA[<p>Here is the StuffData Class:</p>
<p>using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using System.ComponentModel;<br />
using System.Collections.Generic;</p>
<p>/// <summary><br />
/// Summary description for Stuff<br />
/// </summary><br />
///<br />
[DataObject]<br />
public class Stuff<br />
{</p>
<p>	public Stuff()<br />
	{</p>
<p>	}</p>
<p>    [DataObjectMethod(DataObjectMethodType.Select,true)]<br />
    public List<stuffdata> GetStuff()<br />
    {<br />
        List</stuffdata><stuffdata> li = new List</stuffdata><stuffdata>();<br />
        li.Add(new StuffData(1,&#8221;peter&#8221;,&#8221;3443 Yuba Ave&#8221;));<br />
        li.Add(new StuffData(1,&#8221;tammy&#8221;,&#8221;3443 Yuba Ave&#8221;));<br />
        li.Add(new StuffData(1,&#8221;roger&#8221;,&#8221;3443 Yuba Ave&#8221;));<br />
        return li;</p>
<p>    }</p>
<p>}</p>
<p>public class StuffData<br />
{<br />
    public StuffData(int id, string name, string address)<br />
    {<br />
        this.id = id;<br />
        this.name = name;<br />
        this.address = address;<br />
    }</p>
<p>    private int id;</p>
<p>    public int Id<br />
    {<br />
        get { return id; }<br />
        set { id = value; }<br />
    }</p>
<p>    private string name;</p>
<p>    public string Name<br />
    {<br />
        get { return name; }<br />
        set { name = value; }<br />
    }</p>
<p>    private string address;</p>
<p>    public string Address<br />
    {<br />
        get { return address; }<br />
        set { address = value; }<br />
    }</p>
<p>}</p>
<p>-Peter Kellner</stuffdata></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Katina Simpson</title>
		<link>http://peterkellner.net/2006/10/27/smalllistaccessimproved/comment-page-1/#comment-558</link>
		<dc:creator>Katina Simpson</dc:creator>
		<pubDate>Fri, 28 Sep 2007 06:45:18 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2006/10/27/smalllistaccessimproved/#comment-558</guid>
		<description>where is StuffData defined?</description>
		<content:encoded><![CDATA[<p>where is StuffData defined?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luis Santos</title>
		<link>http://peterkellner.net/2006/10/27/smalllistaccessimproved/comment-page-1/#comment-556</link>
		<dc:creator>Luis Santos</dc:creator>
		<pubDate>Fri, 02 Feb 2007 11:25:39 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2006/10/27/smalllistaccessimproved/#comment-556</guid>
		<description>... I should clarify that by state I mean country state in this case (NSW) New South Wales, (QLD) Queensland, etc.

Thank you
Luis Santos</description>
		<content:encoded><![CDATA[<p>&#8230; I should clarify that by state I mean country state in this case (NSW) New South Wales, (QLD) Queensland, etc.</p>
<p>Thank you<br />
Luis Santos</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luis Santos</title>
		<link>http://peterkellner.net/2006/10/27/smalllistaccessimproved/comment-page-1/#comment-555</link>
		<dc:creator>Luis Santos</dc:creator>
		<pubDate>Fri, 02 Feb 2007 11:11:12 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2006/10/27/smalllistaccessimproved/#comment-555</guid>
		<description>Hello Peter,

Luis (newbie) here.

I&#039;m trying to follow your explanation on how to store and load a Dictionary into a web control. In my case I want to populate a drop down template field to maintain the state. When the update page is loaded the drop down is positioned according to the value in the database and user can select another state which will then populate the &quot;updated&quot; state code back to the table... In your example I just don&#039;t understand what is / where StuffData is coming from.

It may all be due to the fact that I cannot find information on what is or how to use IEnumerable

Your feedback will be much appreciated.

Luis</description>
		<content:encoded><![CDATA[<p>Hello Peter,</p>
<p>Luis (newbie) here.</p>
<p>I&#8217;m trying to follow your explanation on how to store and load a Dictionary into a web control. In my case I want to populate a drop down template field to maintain the state. When the update page is loaded the drop down is positioned according to the value in the database and user can select another state which will then populate the &#8220;updated&#8221; state code back to the table&#8230; In your example I just don&#8217;t understand what is / where StuffData is coming from.</p>
<p>It may all be due to the fact that I cannot find information on what is or how to use IEnumerable</p>
<p>Your feedback will be much appreciated.</p>
<p>Luis</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 7/22 queries in 0.014 seconds using disk
Content Delivery Network via cdn.peterkellner.net

Served from: peterkellner.net @ 2010-07-30 09:36:28 -->