<?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>Adam Schroder </title><link>http://weblogs.asp.net/adamschroder/default.aspx</link><description>Its Schotime.com!</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>FluentValidation Xval Integration</title><link>http://weblogs.asp.net/adamschroder/archive/2009/06/13/fluentvalidation-xval-integration.aspx</link><pubDate>Sat, 13 Jun 2009 08:31:37 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7120312</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=7120312</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2009/06/13/fluentvalidation-xval-integration.aspx#comments</comments><description>&lt;p&gt;After a few months of using &lt;a href="http://fluentvalidation.codeplex.com" target="_blank"&gt;FluentValidation&lt;/a&gt; I asked its author Jeremy Skinner if it were possible to integrate this with &lt;a href="http://xval.codeplex.com" target="_blank"&gt;xVal&lt;/a&gt;. At that time it was not possible because there were no easy way to access the properties needed by xVal. After submitting a few patches, we now have a solution which enables xVal integration with most of the FV validators.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://schotime.net/blog/index.php/2009/06/13/fluentvalidation-xval-integration/"&gt;Click here to find out more…&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Cheers,&lt;/p&gt;  &lt;p&gt;Adam&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7120312" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/adamschroder/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/MVC/default.aspx">MVC</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/Validation/default.aspx">Validation</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/xVal/default.aspx">xVal</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/FluentValidation/default.aspx">FluentValidation</category></item><item><title>Integrating xVal Validation with Linq-to-Sql</title><link>http://weblogs.asp.net/adamschroder/archive/2009/03/31/integrating-xval-validation-with-linq-to-sql.aspx</link><pubDate>Tue, 31 Mar 2009 12:34:47 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7015415</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=7015415</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2009/03/31/integrating-xval-validation-with-linq-to-sql.aspx#comments</comments><description>&lt;p&gt;In a previous &lt;a href="http://schotime.net/blog/index.php/2009/03/05/validation-with-aspnet-mvc-xval-idataerrorinfo/"&gt;post&lt;/a&gt; I showed you how you can use xVal and the IDataErrorInfo class to add validation to your Asp.net MVC website. In this post I will extend that to Linq-to-Sql and the classes it generates.&lt;/p&gt;  &lt;p&gt;The northwind database has a suppliers table. The info contained below is using that table with linq-to-sql. &lt;/p&gt;  &lt;p&gt;After adding the table to the designer, a Supplier class gets constructed in the background. This class is a partial class which means we can add to it without changing the code auto-generated in the designer.cs file.    &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://schotime.net/blog/index.php/2009/03/31/integrating-xval-validation-with-linq-to-sql/"&gt;Click here to keep reading…&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Cheers,    &lt;br /&gt;Adam&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7015415" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/adamschroder/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/MVC/default.aspx">MVC</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/Validation/default.aspx">Validation</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/xVal/default.aspx">xVal</category></item><item><title>Custom Validation Attributes</title><link>http://weblogs.asp.net/adamschroder/archive/2009/03/10/custom-validation-attributes.aspx</link><pubDate>Tue, 10 Mar 2009 10:12:58 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6952242</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=6952242</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2009/03/10/custom-validation-attributes.aspx#comments</comments><description>&lt;p&gt;In my last &lt;a href="http://schotime.net/blog/index.php/2009/03/05/validation-with-aspnet-mvc-xval-idataerrorinfo/"&gt;post&lt;/a&gt; I showed you how to use Validation attributes on your model for validation. Today I will show how you can create your own attributes that can provide custom validation for you.    &lt;br /&gt;    &lt;br /&gt;To accomplish this we need to inherit from ValidationAttribute. We'll create an attribute today that will only allow a &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; value to be entered. A pretty bad example however it will still suffice.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://schotime.net/blog/index.php/2009/03/10/custom-validation-attributes/"&gt;Click here to see the how its done.&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Adam&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6952242" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/adamschroder/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/MVC/default.aspx">MVC</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/Validation/default.aspx">Validation</category></item><item><title>Validation with Asp.net MVC, xVal &amp; IDataerrorInfo</title><link>http://weblogs.asp.net/adamschroder/archive/2009/03/05/validation-with-asp-net-mvc-xval-amp-idataerrorinfo.aspx</link><pubDate>Thu, 05 Mar 2009 11:50:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6938127</guid><dc:creator>schotime</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=6938127</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2009/03/05/validation-with-asp-net-mvc-xval-amp-idataerrorinfo.aspx#comments</comments><description>&lt;p&gt;I've been playing around with lots of different Validation concepts recently and I think I have come up with something that will be very useful. Hopefully you will also find it useful.    &lt;br /&gt;    &lt;br /&gt;Firstly I have been looking at &lt;a href="http://blog.codeville.net/2009/02/27/xval-08-beta-now-released/" target="_blank" mce_href="http://blog.codeville.net/2009/02/27/xval-08-beta-now-released/"&gt;Steve Sanderson&lt;/a&gt;'s new open source project &lt;a href="http://www.codeplex.com/xval" target="_blank" mce_href="http://www.codeplex.com/xval"&gt;xVal&lt;/a&gt; and decided that it was a good place to start. I was mainly looking at server side validation but &lt;a href="http://www.codeplex.com/xval" target="_blank" mce_href="http://www.codeplex.com/xval"&gt;xVal&lt;/a&gt; can also generate script to enable client side validation.&lt;/p&gt;  &lt;p&gt;Firstly I'll show you how I integrated the DataAnnotations validation pack that Dynamic data uses and is available to us in 3.5sp1 as far as I know.&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td style="background: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial" valign="top" width="400"&gt;         &lt;br /&gt;          &lt;pre class="code"&gt;&lt;span style="background: black; color: rgb(204,120,50); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;public class &lt;/span&gt;&lt;span style="background: black; color: rgb(255,198,109); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;CustomValidation &lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;: &lt;/span&gt;&lt;span style="background: black; color: rgb(104,151,187); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;IDataErrorInfo
&lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;{
    &lt;/span&gt;&lt;span style="background: black; color: rgb(204,120,50); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;string &lt;/span&gt;&lt;span style="background: black; color: rgb(104,151,187); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;IDataErrorInfo&lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;.Error
    {
        &lt;/span&gt;&lt;span style="background: black; color: rgb(204,120,50); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;get
        &lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;{
            &lt;/span&gt;&lt;span style="background: black; color: rgb(204,120,50); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;return string&lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;.Empty;
        }
    }

    &lt;/span&gt;&lt;span style="background: black; color: rgb(204,120,50); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;string &lt;/span&gt;&lt;span style="background: black; color: rgb(104,151,187); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;IDataErrorInfo&lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;.&lt;/span&gt;&lt;span style="background: black; color: rgb(204,120,50); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;this&lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;[&lt;/span&gt;&lt;span style="background: black; color: rgb(204,120,50); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;string &lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;columnName]
    {
        &lt;/span&gt;&lt;span style="background: black; color: rgb(204,120,50); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;get
        &lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;{
            &lt;/span&gt;&lt;span style="background: black; color: rgb(255,198,109); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;List&lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background: black; color: rgb(255,198,109); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;ErrorInfo&lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;&amp;gt; errors = 
                &lt;/span&gt;&lt;span style="background: black; color: rgb(255,198,109); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;DataAnnotations&lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;.GetErrors(&lt;/span&gt;&lt;span style="background: black; color: rgb(204,120,50); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;this&lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;, columnName).ToList();
            &lt;/span&gt;&lt;span style="background: black; color: rgb(204,120,50); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;return &lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;errors.Count &amp;gt; &lt;/span&gt;&lt;span style="background: black; color: rgb(104,151,187); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;0 &lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;? errors[&lt;/span&gt;&lt;span style="background: black; color: rgb(104,151,187); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;0&lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;].ErrorMessage : &lt;/span&gt;&lt;span style="background: black; color: rgb(204,120,50); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;null&lt;/span&gt;&lt;span style="background: black; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;;
        }
    }
}&lt;/span&gt;&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;Sound interesting...? &lt;a href="http://schotime.net/blog/index.php/2009/03/05/validation-with-aspnet-mvc-xval-idataerrorinfo/" mce_href="http://schotime.net/blog/index.php/2009/03/05/validation-with-aspnet-mvc-xval-idataerrorinfo/"&gt;Click here to keep reading&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cheers, 
  &lt;br /&gt;Adam&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6938127" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/adamschroder/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/MVC/default.aspx">MVC</category></item><item><title>Custom Authorization With Asp.net MVC</title><link>http://weblogs.asp.net/adamschroder/archive/2009/02/17/custom-authorization-with-asp-net-mvc.aspx</link><pubDate>Tue, 17 Feb 2009 11:27:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6910776</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=6910776</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2009/02/17/custom-authorization-with-asp-net-mvc.aspx#comments</comments><description>&lt;p&gt;The whole advantage with MVC over webforms is extensibility at every point. Extensibility, Extensibility, Extensibility.&lt;/p&gt;

&lt;p&gt;Authorization is a very important and every web project has there own needs and requirements. Full customisation is paramount.&lt;/p&gt;

&lt;p&gt;Here I will show you a simple way to customise your authorization.&lt;/p&gt;

&lt;p&gt;In MVC attributes are used to protect a controller method, so we to get started all we need to do is inherit from the AuthorizeAttribute class.&lt;br&gt;&lt;br&gt;&lt;a href="http://schotime.net/blog/index.php/2009/02/17/custom-authorization-with-aspnet-mvc/" mce_href="http://schotime.net/blog/index.php/2009/02/17/custom-authorization-with-aspnet-mvc/"&gt;Click here to see the solution&lt;/a&gt;&lt;br&gt;&lt;br&gt;Happy Coding&lt;/p&gt;&lt;p&gt;Adam &lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6910776" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/adamschroder/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/MVC/default.aspx">MVC</category></item><item><title>Retrieving Data Without the Dataset With Custom SQL</title><link>http://weblogs.asp.net/adamschroder/archive/2009/02/12/retrieving-data-without-the-dataset-with-custom-sql.aspx</link><pubDate>Thu, 12 Feb 2009 10:47:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6898398</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=6898398</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2009/02/12/retrieving-data-without-the-dataset-with-custom-sql.aspx#comments</comments><description>&lt;p&gt;In my previous post I used custom sql query and transformed the results into a nested class. However you may have overlooked way I got the data into a class. It quite easy and will work with all database connectors that implement IDbConnection. 
  &lt;br&gt;

  &lt;br&gt;Here is how its done. We use the DataContext that came with and used by Linq2Sql.

  &lt;br&gt;

  &lt;br&gt;&lt;a href="http://schotime.net/blog/index.php/2009/02/12/retrieving-data-without-the-dataset-with-custom-sql/" mce_href="http://schotime.net/blog/index.php/2009/02/12/retrieving-data-without-the-dataset-with-custom-sql/" target="_blank"&gt;Click here to see the solution.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Adam&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6898398" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/adamschroder/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/Linq/default.aspx">Linq</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Transforming one-to-many Sql into Nested Class</title><link>http://weblogs.asp.net/adamschroder/archive/2009/01/22/transforming-one-to-many-sql-into-nested-class.aspx</link><pubDate>Thu, 22 Jan 2009 11:23:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6855392</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=6855392</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2009/01/22/transforming-one-to-many-sql-into-nested-class.aspx#comments</comments><description>&lt;p&gt;Back in the days of Classic ASP, when you had a one too many relationship displaying the data was pretty painful. You would do things like &lt;/p&gt;

&lt;table style="background: black none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="1" cellpadding="2" cellspacing="0" width="400"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="400"&gt;
        &lt;pre class="code"&gt;&lt;span style="background: black none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: white;"&gt;&lt;br&gt;        var reference_number_old = &lt;/span&gt;&lt;span style="background: black none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(165, 194, 92);"&gt;"$##%@"&lt;/span&gt;&lt;span style="background: black none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: white;"&gt;;
        &lt;/span&gt;&lt;span style="background: black none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 120, 50);"&gt;while &lt;/span&gt;&lt;span style="background: black none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: white;"&gt;(recordsExist)
        {
            reference_number = String(rs(&lt;/span&gt;&lt;span style="background: black none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(104, 151, 187);"&gt;0&lt;/span&gt;&lt;span style="background: black none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: white;"&gt;));

            &lt;/span&gt;&lt;span style="background: black none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 120, 50);"&gt;if &lt;/span&gt;&lt;span style="background: black none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: white;"&gt;(reference_number_old != reference_number)
            {
                Response.Write(reference_number);
                reference_number_old = reference_number;
            }

            &lt;/span&gt;&lt;span style="background: black none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: gray;"&gt;//Do more stuff
        &lt;/span&gt;&lt;span style="background: black none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: white;"&gt;}&lt;/span&gt;&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;Sooo very very painful, and that's only grouping by one column (reference number).&lt;/p&gt;

&lt;p&gt;Now however with OO programming and the advance of Linq there is a much nicer and easier way to deal with this Master-Detail type one-to-many relationship.&lt;/p&gt;

&lt;p&gt;Lets see how we do it now, still using our own custom sql. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://schotime.net/blog/index.php/2009/01/22/transforming-one-to-many-sql-into-nested-class/" mce_href="http://schotime.net/blog/index.php/2009/01/22/transforming-one-to-many-sql-into-nested-class/" target="_blank"&gt;Click Here to Keep Reading...&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cheers 
  &lt;br&gt;Schotime 

  &lt;br&gt;

  &lt;br&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6855392" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/adamschroder/archive/tags/linq+.net+c_2300_/default.aspx">linq .net c#</category></item><item><title>Running ASP.NET MVC Applications Under IIS6</title><link>http://weblogs.asp.net/adamschroder/archive/2008/10/18/running-asp-net-mvc-applications-under-iis6.aspx</link><pubDate>Sat, 18 Oct 2008 10:18:14 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6687082</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=6687082</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2008/10/18/running-asp-net-mvc-applications-under-iis6.aspx#comments</comments><description>&lt;p&gt;Yes...Finally...I have full control of my HTML again, but am still able to work with a great language like C#. MVC is here and its great. I'm absolutely loving it. But how the heck do you get it to work under IIS6. What if I want extensionless URL's? Here is a few options for you.&lt;/p&gt;  &lt;p&gt;Click &lt;a href="http://schotime.net/blog/index.php/2008/10/18/running-aspnet-mvc-applications-under-iis6/" target="_blank"&gt;Here&lt;/a&gt; to read on.....    &lt;br /&gt;    &lt;br /&gt;Schotime&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6687082" width="1" height="1"&gt;</description></item><item><title>Returning a Dataset, Datatable in Json</title><link>http://weblogs.asp.net/adamschroder/archive/2008/07/28/returning-a-dataset-datatable-in-json.aspx</link><pubDate>Mon, 28 Jul 2008 11:05:30 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6453501</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=6453501</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2008/07/28/returning-a-dataset-datatable-in-json.aspx#comments</comments><description>&lt;p&gt;After my previous posts about returning data in JSON, I decided to have a go at returning a generic Datatable. This however is not as easy as simple returning a Datatable in your code behind method or web service. There a solution though and here it is.&lt;/p&gt;  &lt;p&gt;If you break a Datatable down it is really only a List of Dictionary objects so that's how we'll approach this problem. This is compatible with .NET 2.0 and above, with the Ajax installed.&lt;/p&gt;  &lt;p&gt;I'd like to acknowledge &lt;a href="http://www.trinet.co.uk/" target="_blank"&gt;RichardD&lt;/a&gt; for the idea.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://schotime.net/blog/index.php/2008/07/27/dataset-datatable-to-json/"&gt;Click here to view the simple solution.&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6453501" width="1" height="1"&gt;</description></item><item><title>jQuery Plugin for ASP.net Ajax (jMsAjax)</title><link>http://weblogs.asp.net/adamschroder/archive/2008/07/02/jquery-plugin-for-asp-net-ajax-jmsajax.aspx</link><pubDate>Tue, 01 Jul 2008 13:29:12 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6345258</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=6345258</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2008/07/02/jquery-plugin-for-asp-net-ajax-jmsajax.aspx#comments</comments><description>&lt;p&gt;After my recent post on &lt;a href="http://schotime.net/blog/index.php/2008/06/19/jquery-ajax-aspnet-and-dates/"&gt;jQuery, JSON and dates in asp.net&lt;/a&gt; I decided that there must be a better solution so I set out writing my first jQuery plugin. And after a few hours I had it working to my delight.&lt;/p&gt;  &lt;p&gt;It not only accepts a raw JSON object as input for method parameters, but safely parses and stringify's the object using Crockford's implementation (&lt;a href="http://www.json.org/js.html"&gt;http://www.json.org/js.html&lt;/a&gt;). The syntax of the call doesn't change if it is a &amp;quot;POST&amp;quot; or a &amp;quot;GET&amp;quot; as it is all handled inside the plugin. It also returns Dates without a problem.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://schotime.net/blog/index.php/2008/07/01/jquery-plugin-for-aspnet-ajax-jmsajax/"&gt;Click here to keep reading....&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Schotime&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6345258" width="1" height="1"&gt;</description></item><item><title>jQuery, AJAX, ASP.NET and Dates</title><link>http://weblogs.asp.net/adamschroder/archive/2008/06/19/jquery-ajax-asp-net-and-dates.aspx</link><pubDate>Thu, 19 Jun 2008 09:39:38 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6294712</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=6294712</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2008/06/19/jquery-ajax-asp-net-and-dates.aspx#comments</comments><description>&lt;p&gt;Just recently I discovered jQuery and I have to say....I'm a huge fan already. So I decided to setup my first AJAX call through jQuery and call a page method. After some playing around I finally had it. Thanks also go out to &lt;a href="http://www.encosia.com"&gt;www.encosia.com&lt;/a&gt;. Thanks Dave. The only problem was that I could not parse Dates. &lt;/p&gt;  &lt;p&gt;So here I show you my solution which works pretty well and suits my needs. Maybe you might find it useful.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://schotime.net/index.php/2008/06/19/jquery-ajax-aspnet-and-dates/"&gt;Click here to see my solution&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6294712" width="1" height="1"&gt;</description></item><item><title>Slow TcpClient Connection (sockets)</title><link>http://weblogs.asp.net/adamschroder/archive/2008/05/27/slow-tcpclient-connection-sockets.aspx</link><pubDate>Tue, 27 May 2008 03:28:03 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6223652</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=6223652</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2008/05/27/slow-tcpclient-connection-sockets.aspx#comments</comments><description>&lt;p&gt;Recently I have been experimenting with Sockets and trying to communicate with a windows service both with a console app and a website.&lt;/p&gt;  &lt;p&gt;After managing to get some lines of communication going between the client and server applications, I couldn't help but notice that it was taking a little bit longer than it probably should have. I decided to have a closer look. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://schotime.net/index.php/2008/05/27/slow-tcpclient-connection-sockets/"&gt;Click here to keep reading...&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6223652" width="1" height="1"&gt;</description></item><item><title>Binding A String to a Checkbox</title><link>http://weblogs.asp.net/adamschroder/archive/2008/04/02/binding-a-string-to-a-checkbox.aspx</link><pubDate>Wed, 02 Apr 2008 06:13:25 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6059799</guid><dc:creator>schotime</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=6059799</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2008/04/02/binding-a-string-to-a-checkbox.aspx#comments</comments><description>&lt;p&gt;&lt;span style="color: red"&gt;&lt;/span&gt;In a recent project I was attempting to list data from a configuration settings database table. The values were boolean but stored as a 'Y' or a 'N' so that only one set of SQL's was needed to be written, as the product supports both Oracle and SQL Server. &lt;/p&gt;  &lt;p&gt;When I first put the GridView together, I was surprised to find that there was no Value property for the asp:checkbox nor could you bind any other column in a database but a 'bit' column to it.&lt;/p&gt;  &lt;p&gt;The only solution I could come up with was to create a custom Checkbox and implement the feature. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://schotime.net/index.php/2008/04/02/binding-a-string-to-a-checkbox/"&gt;Click here to keep reading and get the code...&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6059799" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/adamschroder/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/adamschroder/archive/tags/Custom+Controls/default.aspx">Custom Controls</category></item><item><title>Importing Data Files with Linq</title><link>http://weblogs.asp.net/adamschroder/archive/2008/03/18/importing-data-files-with-linq.aspx</link><pubDate>Tue, 18 Mar 2008 12:24:46 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5993629</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=5993629</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2008/03/18/importing-data-files-with-linq.aspx#comments</comments><description>&lt;p&gt;In my previous &lt;a href="http://schotime.net/index.php/2008/03/10/linq-and-regular-expressions/" target="_blank"&gt;Linq post&lt;/a&gt; I discussed using Linq with Regular expressions and how much less code was needed. In this post we'll again see how Linq can be used to speed up and simplify development.&lt;/p&gt;  &lt;p&gt;There are many situations where you need to read data into memory or a database. Lets consider this scenario. &lt;/p&gt;  &lt;p&gt;We have a tab delimited data file that has been exported from some web or windows application etc......&lt;/p&gt;  &lt;p&gt;&lt;a href="http://schotime.net/index.php/2008/03/18/importing-data-files-with-linq/"&gt;Click here to continue reading!&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5993629" width="1" height="1"&gt;</description></item><item><title>Select All (ctrl+A) For A TextBox</title><link>http://weblogs.asp.net/adamschroder/archive/2008/03/12/select-all-ctrl-a-for-textbox.aspx</link><pubDate>Wed, 12 Mar 2008 04:34:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5954503</guid><dc:creator>schotime</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/adamschroder/rsscomments.aspx?PostID=5954503</wfw:commentRss><comments>http://weblogs.asp.net/adamschroder/archive/2008/03/12/select-all-ctrl-a-for-textbox.aspx#comments</comments><description>&lt;p&gt;Have you ever tried to push ctrl+A on a multi-line or single line textbox in a Dot Net Windows Forms application to select all of the text? If you have you would know that it doesn't work. That's right, standard windows functionality doesn't work for the TextBox control. So here's how to fix it using a custom control.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://schotime.net/index.php/2008/03/12/select-all-ctrla-for-textbox/" mce_href="http://schotime.net/index.php/2008/03/12/select-all-ctrla-for-textbox/"&gt;Click here to read more..&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5954503" width="1" height="1"&gt;</description></item></channel></rss>