<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.bytemycode.com/rssformat.xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>byteMyCode: Snippets for controls</title>
		<link>http://www.bytemycode.com</link>
		<description>Snippets for this tag.</description>
		<pubDate>Wed, 15 Oct 2008 21:46:21 +0000</pubDate>
		<copyright>1998-2008 </copyright>
		<language>en-us</language>
		<image>
		      <link>http://www.bytemycode.com</link>
		      <url>http://www.bytemycode.com/img/rss_title.gif</url>
		      <title>byteMyCode</title>
		</image>

	<item>
	<title>Bind 2 or More Windows Controls To One Datasource</title>
	<link>http://www.bytemycode.com/snippets/snippet/346/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/346/comments/</comments>
	<pubDate>Tue, 05 Sep 2006 20:27:21 +0000</pubDate>
	<dc:creator>MovingParts</dc:creator>
	<category>Bind, Control, controls, datasource, same, two</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/346/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Tue. Sep. 5th, 2006  8:27 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/346/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_beginner.gif" align="middle" class="icon" alt="Beginner" /> <a href="http://www.bytemycode.com/members/member/MovingParts/" title="Beginner">MovingParts</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/Bind">Bind</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Control">Control</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/controls">controls</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/datasource">datasource</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/same">same</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/two">two</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/346/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>so you executed a query that took .5 second to execute and you want to bind that to a windows control. next you decide that you will need to have two controls bound to the same datasource. not a problem, except when you do this:<br />control1.datasource = datatable<br />control2.datasource = datatable<br /><br />you notice that each control mirrors the other and you cannot pick two seperate and distinct values.<br /><br />one way to solve this is to create two datatables and execute the query twice. unfortunately this now doubles your query time. bad idea.<br /><br />here is the elegant solution...</p>
		]]>
	</description>
</item>
	</channel>
</rss>