<?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/"
	>

<channel>
	<title>Jigsaw Boys &#187; subsonic</title>
	<atom:link href="http://www.jigsawboys.com/tag/subsonic/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jigsawboys.com</link>
	<description>Security, Network and Computer Tech Tip Database!</description>
	<lastBuildDate>Wed, 17 Aug 2011 22:59:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to fetch Last Record in Subsonic</title>
		<link>http://www.jigsawboys.com/2009/12/22/how-to-fetch-last-record-in-subsonic/</link>
		<comments>http://www.jigsawboys.com/2009/12/22/how-to-fetch-last-record-in-subsonic/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 06:18:22 +0000</pubDate>
		<dc:creator>Jamsi</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[linq]]></category>
		<category><![CDATA[subsonic]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.jigsawboys.com/?p=291</guid>
		<description><![CDATA[Is it just me or is Subsonic the topic of discussion right now? I had a need to retrieve the last ID that had been generated in a table; that being, the last &#8220;auto increment&#8221; ID of a table. The following example worked a charm using Subsonic and activerecord. As you can see, it creates [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Is it just me or is Subsonic the topic of discussion right now? <img src='http://www.jigsawboys.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
I had a need to retrieve the last ID that had been generated in a table; that being, the last &#8220;auto increment&#8221; ID of a table.</p>
<p>The following example worked a charm using Subsonic and activerecord.</p>
<pre class="brush: csharp; title: ; notranslate">
var fetch_ref_id = contract.All().OrderByDescending(c =&gt; c.id).Take(1).ToList();
if (iRef_new_id != null)
{
     iRef_new_id = fetch_ref_id[0].id;
}
</pre>
<p>As you can see, it creates a new list (noted by the ToList()) by connecting to the table &#8220;category&#8221;, it then selects all results (All()) and then orders the list by Descending and finally, the take(1) simply takes the top record.</p>
<p>I then whack the result (if you have a column called id) into a integer.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jigsawboys.com/2009/12/22/how-to-fetch-last-record-in-subsonic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subsonic ordering &#8211; OrderByDescending</title>
		<link>http://www.jigsawboys.com/2009/12/22/subsonic-ordering-orderbydescending/</link>
		<comments>http://www.jigsawboys.com/2009/12/22/subsonic-ordering-orderbydescending/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 05:41:22 +0000</pubDate>
		<dc:creator>Jamsi</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[linq]]></category>
		<category><![CDATA[subsonic]]></category>

		<guid isPermaLink="false">http://www.jigsawboys.com/?p=288</guid>
		<description><![CDATA[So the subsonic documentation sucks. If you&#8217;re new to activerecord, linq and subsonic in general; you&#8217;ll find it fairly hard to construct basic queries. However once you&#8217;ve got it under control, it&#8217;s a piece of cake. To sort your table using activerecord, use the following examples; To sort ascending by a column called name To [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>So the subsonic documentation sucks. If you&#8217;re new to activerecord, linq and subsonic in general; you&#8217;ll find it fairly hard to construct basic queries. However once you&#8217;ve got it under control, it&#8217;s a piece of cake.</p>
<p>To sort your table using activerecord, use the following examples;</p>
<p><b>To sort ascending by a column called name</b></p>
<pre class="brush: csharp; title: ; notranslate">
var categories = category.All().OrderBy(c =&gt; c.name);
</pre>
<p><b>To sort descendingby a column called name</b></p>
<pre class="brush: csharp; title: ; notranslate">
var categories = category.All().OrderByDescending(c =&gt; c.name);
</pre>
<p>You can then just bind to your gridview/dropdown list or whatever you like.</p>
<pre class="brush: csharp; title: ; notranslate">
            if (categories != null)
            {
                drp.DataSource = categories ;
                drp.DataBind();
            }
</pre>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jigsawboys.com/2009/12/22/subsonic-ordering-orderbydescending/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SubSonic 3.0 ActiveRecord Tutorial</title>
		<link>http://www.jigsawboys.com/2009/11/25/subsonic-3-0-activerecord-examples/</link>
		<comments>http://www.jigsawboys.com/2009/11/25/subsonic-3-0-activerecord-examples/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 07:42:58 +0000</pubDate>
		<dc:creator>Jamsi</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[subsonic]]></category>

		<guid isPermaLink="false">http://www.jigsawboys.com/?p=275</guid>
		<description><![CDATA[I wanted to demonstrate the complete and utter power of SubSonic Activerecord&#8217;s toolset. Pretty much, its an easy to use querying engine which automatically creates objects that you can use within your ASP.NET project. You can use LINQ querying if you like, or you can use the SubSonic preferred way as demonstrated below; Want to [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I wanted to demonstrate the complete and utter power of SubSonic Activerecord&#8217;s toolset. Pretty much, its an easy to use querying engine which automatically creates objects that you can use within your ASP.NET project. You can use LINQ querying if you like, or you can use the SubSonic preferred way as demonstrated below;</p>
<p><strong>Want to bind a gridview?</strong></p>
<pre class="brush: csharp; title: ; notranslate">
var categories = category.All();
gvList.DataSource = categories;
gvList.DataBind();
</pre>
<p>Boom. Done.</p>
<pre class="brush: csharp; title: ; notranslate">
&lt;pre lang=&quot;csharp&quot; line=&quot;1&quot;&gt;
int iLineID = 1;
category delCat = category.SingleOrDefault(x =&gt; x.id == iLineID);
delCat.Delete();
</pre>
<p>Too easy right?</p>
<p><strong>What about adding a new record?</strong></p>
<pre class="brush: csharp; title: ; notranslate">
category newCat = new category();
newCat.name = &quot;Dummy category name&quot;;
newCat.Add();
</pre>
<p>How easy is that? Go <a href="http://subsonicproject.com/download">grab SubSonic now</a>!</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jigsawboys.com/2009/11/25/subsonic-3-0-activerecord-examples/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

