<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Joshan's Weblog &#187; Uncategorized</title>
	<atom:link href="http://joshan.wordpress.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://joshan.wordpress.com</link>
	<description>LifeStyle</description>
	<lastBuildDate>Tue, 24 Mar 2009 19:07:21 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='joshan.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/b83c247e88eeead350db9042620f65f5?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Joshan's Weblog &#187; Uncategorized</title>
		<link>http://joshan.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://joshan.wordpress.com/osd.xml" title="Joshan&#8217;s Weblog" />
		<item>
		<title>Retrieving Unique Values from a DataTable in .NET</title>
		<link>http://joshan.wordpress.com/2009/03/25/retrieving-unique-values-from-a-datatable-in-net/</link>
		<comments>http://joshan.wordpress.com/2009/03/25/retrieving-unique-values-from-a-datatable-in-net/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 19:07:21 +0000</pubDate>
		<dc:creator>joshan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://joshan.wordpress.com/?p=54</guid>
		<description><![CDATA[The easiest way to return a new table that has only the unique values from the original table is as follows:
DataTable distinctTable = originalTable.DefaultView.ToTable(true, &#8220;FieldName&#8221;);
Thus &#8220;distinctTable&#8221; will contain unique values!!!   Have fun!

       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=joshan.wordpress.com&blog=1893587&post=54&subd=joshan&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The easiest way to return a new table that has only the unique values from the original table is as follows:</p>
<p><span style="color:#2b91af;font-size:x-small;">DataTable</span><span style="font-size:x-small;"> distinctTable = originalTable.DefaultView.ToTable(</span><span style="color:#0000ff;font-size:x-small;">true, &#8220;FieldName&#8221;</span><span style="font-size:x-small;">);</span><br />
<span style="font-size:x-small;">Thus &#8220;distinctTable&#8221; will contain unique values!!! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Have fun!<br />
</span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/joshan.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/joshan.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/joshan.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/joshan.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/joshan.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/joshan.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/joshan.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/joshan.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/joshan.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/joshan.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=joshan.wordpress.com&blog=1893587&post=54&subd=joshan&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://joshan.wordpress.com/2009/03/25/retrieving-unique-values-from-a-datatable-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4bcdace9bf81a5588713d6e01c774ab6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Josh</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Variables in T-SQL Statements that accept only constant values</title>
		<link>http://joshan.wordpress.com/2008/12/31/using-variables-in-t-sql-statements-that-accept-only-constant-values/</link>
		<comments>http://joshan.wordpress.com/2008/12/31/using-variables-in-t-sql-statements-that-accept-only-constant-values/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 05:35:45 +0000</pubDate>
		<dc:creator>joshan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://joshan.wordpress.com/?p=47</guid>
		<description><![CDATA[Developers usually come across a situation wherein they would want to use a variable in a T-SQL Statement which accepts only constant values.
For example, if we try to assign a variable to a Select Top &#60;@variable_name&#62; statement, we would get an error like:
Msg 102, Level 15, State 1, Line 5
Incorrect syntax near &#8216;@variable_name&#8217;
There is a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=joshan.wordpress.com&blog=1893587&post=47&subd=joshan&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Developers usually come across a situation wherein they would want to use a variable in a T-SQL Statement which accepts only constant values.</p>
<p>For example, if we try to assign a variable to a Select Top &lt;@variable_name&gt; statement, we would get an error like:</p>
<p>Msg 102, Level 15, State 1, Line 5<br />
Incorrect syntax near &#8216;@variable_name&#8217;</p>
<p>There is a work around this problem though. The below stored procedure  solves it:</p>
<p>CREATE PROCEDURE TEST<br />
@TestInt INT</p>
<p>AS</p>
<p>BEGIN</p>
<p>DECLARE @SqlQuery NVARCHAR(4000);</p>
<p>SET @SqlQuery = &#8216;SELECT TOP &#8216;+CAST(@TestInt as CHAR)+&#8217;* FROM TABLE_TEST&#8217;;</p>
<p>EXEC(@SqlQuery)</p>
<p>END</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/joshan.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/joshan.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/joshan.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/joshan.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/joshan.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/joshan.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/joshan.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/joshan.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/joshan.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/joshan.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=joshan.wordpress.com&blog=1893587&post=47&subd=joshan&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://joshan.wordpress.com/2008/12/31/using-variables-in-t-sql-statements-that-accept-only-constant-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4bcdace9bf81a5588713d6e01c774ab6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Josh</media:title>
		</media:content>
	</item>
	</channel>
</rss>