<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Using the XmlDataSource Data property for easy samples</title><link>http://weblogs.asp.net/bleroy/archive/2006/07/28/Using-the-XmlDataSource-Data-property-for-easy-samples.aspx</link><description>Here&amp;#39;s a little trick to write samples that involves data binding controls to a database. It&amp;#39;s very inconvenient to have to package a sample database with your code (especially when it&amp;#39;s just a few lines of code in a blog), and just making</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Using the XmlDataSource Data property for easy samples</title><link>http://weblogs.asp.net/bleroy/archive/2006/07/28/Using-the-XmlDataSource-Data-property-for-easy-samples.aspx#485158</link><pubDate>Fri, 25 Aug 2006 05:06:25 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:485158</guid><dc:creator>vikram</dc:creator><author>vikram</author><description>This is a good stuff. THis would help me when providing with example to some other people&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=485158" width="1" height="1"&gt;</description></item><item><title>Using the XmlDataSource Data property for easy samples </title><link>http://weblogs.asp.net/bleroy/archive/2006/07/28/Using-the-XmlDataSource-Data-property-for-easy-samples.aspx#461871</link><pubDate>Tue, 01 Aug 2006 10:37:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:461871</guid><dc:creator>ナオキにASP.NET（仮）</dc:creator><author>ナオキにASP.NET（仮）</author><description>&lt;p&gt;More Atlas stuff&amp;amp;amp;nbsp;からです。 &amp;amp;amp;nbsp; Using the XmlDataSource Data property for easy samples &amp;amp;amp;nbsp;...&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=461871" width="1" height="1"&gt;</description></item><item><title>re: Using the XmlDataSource Data property for easy samples</title><link>http://weblogs.asp.net/bleroy/archive/2006/07/28/Using-the-XmlDataSource-Data-property-for-easy-samples.aspx#461396</link><pubDate>Sun, 30 Jul 2006 08:07:39 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:461396</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;Kevin: not sure I understand the question. This is literal contents, so you just set any id attribute you want to each of the records.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=461396" width="1" height="1"&gt;</description></item><item><title>re: Using the XmlDataSource Data property for easy samples</title><link>http://weblogs.asp.net/bleroy/archive/2006/07/28/Using-the-XmlDataSource-Data-property-for-easy-samples.aspx#461378</link><pubDate>Sun, 30 Jul 2006 01:22:17 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:461378</guid><dc:creator>Kevin Nixon</dc:creator><author>Kevin Nixon</author><description>how do i set an id in xml that will increment by one every time i add a new table?
ex
&lt;data id="1"&gt;
  &lt;color&gt;red&lt;color/&gt;
&lt;data/&gt;
&lt;data id="2"&gt;
  &lt;color&gt;blue&lt;color/&gt;
&lt;data&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=461378" width="1" height="1"&gt;</description></item><item><title>re: Using the XmlDataSource Data property for easy samples</title><link>http://weblogs.asp.net/bleroy/archive/2006/07/28/Using-the-XmlDataSource-Data-property-for-easy-samples.aspx#461343</link><pubDate>Sat, 29 Jul 2006 19:56:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:461343</guid><dc:creator>mike</dc:creator><author>mike</author><description>Note that XmlDataSource defaults to assuming that "column values" are represented as attributes rather than child elements; in the latter case, you have to add a transform for it to work. 

Also, inline XML can't be updated, right? So if your sample wants to illustrate update, things are a bit more complex ...
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=461343" width="1" height="1"&gt;</description></item><item><title>re: Using the XmlDataSource Data property for easy samples</title><link>http://weblogs.asp.net/bleroy/archive/2006/07/28/Using-the-XmlDataSource-Data-property-for-easy-samples.aspx#461341</link><pubDate>Sat, 29 Jul 2006 19:06:07 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:461341</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;Kris: you're right. I've simplified the sample and removed these requirements so that one can concentrate on the datasource, which is the really important part. Thanks for the heads up.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=461341" width="1" height="1"&gt;</description></item><item><title>Interesting Finds: July 29, 2006</title><link>http://weblogs.asp.net/bleroy/archive/2006/07/28/Using-the-XmlDataSource-Data-property-for-easy-samples.aspx#461321</link><pubDate>Sat, 29 Jul 2006 15:46:34 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:461321</guid><dc:creator>Jason Haley</dc:creator><author>Jason Haley</author><description>&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=461321" width="1" height="1"&gt;</description></item><item><title>re: Using the XmlDataSource Data property for easy samples</title><link>http://weblogs.asp.net/bleroy/archive/2006/07/28/Using-the-XmlDataSource-Data-property-for-easy-samples.aspx#461307</link><pubDate>Sat, 29 Jul 2006 13:42:39 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:461307</guid><dc:creator>Kris van der Mast</dc:creator><author>Kris van der Mast</author><description>Hi,

great example. But in order to get it to work I had to import the namespace System.ComponentModel and create a Button_Click eventhandler.

The Button_Click event can be easily added by selecting Edit Template on the DataList control and double clicking the button. The namespace can be imported by adding this statement to the top of the page:

&lt;%@ Import Namespace="System.ComponentModel" %&gt;

Grz, Kris.&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=461307" width="1" height="1"&gt;</description></item></channel></rss>