<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-134726735252370370</id><updated>2012-01-19T22:09:26.773Z</updated><category term='C#'/><category term='Crystal Reports'/><category term='Visual Studio'/><category term='Subversion'/><category term='Asp.Net'/><category term='Rhino.Mocks'/><category term='Log4Net'/><category term='Sql Server'/><category term='IDictionary'/><category term='asp.net Validators'/><category term='NHibernate'/><category term='Spring'/><category term='VS2005'/><category term='UpdatePanel'/><category term='Pop3'/><category term='HQL'/><category term='Pitfalls'/><category term='Ajax'/><category term='Asp.net ServerControls'/><category term='Windows2003'/><category term='Validators'/><title type='text'>Musings and bugs of a developer</title><subtitle type='html'>This blog is a record of some development issues I have faced.
There may be something of use!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://steve-fair-dev.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>75</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-5193377692011244545</id><published>2012-01-19T22:09:00.001Z</published><updated>2012-01-19T22:09:26.803Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>Spring.Net - Could not load type ....</title><content type='html'>&lt;p&gt;Was getting this error with Spring that came down to the fact one Dll was out of date - the Dll was Risk.dll and the config file throwing the error was Risk.xml.config&amp;#160; but this was clouded by another config file trying to set the same object also throwing the error.&lt;/p&gt;  &lt;p&gt;I think Spring loaded the Risk.dll assembly and stored the bad/old reference e.g. IMyMovedObject as belonging to the old library so other objects which had reference to the same type also threw this error even though their build was up to date.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-5193377692011244545?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5193377692011244545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5193377692011244545'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2012/01/springnet-could-not-load-type.html' title='Spring.Net - Could not load type ....'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-3881143769171948537</id><published>2011-11-17T12:01:00.000Z</published><updated>2011-11-17T12:05:30.084Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>NHibernate - HQL - No Persister for xxx</title><content type='html'>&lt;p&gt;Was getting strange error ' No Persister for System.String' when doing HQL query using a parameter.&lt;/p&gt;  &lt;p&gt;Turned out it was because I was using SetEntity to assign the parameter value instead of SetString&lt;/p&gt;  &lt;p&gt;All because of cutting and pasting!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-3881143769171948537?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/3881143769171948537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/3881143769171948537'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2011/11/was-getting-strange-error-no-persister.html' title='NHibernate - HQL - No Persister for xxx'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-6094321987181796274</id><published>2009-10-19T15:25:00.001Z</published><updated>2009-10-19T15:25:12.542Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>NHibernate - Entity property is an Interface - mapping</title><content type='html'>&lt;p&gt;If you have a class that maps to a table and a property of the class is an association to another table (i.e. 1:M Property) you may get the following error if the property is defined as an interface type:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;NHibernate An association from the table XYZ refers to an unmapped class&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This occurs because NHibernate will not have a mapping file for the interface type and cannot instantiate it because it is an interface. To fix the problem you need to include in the mapping file the actual class the property represents.&lt;/p&gt;  &lt;p&gt;e.g. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;IAccount MainAccount;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;may map to&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;many-to-one name=&amp;quot;MainAccount&amp;quot; column=&amp;quot;MainAccountID&amp;quot; class=&amp;quot;BankingCore.BusinessEntities.Account, BankingCore&amp;quot;/&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;where BankingCore.BusinessEntities.Account is the actual class to be instantiated for the property.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-6094321987181796274?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/6094321987181796274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/6094321987181796274'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2009/10/nhibernate-entity-property-is-interface.html' title='NHibernate - Entity property is an Interface - mapping'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-5328453583506966142</id><published>2009-09-04T14:23:00.001Z</published><updated>2009-09-04T14:23:19.012Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Subversion'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Released: Who is to blame visual studio / subversion utility</title><content type='html'>&lt;p&gt;Released free utility application: &lt;strong&gt;Who is to blame&lt;/strong&gt; which allows the user to paste in warnings and errors from Visual Studio then get a report via Subversions Blame program of who edited the line. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-5328453583506966142?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5328453583506966142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5328453583506966142'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2009/09/released-who-is-to-blame-visual-studio.html' title='Released: Who is to blame visual studio / subversion utility'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-603846561432116877</id><published>2009-09-04T14:21:00.001Z</published><updated>2009-09-04T14:21:01.973Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Crystal Reports'/><title type='text'>Released Crystal Reports user library for BM+ pick-list lookup</title><content type='html'>&lt;p&gt;Today we released for free download a user-library for substituting BM+ pick-list values into Crystal Reports.&lt;/p&gt;  &lt;p&gt;The library can be downloaded by following the u2lBMPick link from &lt;a href="http://www.fairmort.com/Products.aspx" target="_blank"&gt;Fairmort.com/Products&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-603846561432116877?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/603846561432116877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/603846561432116877'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2009/09/released-crystal-reports-user-library.html' title='Released Crystal Reports user library for BM+ pick-list lookup'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-4495024871411848108</id><published>2009-08-24T12:01:00.001Z</published><updated>2009-08-24T12:01:11.141Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='HQL'/><title type='text'>NHibernate HQL Query : could not resolve property</title><content type='html'>&lt;p&gt;If you get &lt;/p&gt;  &lt;h4&gt;&lt;i&gt;could not resolve property: ID: of&lt;/i&gt;&lt;/h4&gt;  &lt;p&gt;error for a HQL query and you know the property exists and is spelt correctly check that the query parameters are defined correctly.&lt;/p&gt;  &lt;p&gt;Had this problem when query text was:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;..... TaskStatus:=status ....&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The problem is that the colon is the wrong side of the equals, should be&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;..... TaskStatus=:status ....&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Error is easy typo to make but had to spot.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-4495024871411848108?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4495024871411848108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4495024871411848108'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2009/08/nhibernate-hql-query-could-not-resolve.html' title='NHibernate HQL Query : could not resolve property'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-8748111103340104237</id><published>2009-02-20T09:41:00.001Z</published><updated>2009-02-20T10:09:54.502Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows2003'/><title type='text'>Task Scheduler : XP &amp; Win 2003</title><content type='html'>&lt;h4&gt;&lt;font color="#ff0000"&gt;WIN2003: Ensure Console is not logged in if trying to run task via Remote Console &lt;/font&gt;- &lt;/h4&gt;  &lt;h4&gt;Following information taken from MS knowledge base: &lt;a href="http://support.microsoft.com/kb/308558" target="_blank"&gt;http://support.microsoft.com/kb/308558&lt;/a&gt;&lt;/h4&gt;  &lt;h4&gt;&amp;#160;&lt;/h4&gt;  &lt;h4&gt;Checking the Task Status&lt;/h4&gt; Periodically check the status of scheduled tasks, because sometimes you may not be aware that a scheduled task did not run. Use the Detail view in the Scheduled Task window to see the following information about each task:   &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Schedule&lt;/b&gt; - The schedule for the task. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Next Run Time&lt;/b&gt; - The time and date that the task is next scheduled to run. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Last Run Time&lt;/b&gt; - The time and date the task was last run. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Status&lt;/b&gt; - The current status of the task. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Last Result&lt;/b&gt; - Code that indicates the result of the last run. &lt;/li&gt; &lt;/ul&gt; The &lt;b&gt;Status&lt;/b&gt; column has the following status and description information:   &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Blank&lt;/b&gt; - The task is not running, or it ran and was successful. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Running&lt;/b&gt; - The task is currently running. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Missed&lt;/b&gt; - One or more attempts to run this task was missed. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Could not start&lt;/b&gt; - The most recent attempt to start the task did not work. &lt;/li&gt; &lt;/ul&gt; The &lt;b&gt;Last Result&lt;/b&gt; column displays a completion code. You can obtain a full explanation of all Windows completion codes from MSDN, but the common codes for scheduled tasks are:   &lt;ul&gt;   &lt;li&gt;&lt;b&gt;0x0&lt;/b&gt;: The operation completed successfully. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;0x1&lt;/b&gt;: An incorrect function was called or an unknown function was called. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;0xa&lt;/b&gt;: The environment is incorrect. &lt;/li&gt; &lt;/ul&gt; If the result code has the &amp;quot;C0000XXX&amp;quot; format, the task did not complete successfully (the &amp;quot;C&amp;quot; indicates an error condition). The most common &amp;quot;C&amp;quot; error code is &amp;quot;0xC000013A: The application terminated as a result of a CTRL+C&amp;quot;.   &lt;br /&gt;Also check the following data in the task's properties:   &lt;ul&gt;   &lt;li&gt;Make sure the check box that turns on the task has a check mark. &lt;/li&gt;    &lt;li&gt;Check the path to the program and make sure that it is correct. Also check the program to see if it requires some command-line parameters that are missing. &lt;/li&gt; &lt;/ul&gt; For a full explanation of Windows completion codes, visit the following Web site:   &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa364454.aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa364454.aspx&lt;/a&gt; (http://msdn2.microsoft.com/en-us/library/aa364454.aspx) &lt;/p&gt;  &lt;p&gt;&lt;a href="http://support.microsoft.com/kb/308558#top"&gt;&lt;img alt="" src="http://support.microsoft.com/library/images/support/kbgraphics/public/en-us/uparrow.gif" /&gt;Back to the top&lt;/a&gt;&lt;/p&gt;  &lt;h5&gt;&lt;a&gt;&lt;/a&gt;Checking the Scheduled Tasks Log&lt;/h5&gt; Scheduled tasks maintains a log file (Schedlgu.txt), in the c:\Windows folder. You can view the log from the Scheduled Tasks window by clicking &lt;b&gt;View Log&lt;/b&gt; on the &lt;b&gt;Advanced&lt;/b&gt; menu.   &lt;br /&gt;The log file size is 32 kilobytes (KB), and when the file reaches its maximum size, it automatically starts to record new information at the beginning of the log file and writes over the old log file information.   &lt;p&gt;&lt;a href="http://support.microsoft.com/kb/308558#top"&gt;&lt;img alt="" src="http://support.microsoft.com/library/images/support/kbgraphics/public/en-us/uparrow.gif" /&gt;Back to the top&lt;/a&gt;&lt;/p&gt;  &lt;h5&gt;&lt;a&gt;&lt;/a&gt;Checking the Task Scheduler Service&lt;/h5&gt; The Task Scheduler service must be running and properly configured to run tasks. If you had stopped scheduled tasks manually from the Scheduled Tasks window, the service stops and does not initialize the next time you start the computer. If the service is not configured to log on as the local system account, it may not start.   &lt;br /&gt;To check the settings for the service:   &lt;ol&gt;   &lt;li&gt;Click &lt;b&gt;Start&lt;/b&gt;, click &lt;b&gt;Control Panel&lt;/b&gt;, and then double-click &lt;b&gt;Administrative Tools&lt;/b&gt;. &lt;/li&gt;    &lt;li&gt;Click &lt;b&gt;Computer Management&lt;/b&gt;. &lt;/li&gt;    &lt;li&gt;Expand &lt;b&gt;Services and Applications&lt;/b&gt;, and then click &lt;b&gt;Services&lt;/b&gt;. &lt;/li&gt;    &lt;li&gt;Right-click the &lt;b&gt;Task Scheduler&lt;/b&gt; service, and then click &lt;b&gt;Properties&lt;/b&gt;. &lt;/li&gt;    &lt;li&gt;On the &lt;b&gt;General&lt;/b&gt; tab, make sure that the startup type is set to automatic, and that the service status is Started. If the service is not running, click &lt;b&gt;Start&lt;/b&gt;. &lt;/li&gt;    &lt;li&gt;On the &lt;b&gt;Log On&lt;/b&gt; tab, make sure that the local system account is selected, and that the &lt;strong&gt;Allow service to interact with desktop&lt;/strong&gt; check box has a check mark. &lt;/li&gt;    &lt;li&gt;Click &lt;b&gt;OK&lt;/b&gt;, and then quit Computer Management. &lt;/li&gt; &lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-8748111103340104237?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8748111103340104237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8748111103340104237'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2009/02/task-scheduler-xp-win-2003.html' title='Task Scheduler : XP &amp;amp; Win 2003'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-3857278878003161895</id><published>2009-02-12T10:36:00.001Z</published><updated>2009-02-12T10:36:27.426Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Log4Net'/><title type='text'>Log4Net - moving config out to separate file with auto-refresh</title><content type='html'>&lt;p&gt;&lt;a title="http://geekswithblogs.net/bsherwin/archive/2008/02/15/119657.aspx" href="http://geekswithblogs.net/bsherwin/archive/2008/02/15/119657.aspx"&gt;http://geekswithblogs.net/bsherwin/archive/2008/02/15/119657.aspx&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-3857278878003161895?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/3857278878003161895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/3857278878003161895'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2009/02/log4net-moving-config-out-to-separate.html' title='Log4Net - moving config out to separate file with auto-refresh'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-398089256198667096</id><published>2009-01-28T11:58:00.001Z</published><updated>2009-01-28T11:58:18.977Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Asp.Net to PDF export</title><content type='html'>&lt;p&gt;Interesting article on exporting a GridView to PDF:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://csharpdotnetfreak.blogspot.com/2008/12/export-gridview-to-pdf-using-itextsharp.html" href="http://csharpdotnetfreak.blogspot.com/2008/12/export-gridview-to-pdf-using-itextsharp.html"&gt;http://csharpdotnetfreak.blogspot.com/2008/12/export-gridview-to-pdf-using-itextsharp.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Uses open-source project iTextSharp&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-398089256198667096?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/398089256198667096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/398089256198667096'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2009/01/aspnet-to-pdf-export.html' title='Asp.Net to PDF export'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-5723688563348145289</id><published>2009-01-16T11:37:00.001Z</published><updated>2009-01-16T11:37:29.489Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.net ServerControls'/><title type='text'>Asp.Net encrypt connection string in web config</title><content type='html'>&lt;p&gt;Quick note on how to encrypt the Connection string in the web.config for future reference    &lt;br /&gt;Encrypt the Connection string :     &lt;br /&gt;&lt;strong&gt;aspnet_regiis -pef &amp;quot;ConnectionString&amp;quot; &amp;quot;c:\path\to\website&amp;quot;&lt;/strong&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Grant Access to IIS to the key    &lt;br /&gt;&lt;strong&gt;aspnet_regiis -pa &amp;quot;NetFrameworkConfigurationKey&amp;quot; &amp;quot;NT Authority\Network Service&amp;quot;&lt;/strong&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;note aspnet_regiis is in the .net framework directory for the version of .net that you are using&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-5723688563348145289?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5723688563348145289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5723688563348145289'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2009/01/aspnet-encrypt-connection-string-in-web.html' title='Asp.Net encrypt connection string in web config'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-2964004606364910344</id><published>2008-10-15T13:19:00.001Z</published><updated>2008-10-15T13:19:11.107Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rhino.Mocks'/><title type='text'>Rhino mocks - partial mock calling real method not mocked expectation</title><content type='html'>&lt;p&gt;Had a few occasions where a Partial mock was calling the real method even though an expectation had been defined.&lt;/p&gt;  &lt;p&gt;The reason was that the method being called was not marked as Virtual and so not being overridden by the mock repository.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-2964004606364910344?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2964004606364910344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2964004606364910344'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/10/rhino-mocks-partial-mock-calling-real.html' title='Rhino mocks - partial mock calling real method not mocked expectation'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-2843809316654950640</id><published>2008-09-25T12:24:00.001Z</published><updated>2008-09-25T12:24:24.194Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Encrypt / Decrypt Web.Config sections</title><content type='html'>&lt;p&gt;See article &lt;a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=185&amp;amp;AspxAutoDetectCookieSupport=1" target="_blank"&gt;here&lt;/a&gt; to encrypt or decrypt section of web.config file.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-2843809316654950640?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2843809316654950640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2843809316654950640'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/09/encrypt-decrypt-webconfig-sections.html' title='Encrypt / Decrypt Web.Config sections'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-8706824913612207509</id><published>2008-09-18T11:51:00.001Z</published><updated>2008-09-18T11:51:49.308Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS2005'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>VS2005 XML Comments not shown</title><content type='html'>&lt;p&gt;XML Method comments are not being displayed by intellisense for methods of classes other than those in the same project.&lt;/p&gt;  &lt;p&gt;Any referenced DLL must have the XML file which contains the comments in the same directory as the DLL itself.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-8706824913612207509?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8706824913612207509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8706824913612207509'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/09/vs2005-xml-comments-not-shown.html' title='VS2005 XML Comments not shown'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-7911959180160778731</id><published>2008-09-16T12:34:00.001Z</published><updated>2008-09-16T12:34:59.995Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Asp.Net - Simulate a windows service</title><content type='html'>&lt;p&gt;Very interesting article here: &lt;a href="http://www.codeproject.com/KB/aspnet/ASPNETService.aspx" target="_blank"&gt;CodeProject:AspNetService&lt;/a&gt; detailing how to simulate a windows service running completely within Aps.Net using cache item call backs.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-7911959180160778731?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7911959180160778731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7911959180160778731'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/09/aspnet-simulate-windows-service.html' title='Asp.Net - Simulate a windows service'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-6110147082079323549</id><published>2008-07-01T09:11:00.001Z</published><updated>2008-07-01T09:11:04.553Z</updated><title type='text'>.Net Setting up Intranet as Full Trust Zone</title><content type='html'>&lt;p&gt;If the PC does not have the .NET SDK installed then the configuration tool will not be available via Control Panel -&amp;gt; Admin. Tools. Instead a command line tool CasPol.exe must be used:&lt;/p&gt;  &lt;p&gt;The command line tool&amp;#160; exists in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\    &lt;br /&gt;The command for setting Intranet as full trust is:     &lt;br /&gt;CasPol.exe -q -m -ag All_Code -zone Intranet FullTrust &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-6110147082079323549?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/6110147082079323549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/6110147082079323549'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/07/net-setting-up-intranet-as-full-trust.html' title='.Net Setting up Intranet as Full Trust Zone'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-2370845415337870497</id><published>2008-05-28T09:05:00.001Z</published><updated>2008-05-28T09:05:19.126Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Pitfalls'/><title type='text'>DataGridView - wrong row edited</title><content type='html'>&lt;p&gt;When using the Edit functionality of a DataGridView it is easy to fall into the trap of selecting the wrong row to edit when running in a multi-user environment.&lt;/p&gt;  &lt;p&gt;When user clicks row to edit you must store the ID of the row (not its index), then just prior to data-bind find the index of the selected ID in the data-source and set the EditIndex, this means if another user adds or removes rows in between the the current user clicking edit the correct row will be selected.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-2370845415337870497?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2370845415337870497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2370845415337870497'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/05/datagridview-wrong-row-edited.html' title='DataGridView - wrong row edited'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-777408942405784101</id><published>2008-05-13T16:22:00.001Z</published><updated>2008-05-13T16:22:41.296Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sql Server'/><title type='text'>SQL Left Join with Criteria</title><content type='html'>&lt;p&gt;Query to get job title of staff or null if staff not assign a job-title:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;SELECT&amp;#160;&amp;#160;&amp;#160;&amp;#160; CORE_Staff.ID, CORE_Staff.JobTitleID, CORE_JobTitle.Name   &lt;br /&gt;FROM&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; CORE_Staff&amp;#160; LEFT JOIN CORE_JobTitle    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ON CORE_JobTitle.ID = CORE_Staff.JobTitleID     &lt;br /&gt;where (CORE_JobTitle.Name='Driver') or (CORE_JobTitle.Name is null)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-777408942405784101?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/777408942405784101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/777408942405784101'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/05/sql-left-join-with-criteria.html' title='SQL Left Join with Criteria'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-8732092476170645393</id><published>2008-05-13T11:19:00.001Z</published><updated>2008-05-13T11:19:18.691Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rhino.Mocks'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Rhino Mocks - Partial mock not calling base method</title><content type='html'>&lt;p&gt;Had a problem where I was creating a partial mock then calling a method of the partial mock which was returning 0 (zero). &lt;/p&gt;  &lt;p&gt;The base method was not being called even though no expectations had been setup.&lt;/p&gt;  &lt;p&gt;The reason for this was that the ReplayAll (and VerifyAll) methods of Rhino Mocks was not being called. &lt;/p&gt;  &lt;p&gt;Original code:&lt;/p&gt;  &lt;pre class="code"&gt;            _interestBiz = _mocks.PartialMock&amp;lt;&lt;span style="color: rgb(43,145,175)"&gt;InterestBiz&lt;/span&gt;&amp;gt;();&lt;br /&gt;            &lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; baseDay = _interestBiz.GetBaseDaysFromAccount(account);&lt;br /&gt;            &lt;span style="color: rgb(43,145,175)"&gt;Assert&lt;/span&gt;.AreEqual(365, baseDay, &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;Incorrect base days&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Fixed code:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;            _interestBiz = _mocks.PartialMock&amp;lt;&lt;span style="color: rgb(43,145,175)"&gt;InterestBiz&lt;/span&gt;&amp;gt;();&lt;br /&gt;            &lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; (_mocks.Record())&lt;br /&gt;            {&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; (_mocks.Playback())&lt;br /&gt;            {&lt;br /&gt;                &lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; baseDay = _interestBiz.GetBaseDaysFromAccount(account);&lt;br /&gt;                &lt;span style="color: rgb(43,145,175)"&gt;Assert&lt;/span&gt;.AreEqual(365, baseDay, &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;Incorrect base days&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So even though no expectations were set Rhino Mocks needs to no this.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-8732092476170645393?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8732092476170645393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8732092476170645393'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/05/rhino-mocks-partial-mock-not-calling.html' title='Rhino Mocks - Partial mock not calling base method'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-4239934294715390669</id><published>2008-05-01T12:40:00.001Z</published><updated>2008-05-01T12:40:29.904Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rhino.Mocks'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Good Rhino.Mocks introduction / tutorial</title><content type='html'>&lt;p&gt;Good Rhino.Mocks introduction / tutorial &lt;a href="http://weblogs.asp.net/stephenwalther/archive/2008/03/22/tdd-introduction-to-rhino-mocks.aspx"&gt;here&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-4239934294715390669?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4239934294715390669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4239934294715390669'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/05/good-rhinomocks-introduction-tutorial.html' title='Good Rhino.Mocks introduction / tutorial'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-6671197770009572820</id><published>2008-05-01T09:53:00.001Z</published><updated>2008-05-01T09:53:24.087Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# Threading : Workers processing list</title><content type='html'>&lt;p&gt;Using ThreadSafeQueue class as list of items to process. &lt;/p&gt;  &lt;p&gt;Class used as a worker, takes list as parameter, creates a thread to run in.&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;MyWorker&lt;br /&gt;&lt;/span&gt;    {&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Thread&lt;/span&gt; _myThread;&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Thread&lt;/span&gt; WorkerThread&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: rgb(0,0,255)"&gt;get&lt;/span&gt; { &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; _myThread; }&lt;br /&gt;            &lt;span style="color: rgb(0,0,255)"&gt;set&lt;/span&gt; { _myThread = &lt;span style="color: rgb(0,0,255)"&gt;value&lt;/span&gt;; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: rgb(43,145,175)"&gt;ThreadSafeQueue&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt;&amp;gt; _listOfNumbers;&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; NumbersProcess = &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;.Empty;&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; total=0;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; MyWorker(&lt;span style="color: rgb(43,145,175)"&gt;ThreadSafeQueue&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt;&amp;gt; listOfNumbers)&lt;br /&gt;        {&lt;br /&gt;            _listOfNumbers = listOfNumbers;&lt;br /&gt;            _myThread = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Thread&lt;/span&gt;(&lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;ThreadStart&lt;/span&gt;(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.DoProcess));&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; DoProcess()&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; _localInt=0;&lt;br /&gt;            &lt;span style="color: rgb(0,0,255)"&gt;do&lt;br /&gt;&lt;/span&gt;            {&lt;br /&gt;                &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (_listOfNumbers.TryDequeue(&lt;span style="color: rgb(0,0,255)"&gt;out&lt;/span&gt; _localInt))&lt;br /&gt;                {&lt;br /&gt;                    total = total + _localInt;&lt;br /&gt;                    NumbersProcess = NumbersProcess + _localInt.ToString() + &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;, &amp;quot;&lt;/span&gt;;&lt;br /&gt;                }                &lt;br /&gt;            } &lt;span style="color: rgb(0,0,255)"&gt;while&lt;/span&gt; ((!_listOfNumbers.NoMoreItems) ||&lt;br /&gt;                     (_listOfNumbers.NoMoreItems) &amp;amp;&amp;amp; (_listOfNumbers.Count &amp;gt; 0));&lt;br /&gt;        }&lt;br /&gt;    }&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Calling process creates 5 workers then populates list, then waits for workers to finish processing:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,128,0)"&gt;//Queue to hold numbers to process&lt;br /&gt;&lt;/span&gt;            &lt;span style="color: rgb(43,145,175)"&gt;ThreadSafeQueue&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt;&amp;gt; listOfInts = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;ThreadSafeQueue&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt;&amp;gt;();&lt;br /&gt;            &lt;br /&gt;            &lt;span style="color: rgb(0,128,0)"&gt;//5 worker objects (threads)&lt;br /&gt;&lt;/span&gt;            &lt;span style="color: rgb(43,145,175)"&gt;MyWorker&lt;/span&gt;[] workers = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;MyWorker&lt;/span&gt;[5];&lt;br /&gt;            &lt;span style="color: rgb(0,0,255)"&gt;for&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; i = 0; i &amp;lt; workers.Length; i++)&lt;br /&gt;            {&lt;br /&gt;                workers[i] = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;MyWorker&lt;/span&gt;(listOfInts);&lt;br /&gt;                workers[i].WorkerThread.Start();&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: rgb(0,128,0)"&gt;//Populate list to process&lt;br /&gt;&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;for&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 1000; i++)&lt;br /&gt;            {&lt;br /&gt;                listOfInts.Enqueue(i);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: rgb(0,128,0)"&gt;//Flag that no more items will be added to queue&lt;br /&gt;&lt;/span&gt;            listOfInts.NoMoreItems = &lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt;;&lt;br /&gt;            &lt;br /&gt;            &lt;span style="color: rgb(0,128,0)"&gt;//Wait for workers to finish then display details&lt;br /&gt;&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;foreach&lt;/span&gt; (&lt;span style="color: rgb(43,145,175)"&gt;MyWorker&lt;/span&gt; worker &lt;span style="color: rgb(0,0,255)"&gt;in&lt;/span&gt; workers)&lt;br /&gt;            {&lt;br /&gt;                worker.WorkerThread.Join(); &lt;span style="color: rgb(0,128,0)"&gt;//Wait for worker to finish processing.&lt;br /&gt;&lt;/span&gt;                tbxDetail.Text=tbxDetail.Text+&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;.Format(&lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;Numbers processsed {0} \n&amp;quot;&lt;/span&gt;,worker.NumbersProcess);&lt;br /&gt;            }&lt;br /&gt;            tbxDetail.Text = tbxDetail.Text + &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;.Format(&lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;\n\n&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-6671197770009572820?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/6671197770009572820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/6671197770009572820'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/05/c-threading-workers-processing-list.html' title='C# Threading : Workers processing list'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-1134066340039736609</id><published>2008-04-29T08:22:00.001Z</published><updated>2008-04-29T08:22:33.370Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# Constructors</title><content type='html'>&lt;p&gt;See full discussion &lt;a href="http://aspalliance.com/770_Constructors_in_C"&gt;here&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Base&lt;/h2&gt;  &lt;p&gt;&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; myClass() : &lt;span style="color: rgb(0,0,255)"&gt;base&lt;/span&gt;()    &lt;br /&gt;&lt;/p&gt;  &lt;h2&gt;Overload&lt;/h2&gt;  &lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;myClass&lt;br /&gt;&lt;/span&gt;    {&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; myClass()&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: rgb(0,128,0)"&gt;//No parameters&lt;br /&gt;&lt;/span&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; myClass(&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; param1) : &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;()&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: rgb(0,128,0)"&gt;//No parameters will be called before me!&lt;br /&gt;&lt;/span&gt;        }&lt;br /&gt;    }&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-1134066340039736609?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/1134066340039736609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/1134066340039736609'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/04/c-constructors.html' title='C# Constructors'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-9158109674297115827</id><published>2008-04-28T13:12:00.001Z</published><updated>2008-04-28T13:12:21.061Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Asp.Net : "A first chance exception"</title><content type='html'>&lt;p&gt;Getting huge amount of &amp;quot;A first chance exception&amp;quot; messages when running web-site under IDE for first time (after a rebuild).&lt;/p&gt;  &lt;p&gt;These were being reported because programmer had turned off 'Just my code' within Tools-&amp;gt;Options-&amp;gt;Debugging-&amp;gt;General&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-9158109674297115827?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/9158109674297115827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/9158109674297115827'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/04/aspnet-first-chance-exception.html' title='Asp.Net : &amp;quot;A first chance exception&amp;quot;'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-173797984435472483</id><published>2008-04-22T14:30:00.002Z</published><updated>2008-12-04T12:11:35.121Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sql Server'/><title type='text'>SQL Server : Query on date and HQL</title><content type='html'>&lt;p&gt;Date format is 'YYYY-MM-DD'&lt;/p&gt;  &lt;p&gt;e.g.&lt;/p&gt;  &lt;p&gt;select * from orders where Date='2008-04-22'&lt;/p&gt;  &lt;br /&gt;&lt;br /&gt;HQL (as literal)&lt;br /&gt;&lt;p&gt;from Activity a where a.Date between '2008-01-01' and '2008-02-29'&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-173797984435472483?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/173797984435472483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/173797984435472483'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/04/sql-server-query-on-date.html' title='SQL Server : Query on date and HQL'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-2886409489738442901</id><published>2008-04-03T14:03:00.001Z</published><updated>2008-04-03T14:03:02.789Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Bind Dictionary to WinForm ComboBox</title><content type='html'>&lt;p&gt;To bind a dictionary to a combo box:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;pre class="code"&gt;            cmbTable.DisplayMember = &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;Key&amp;quot;&lt;/span&gt;;&lt;br /&gt;            cmbTable.ValueMember = &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;Value&amp;quot;&lt;/span&gt;;&lt;br /&gt;            cmbTable.DataSource = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;BindingSource&lt;/span&gt;(myDictionary, &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;); &lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-2886409489738442901?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2886409489738442901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2886409489738442901'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/04/bind-dictionary-to-winform-combobox.html' title='Bind Dictionary to WinForm ComboBox'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-804445796282356658</id><published>2008-03-07T15:09:00.002Z</published><updated>2008-03-07T15:16:30.206Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net Validators'/><title type='text'>Validators and hidden fields</title><content type='html'>It seems that there is a strange bug with validators.&lt;br /&gt;&lt;br /&gt;If the field that is being validated is hidden in some circumstances a Java error " 'null' is null or not a object"&lt;br /&gt;&lt;br /&gt;This doesn't happen on all servers / clients, the problem on site was produced on the clients IIS but on our one wasn't showing, this is with the same code running.&lt;br /&gt;It also didn't happen with a previous version that had one less validator.&lt;br /&gt;&lt;br /&gt;The solution was to move the validators next to the actual fields that were being validated. The validation messages were being shown in a validator summary.&lt;br /&gt;&lt;br /&gt;The only way I could reproduce it in the office, was to move the post buttons off the Update panel and to do a full postback. This error continued to happen on site, even if I disabled the validators for the hidden control.s&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-804445796282356658?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/804445796282356658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/804445796282356658'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/03/validators-and-hidden-fields.html' title='Validators and hidden fields'/><author><name>Tim</name><uri>http://www.blogger.com/profile/11427512862731521239</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-7446288369652510916</id><published>2008-02-12T12:57:00.001Z</published><updated>2008-02-12T12:57:29.014Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>IIS Asp.Net (Apparently) Bizzarro (turns out) lack of understanding</title><content type='html'>&lt;p&gt;Had apparently strange goings on with IIS &amp;amp; Asp.Net.&lt;/p&gt;  &lt;p&gt;Delivered new mylibrary.dll. User renamed mylibrary.dll to &amp;quot;old mylibrary.dll&amp;quot;, copied in new mylibrary.dll. Got error saying 'old mylibrary.dll' could not be loaded into manifest.&lt;/p&gt;  &lt;p&gt;After deleting the 'old mylibrary.dll' files the web site loaded ok.&lt;/p&gt;  &lt;p&gt;After a discussion we came to the conclusion that IIS loads all the DLL files in the BIN directory irrespective of references within Web.Config.&lt;/p&gt;  &lt;p&gt;The site then throws exception when two dlls contain the same Assembly-name - this also makes sense.&lt;/p&gt;  &lt;p&gt;So what appeared to be strange behaviour came down to not thinking logically!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-7446288369652510916?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7446288369652510916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7446288369652510916'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/02/iis-aspnet-apparently-bizzarro-turns.html' title='IIS Asp.Net (Apparently) Bizzarro (turns out) lack of understanding'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-9126042459418971871</id><published>2008-02-04T11:04:00.001Z</published><updated>2008-02-04T11:04:01.293Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Asp.Net Ajax Calendar Extender</title><content type='html'>&lt;p&gt;There is a bug with the AJAX calendar extender in that the style of the popup calendar are not applied if the text-box /calendar extender are hidden when a page first loads.&lt;/p&gt;  &lt;p&gt;e.g. Panel with Details on is only shown once valid record found; if the first calendar extender on the page is within this hidden Details panel the calendar will not be displayed correctly when Details does become visible:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.google.com/SteveFairWebAlbum/R6bxFeDncqI/AAAAAAAAACk/J5QZd-BmH_g/image%5B2%5D"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="144" alt="image" src="http://lh3.google.com/SteveFairWebAlbum/R6bxGeDncrI/AAAAAAAAACs/fRah_hqrjyY/image_thumb" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;To fix this have a hidden calendar extender at top of the page:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: rgb(0,128,0)"&gt;&amp;lt;!-- Workaround for Calendar not displaying correctly - if hidden when page first loads --&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&amp;quot;display: none&amp;quot;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&amp;quot;textbox1&amp;quot;&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;cc1&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;CalendarExtender&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&amp;quot;ceTextBox1&amp;quot;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;TargetControlID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&amp;quot;textbox1&amp;quot;&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Calendar is then displayed correctly:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh3.google.com/SteveFairWebAlbum/R6bxHeDncsI/AAAAAAAAAC0/NO4FaApRW8A/image%5B5%5D"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="156" alt="image" src="http://lh6.google.com/SteveFairWebAlbum/R6bxIODnctI/AAAAAAAAAC8/dbU5i7v-fuE/image_thumb%5B1%5D" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-9126042459418971871?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/9126042459418971871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/9126042459418971871'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/02/aspnet-ajax-calendar-extender.html' title='Asp.Net Ajax Calendar Extender'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-8455320263466531529</id><published>2008-01-28T17:15:00.000Z</published><updated>2008-01-29T10:17:35.530Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Crystal Reports Asp.Net issues</title><content type='html'>&lt;h4&gt;&lt;strong&gt;Deployed Crystal Reports to server by:&lt;/strong&gt;&lt;/h4&gt;  &lt;blockquote&gt;   &lt;p&gt;Run CRRedist2005_x86.msi (taken from C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\CrystalReports\)&lt;/p&gt; &lt;/blockquote&gt;  &lt;h4&gt;&lt;strong&gt;Icons did not display in CR Toolbar:&lt;/strong&gt;&lt;/h4&gt;  &lt;blockquote&gt;   &lt;p&gt;Copy C:\Inetpub\wwwroot\aspnet_client to root of website)&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;ADO provider not found (SQL Server 2000):&lt;/strong&gt;&lt;/h4&gt;  &lt;blockquote&gt;   &lt;p&gt;Report (design-time) connection was SQL-Native changed to be SQLOLEDB.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;Change connection information at run-time&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; CrystalDecisions.Shared.TableLogOnInfo tliCurrent;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in crSource.ReportDocument.Database.Tables)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tliCurrent = tbCurrent.LogOnInfo;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tliCurrent.ConnectionInfo.ServerName = server;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tliCurrent.ConnectionInfo.UserID = username;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tliCurrent.ConnectionInfo.Password = password;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tliCurrent.ConnectionInfo.DatabaseName = dbname; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tbCurrent.ApplyLogOnInfo(tliCurrent);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;Toolbar Not working&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;The toolbar options were not working because a post-back was being generated that performs the functionality - the assigning of the report was within a !IsPostBack block. As the report is not held in state it must be reloaded during post back.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-8455320263466531529?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8455320263466531529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8455320263466531529'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/01/crystal-reports-aspnet-issues.html' title='Crystal Reports Asp.Net issues'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-5678894763209265928</id><published>2008-01-21T15:56:00.001Z</published><updated>2008-01-21T15:56:54.965Z</updated><title type='text'>NHibernate transaction locking oops!</title><content type='html'>&lt;p&gt;Was testing catching NHibernate.StaleObjectStateException (exception where one user updates a record which another user then attempts to update without getting newer version).&lt;/p&gt;  &lt;p&gt;Was getting 'Failed to initialise lazy...&amp;quot; when reloading record on associated collection due to a timeout and also appeared to be locking the server (no queries could be run on tables involved in failed update)&lt;/p&gt;  &lt;p&gt;It came down to the transaction not being Rolled-back when exception thrown - so obviously DB still in transaction.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-5678894763209265928?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5678894763209265928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5678894763209265928'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2008/01/nhibernate-transaction-locking-oops.html' title='NHibernate transaction locking oops!'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-8029722705783250872</id><published>2007-11-26T17:30:00.001Z</published><updated>2007-11-26T17:30:02.809Z</updated><title type='text'>Databinding NHibernate</title><content type='html'>&lt;p&gt;Had a few problems data-binding lists returned from NHibernate (queries or collections) where the first object in the list was a proxy. We previously 'fixed' this by clearing the session prior to running the query. This then caused further problems as objects were detached and the lazy-lists threw exceptions.&lt;/p&gt;  &lt;p&gt;The solution we came to is based on : &lt;a href="http://www.ayende.com/Blog/archive/2006/07/25/7397.aspx" target="_blank"&gt;This posting by Ayende&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A TypeDescriptor was created for EntityBase (all our objects returned from NHibernate inherit from EntityBase) which was registered with the web-site in the Global.asax Application_StartUp.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-8029722705783250872?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8029722705783250872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8029722705783250872'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/11/databinding-nhibernate.html' title='Databinding NHibernate'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-2280957249235543905</id><published>2007-11-22T14:52:00.001Z</published><updated>2007-11-22T14:52:24.137Z</updated><title type='text'>Configuration Error: FairmortRoleProvider</title><content type='html'>&lt;p&gt;When creating a new site we kept getting spurious errors which seemed to relate to &amp;quot;add name=FairmortRoleProvider....&amp;quot; line of Web.Config. &lt;/p&gt;  &lt;p&gt;This was a red herring and the actual error related to Spring Config files and references.&amp;#xA0; The Salecore assemblies that are to be referenced must be added as a reference AND the relevant config files also added. Either missing reference or config file can cause this spurious error. &lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-2280957249235543905?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2280957249235543905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2280957249235543905'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/11/configuration-error-fairmortroleprovide.html' title='Configuration Error: FairmortRoleProvider'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-8418246493642179053</id><published>2007-10-25T10:41:00.001Z</published><updated>2007-10-25T10:41:24.445Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>VS2005 not rebuilding project</title><content type='html'>&lt;p&gt;Had an issue with a specific project not being rebuilt when changes made to it and web site being run. The solution contained multiple projects and none of the other projects exhibited this behavior.&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Appears due to Project being marked as not rebuild for Solution, although this setting was not turned on manually.&lt;/p&gt;  &lt;p&gt;Setting access via: Solution (right-click) Properties -&amp;gt; Configuration.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-8418246493642179053?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8418246493642179053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8418246493642179053'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/10/vs2005-not-rebuilding-project.html' title='VS2005 not rebuilding project'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-2613560361150527065</id><published>2007-09-24T11:57:00.001Z</published><updated>2007-09-24T11:57:26.193Z</updated><title type='text'>NHibernate Criteria aggregate (Sum,Max etc)</title><content type='html'>&lt;p&gt;It is possible to get NHibernate criteria to perform aggregations using the Projections class:&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;div class="code"&gt;   &lt;br /&gt; &lt;p&gt;public double SumHours(out double chargeable, out double nonchargeable)   &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; {    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; IList results;    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ICriteria crit = _session.CreateCriteria(typeof(Activity));    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ProjectionList projList = Projections.ProjectionList();    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; projList.Add(Projections.Sum(&amp;quot;ChargeableHours&amp;quot;));    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; projList.Add(Projections.Sum(&amp;quot;NonChargeableHours&amp;quot;)); &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; crit.SetProjection(projList);   &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; results=crit.List();    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; if (results.Count == 0)    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; {    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; chargeable = 0;    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; nonchargeable = 0;    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; else    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; {    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; chargeable = (double)(results[0] as object[])[0];    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; nonchargeable = (double)(results[0] as object[])[1];    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; } &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; return chargeable + nonchargeable;   &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;    &lt;hr /&gt;  &lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-2613560361150527065?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2613560361150527065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2613560361150527065'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/09/nhibernate-criteria-aggregate-summax.html' title='NHibernate Criteria aggregate (Sum,Max etc)'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-3931211434759607908</id><published>2007-09-13T12:25:00.001Z</published><updated>2007-09-13T12:25:32.855Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>FileUpload not working ~ no state information on postback</title><content type='html'>&lt;p&gt;Had a problem where the 'selected file' information was not coming through for a dynamically created FileUpload control. The problem was due to the FileUpload control being inluded on a Ajax UpdatePanel.&lt;/p&gt;  &lt;p&gt;FileUpload control will not work with an async postback (Ajax UpdatePanel) because the details of the file to upload are included in the Web Request of a full postback.&lt;/p&gt;  &lt;p&gt;See &lt;a href="http://weblogs.asp.net/leftslipper/archive/2007/03/30/why-don-t-file-uploads-work-during-async-postbacks.aspx" target="_blank"&gt;Eilons Liptons Blog&lt;/a&gt; for more details.&lt;/p&gt;  &lt;p&gt;Solution was to have a dedicated upload page.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-3931211434759607908?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/3931211434759607908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/3931211434759607908'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/09/fileupload-not-working-no-state.html' title='FileUpload not working ~ no state information on postback'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-6655484583824006278</id><published>2007-09-06T15:15:00.001Z</published><updated>2007-09-06T15:16:26.378Z</updated><title type='text'>Instantiating arrays</title><content type='html'>Always seem to forget the syntax for instantiating arrays in code:&lt;br /&gt;&lt;br /&gt;int [] numbers = new int[] {3,1,4};&lt;br /&gt;string [] names = new string[] {"Tom", "Dick", "Harry"};&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-6655484583824006278?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/6655484583824006278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/6655484583824006278'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/09/instantiating-arrays.html' title='Instantiating arrays'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-7933808698892199023</id><published>2007-09-03T10:11:00.000Z</published><updated>2007-09-03T10:18:47.239Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Validation of viewstate MAC failed... using AJAX UpdatePanel</title><content type='html'>Was getting the following error after a partial update of a component on an AJAX UpdatePanel:&lt;br /&gt;&lt;br /&gt;Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that &lt;machineKey&gt; configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster&lt;br /&gt;&lt;br /&gt;It seems the problem occurs because after the partial update the component include a GridView that used DataKeyNames. The use of DataKeyNames requires that view state is encrypted. &lt;br /&gt;I think the error occurred because this encryption was only taking place after the partial postback.&lt;br /&gt;&lt;br /&gt;The solution seems to be to always have view state encrypted ~ a page directive.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;viewStateEncryptionMode ="Always"&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-7933808698892199023?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7933808698892199023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7933808698892199023'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/09/validation-of-viewstate-mac-failed.html' title='Validation of viewstate MAC failed... using AJAX UpdatePanel'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-7774527446705035905</id><published>2007-08-30T13:30:00.000Z</published><updated>2007-08-31T09:53:19.607Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>Databind: Object does not match target type</title><content type='html'>This error sometimes occurs when trying to bind a result from a NHibernate query. It is caused by the first item in the list being a proxy value which causes the DataBind to use reflection of the proxy rather than the real target.&lt;br /&gt;&lt;br /&gt;Details and solution taken from &lt;a href="http://www.nablasoft.com/Alkampfer/?p=78"&gt;Alkampfer's Place&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Possible solution, requires object implements ICloneable:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;public IList&amp;lt;T&amp;gt; SafeList&amp;lt;T&amp;gt;(IList&amp;lt;T&amp;gt; input) where T : class, ICloneable {&lt;br /&gt;   //Symply check the type of the first element.&lt;br /&gt;   if (input.Count &gt; 0) input[0] = (T) input[0].Clone();&lt;br /&gt;  return input;&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If object does not implement IClonable then need to turn off Lazy loading in mapping file.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Final Solution&lt;/b&gt;&lt;br /&gt;As it was not pratical to make all objects ICloneable or to turn off lazy loading we finally settled on clearing the cache (Session.Clear) prior to executing queries or criterias.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-7774527446705035905?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7774527446705035905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7774527446705035905'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/08/databind-object-does-not-match-target.html' title='Databind: Object does not match target type'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-8511973047898612016</id><published>2007-08-29T10:13:00.001Z</published><updated>2007-08-29T10:18:43.682Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>LoginStatus - Login page URL</title><content type='html'>When using LoginStatus control the Login link goes to the page identified in the web.config:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;system.web&lt;br /&gt;   authentication mode="Forms"&lt;br /&gt;       forms loginurl="~/Default.aspx"&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-8511973047898612016?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8511973047898612016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8511973047898612016'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/08/loginstatus-login-page-url.html' title='LoginStatus - Login page URL'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-3315240973000888233</id><published>2007-06-15T14:25:00.001Z</published><updated>2007-06-15T14:29:53.540Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.net ServerControls'/><title type='text'>Problems with Properties showing in Property Editor with custom web server controls</title><content type='html'>I was creating a custom web sever control which was inherited from CompositeControl, I had removed a couple of editor properties, I then noticed that some properties were not being shown in the property editor after you switched between source and design view of a web page. To fix this I had to add in a new property, compile and use it, then take the new property back out again.&lt;br /&gt;I also had to take the reference of the object out of the web page and stick it back in again.&lt;br /&gt;All in all a pain in the bottom, and a waste of time!&lt;br /&gt;&lt;br /&gt;Dear MS why did you make the development of web controls so annoying, like having to put a new control on the screen everytime you make a change, and debugging the component in design mode what were you thinking!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-3315240973000888233?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/3315240973000888233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/3315240973000888233'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/06/problems-with-properties-showing-in.html' title='Problems with Properties showing in Property Editor with custom web server controls'/><author><name>Tim</name><uri>http://www.blogger.com/profile/11427512862731521239</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-4205410348026741411</id><published>2007-06-07T15:00:00.000Z</published><updated>2007-06-07T15:06:29.918Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>NHibernate:object references an unsaved transient instance</title><content type='html'>&lt;i&gt;"object references an unsaved transient instance"&lt;/i&gt; recieved when performing a save (and transactional commit).&lt;br /&gt;Caused by a related (parent) record not being saved and the entity not set up for cascading save.&lt;br /&gt;e.g. User record has link to Person record but when user is saved the linked person is not saved.&lt;br /&gt;Solution is either to turn on cascading saves for related entity or to explicity save the related record by creating a business object method.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-4205410348026741411?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4205410348026741411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4205410348026741411'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/06/nhibernateobject-references-unsaved.html' title='NHibernate:object references an unsaved transient instance'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-4635791461253639971</id><published>2007-06-05T10:26:00.000Z</published><updated>2007-06-05T12:47:54.549Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Ajax Extender Properties Gotchas</title><content type='html'>When you want to add a property to an Ajax Extender you need to do the following.&lt;br /&gt;&lt;br /&gt;Make sure you have installed the Ajax Extender Templates, run AjaxControlExtender.vsi from the AjaxControlExtender directory of your toolkit install.&lt;br /&gt;&lt;br /&gt;Create a new item using the ASP.NET Ajax Extender Control Template from my templates.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Note : If you set the namespace to have a . in it e.g. Company.AjaxControls then the Javascript will not be able to find the script as a webresource. If you want to do this then you have to manually change the ClientScriptResource attribute of the extender.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1) Create the C# Property in the controlExtender.cs file&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;[ExtenderControlProperty]&lt;br /&gt;[RequiredProperty]&lt;br /&gt;public string ExampleControl&lt;br /&gt;{&lt;br /&gt;get { return GetPropertyValue("ExampleControl", ""); }&lt;br /&gt;set { SetPropertyValue("ExampleControl", value); }&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;2) Create the JavaScript Property  in the controlBehaviour.js file&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;In the function(element) section, at the top of the page by the todo 1 to declare the property on the JavaScript side&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;this._ExampleControl = null;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Add the property getter and setters at the bottom of the file&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;get_ExampleControl : function() {&lt;br /&gt;   return this._ExampleControl;&lt;br /&gt;},&lt;br /&gt;&lt;br /&gt;set_ExampleControl : function(value) {&lt;br /&gt;   this._ExampleControl = value;&lt;br /&gt;},&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Note : The getter and setters are named get_(propertyname) and set_(propertyname). the asp.net Ajax controls expect the names in this form.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-4635791461253639971?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4635791461253639971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4635791461253639971'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/06/ajax-extender-properties-gotchas.html' title='Ajax Extender Properties Gotchas'/><author><name>Tim</name><uri>http://www.blogger.com/profile/11427512862731521239</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-5323513576254641027</id><published>2007-05-21T09:47:00.000Z</published><updated>2007-05-21T09:50:09.776Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>NHibernate, GetType on Proxy</title><content type='html'>When lazy loading is true the returned type from a db call will be a proxy, so if you call GetType() you will get the proxy type not the underlying class.&lt;br /&gt;To overcome this use NHibernateUtil.GetClass(object-instance).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-5323513576254641027?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5323513576254641027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5323513576254641027'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/05/nhibernate-gettype-on-proxy.html' title='NHibernate, GetType on Proxy'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-3371931424873355352</id><published>2007-05-11T09:52:00.000Z</published><updated>2007-05-11T09:53:54.064Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# Date encoding / parse</title><content type='html'>DateTime.Parse requires a Culture to be set to use a specific format.&lt;br /&gt;If the format is known then a better alternative is to use new DateTime(year,month,day).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-3371931424873355352?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/3371931424873355352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/3371931424873355352'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/05/c-date-encoding-parse.html' title='C# Date encoding / parse'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-1738892383270471833</id><published>2007-05-11T08:41:00.000Z</published><updated>2007-05-11T08:43:30.322Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# Windows dock overlap</title><content type='html'>Where panels etc are 'docked' in a windows form they can sometimes overlap (eg Left dock overlaps the Fill dock panel). To overcome this the overlapping panel must be 'Sent to Back'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-1738892383270471833?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/1738892383270471833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/1738892383270471833'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/05/c-windows-dock-overlap.html' title='C# Windows dock overlap'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-7870336414789032048</id><published>2007-04-23T16:45:00.000Z</published><updated>2007-04-23T16:48:15.205Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pop3'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows2003'/><title type='text'>Windows 2003 POP3 CatchAll</title><content type='html'>To facilitate a catch-all address on Windows 2003 you need to run the scripts downloaded from here:&lt;br /&gt;&lt;br /&gt;http://isorecorder.alexfeinman.com/catchall.htm&lt;br /&gt;&lt;br /&gt;These have been downloaded to Sever1\\Install\Microsoft\Windows2003\MailCatchAll&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-7870336414789032048?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7870336414789032048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7870336414789032048'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/04/windows-2003-pop3-catchall.html' title='Windows 2003 POP3 CatchAll'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-303659336786579096</id><published>2007-04-11T11:00:00.000Z</published><updated>2007-04-11T11:02:20.497Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>PageRequestManagerParserErrorException exporting grid</title><content type='html'>Had code to export grid but was receiving the error PageRequestManagerParserErrorException.&lt;br /&gt;This appears to be due to the Export button being on a Ajax UpdatePanel and the ScriptManager having PartialUpdates set to false.&lt;br /&gt;There doesn't currently appear to be any work around to fix this other than the button being removed from the UpdatePanel.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-303659336786579096?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/303659336786579096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/303659336786579096'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/04/pagerequestmanagerparsererrorexception.html' title='PageRequestManagerParserErrorException exporting grid'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-5537191333412384028</id><published>2007-04-05T12:43:00.000Z</published><updated>2007-04-05T12:45:05.840Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>NHibernate:Unknown entity class:</title><content type='html'>Error "Unknown entity class: &lt;classname&gt;"  occurs when either no mapping file exists for specifed &lt;classname&gt; or the mapping file is not flagged as embedded resource.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-5537191333412384028?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5537191333412384028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5537191333412384028'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/04/nhibernateunknown-entity-class.html' title='NHibernate:Unknown entity class:'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-5134935424861263182</id><published>2007-04-03T15:46:00.000Z</published><updated>2007-04-03T15:49:21.936Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>AJax Calendar extender date format</title><content type='html'>The date format of the Calendar extender seesm to be mm/dd/yyyy.&lt;br /&gt;To change it to culture specific:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Set Page Culture="auto"&lt;/li&gt;&lt;li&gt;Set Page UICulture="auto"&lt;/li&gt;&lt;li&gt;Set ScriptManager EnableScriptGlobalization="true"&lt;/li&gt;&lt;li&gt;Set ScriptManager EnableScriptLocalization="true"&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-5134935424861263182?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5134935424861263182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5134935424861263182'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/04/ajax-calendar-extender-date-format.html' title='AJax Calendar extender date format'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-8446585994923978866</id><published>2007-03-28T08:50:00.000Z</published><updated>2007-03-28T08:57:25.789Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>GridView : Getting updated cell values</title><content type='html'>When using a gridview the RowUpdating event arguments has a property (e.)NewValues.&lt;br /&gt;There is a problem if the GridView datasource is not set to s DataSourceObject, these NewValues remain blank.&lt;br /&gt;To populate use the following code:&lt;br /&gt;&lt;blockquote&gt;        GridView gv = (GridView)sender;&lt;br /&gt;       for (int i = 0; i &lt; gridView.Columns.Count; i++)&lt;br /&gt;       {&lt;br /&gt;           DataControlFieldCell cell = gv.Rows[e.RowIndex].Cells[i] as DataControlFieldCell;&lt;br /&gt;           gv.Columns[i].ExtractValuesFromCell(e.NewValues, cell, DataControlRowState.Edit, true);&lt;br /&gt;       }&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-8446585994923978866?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8446585994923978866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8446585994923978866'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/gridview-getting-updated-cell-values.html' title='GridView : Getting updated cell values'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-7752692779884353130</id><published>2007-03-26T11:10:00.000Z</published><updated>2007-03-26T11:12:27.544Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>Nhibernate: Date  time field null on insert</title><content type='html'>Receiving exception when trying to save a record the stack tarce identified theproblem as a null value for a DateTime field.&lt;br /&gt;This is caused by either:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Property not marked as nullable (? after Type in property declaration)&lt;/li&gt;&lt;li&gt;Existing record being flushed that contains an invalid null value for datetime.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-7752692779884353130?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7752692779884353130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7752692779884353130'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/nhibernate-date-time-field-null-on.html' title='Nhibernate: Date  time field null on insert'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-5068841479906741399</id><published>2007-03-26T11:06:00.000Z</published><updated>2007-03-26T11:10:03.783Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>NHibernate: Object not set to instance on save</title><content type='html'>When saving I received 'Object not set to instance', from the stack trace the object in question was identified as the VerisionNo.&lt;br /&gt;This was correctly defined for the table in question, after investigation it was identifeid as being a link table that was being flushed which had an existing  record with a &lt;span style="font-style: italic;"&gt;Null&lt;/span&gt; value for the VersionNo.&lt;br /&gt;This record had been either manually entered or entered prior to the versionNo field being defined as NotNull.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-5068841479906741399?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5068841479906741399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/5068841479906741399'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/nhibernate-object-not-set-to-instance.html' title='NHibernate: Object not set to instance on save'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-1041719878548610790</id><published>2007-03-23T11:38:00.000Z</published><updated>2007-03-23T11:41:04.472Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>RowDataBound checking if row is in edit mode</title><content type='html'>The RowState property of a grid row can hold more than one value using bitwise logic.&lt;br /&gt;If you want to test if a row is in edit mode then use:&lt;br /&gt;&lt;br /&gt;if ((e.Row.RowState &amp; DataControlRowState.Edit) &gt; 0)&lt;br /&gt;&lt;br /&gt;The RowState will also have a value of DataControlRowState.Alternate  for every other row.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-1041719878548610790?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/1041719878548610790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/1041719878548610790'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/rowdatabound-checking-if-row-is-in-edit.html' title='RowDataBound checking if row is in edit mode'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-2169866181860384993</id><published>2007-03-22T15:50:00.000Z</published><updated>2007-03-22T15:55:49.548Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>GridView : DIsplaying results of function using DataItem as parameter</title><content type='html'>Instead of just displaying the actual value of a field in a column (&lt;%# Bind("Hours") %&gt;) you can also call a function that uses the value to get another value.&lt;br /&gt;e.g.&lt;br /&gt;If we have ClientID but we want to display ClientName  (another tabel in the db) we can assign:&lt;br /&gt;    Text='&lt;%# GetClientName(DataBinder.Eval(Container.DataItem, "ClientID")) %&gt;'&lt;br /&gt;&lt;br /&gt;We then have a function in the page code:&lt;br /&gt;&lt;br /&gt;    protected string GetClientName(object iD)&lt;br /&gt;    {&lt;br /&gt;        return GetClientNameById(iD);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;Note. the parameter must be defined as object because the actual type is unknown until binding.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-2169866181860384993?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2169866181860384993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2169866181860384993'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/gridview-displaying-results-of-function.html' title='GridView : DIsplaying results of function using DataItem as parameter'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-7483705983854696231</id><published>2007-03-22T12:06:00.000Z</published><updated>2007-03-22T12:08:34.919Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>Spring: Error instantiating context spring.root</title><content type='html'>Had the exception "Error instantiating context spring.root" when attempting to create an object.&lt;br /&gt;This was caused by not including the assembly reference that the object belonged to in the web site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-7483705983854696231?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7483705983854696231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7483705983854696231'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/spring-error-instantiating-context.html' title='Spring: Error instantiating context spring.root'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-4978274484472821841</id><published>2007-03-13T10:13:00.000Z</published><updated>2008-12-10T05:05:32.773Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='UpdatePanel'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Updatepanel : Making other panels visble/invisible</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_99r6zKFRXH4/RfZ84fLhg4I/AAAAAAAAAAw/No7gawP9_bA/s1600-h/UpdatePanel1.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_99r6zKFRXH4/RfZ84fLhg4I/AAAAAAAAAAw/No7gawP9_bA/s320/UpdatePanel1.jpg" alt="" id="BLOGGER_PHOTO_ID_5041354142772200322" border="0" /&gt;&lt;/a&gt;Had a problem making multiple panels visible / invisible inside an UpdatePanel. The problem was occurring when I wanted to display different panels based on wether a user was logged in or not.&lt;br /&gt;As an example I created the following user control with two panels which should alternatively be displayed.&lt;br /&gt;When the Top button is clicked the code was storing in a session object that the user is logged in.When the Top button is clicked the code was storing in a session object that the user is logged out. During the Render method of the contorl if the seesion object was set to Logged In then the bottom panel was set visible=true and the top panel set to visible=false (and vice versa when logged out)&lt;br /&gt;This worked, until another UpdatePanel on the page performed a partial postback, then both panels were being displayed.&lt;br /&gt;&lt;br /&gt;Assumption of what was happening: The problem seems to be that the setting of the visible=true|false was being made in the wrong place. Setting the values in the Render method mean that they are not then stored on the control state; when a different updatepanel performs a partial postback it appears the control state is used to identify what elements of the page need updating. In the above case both panels has visible=true set in the control state.&lt;br /&gt;Fix: To fix the problem the setting of the panel visibilty was moved to the PreRender method (after PreRender, SaveState is called, the Render).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-4978274484472821841?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4978274484472821841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4978274484472821841'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/updatepanel-making-other-panels.html' title='Updatepanel : Making other panels visble/invisible'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_99r6zKFRXH4/RfZ84fLhg4I/AAAAAAAAAAw/No7gawP9_bA/s72-c/UpdatePanel1.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-8774376254229682524</id><published>2007-03-13T10:08:00.000Z</published><updated>2007-03-13T10:12:29.821Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Validators'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Validators not working in UpdatePanel after partial postback</title><content type='html'>There is a problem with Validator controls not being displayed in (Ajax) UpdatePanel after another updatepanel performs a partial postback.&lt;br /&gt;&lt;br /&gt;i.e. Validators work fine when page is first loaded; then another UpdatePanel control performs a partial postback; the original validator is no longer displayed.&lt;br /&gt;&lt;br /&gt;This is dues to a problem with release v1 of Asp Ajax. A patch is to be released to fix this, alternatively compatible controls can be downloaded&lt;br /&gt;&lt;br /&gt;See this &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/01/25/links-to-asp-net-ajax-1-0-resources-and-answers-to-some-common-questions.aspx"&gt;link &lt;/a&gt;for more details&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-8774376254229682524?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8774376254229682524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8774376254229682524'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/validators-not-working-in-updatepanel.html' title='Validators not working in UpdatePanel after partial postback'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-4170214082452791683</id><published>2007-03-12T16:45:00.000Z</published><updated>2007-03-13T10:08:22.489Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Validators &amp; Multi-view</title><content type='html'>Validators don't (seem to) work in MultiView view.&lt;br /&gt;&lt;br /&gt;May be due to Ajax v1 &amp;amp; validators see above.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-4170214082452791683?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4170214082452791683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4170214082452791683'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/validators-multi-view.html' title='Validators &amp; Multi-view'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-9059710440559984370</id><published>2007-03-08T14:54:00.000Z</published><updated>2007-03-08T15:04:13.500Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>NHibernate Flush before Query</title><content type='html'>Was having a problem with following:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Start Session&lt;/li&gt;&lt;li&gt;Read object/record (presentation layer)&lt;/li&gt;&lt;li&gt;Update record/object im memory (presentation layer)&lt;/li&gt;&lt;li&gt;Run query to check changes valid (biz layer).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If 4 ok commit changes inside transaction (biz layer)&lt;/li&gt;&lt;li&gt;End session&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Step 4 was identifying a problem and so steps 5 was not completed (i.e. no explicit Commit was called), the problem was that the record changes were still being written to the database.&lt;br /&gt;&lt;br /&gt;This is caused by the FlushMode of the session be set to Auto. When set to auto NHibernate will sometimes flush the persistent obejct prior to performing a query.&lt;br /&gt;&lt;br /&gt;There are a few solutions to this:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Perform updates to object after query (not applicable in this case due to layers)&lt;/li&gt;&lt;li&gt;Disconnect object prior to updating (Evict)&lt;/li&gt;&lt;li&gt;Change FlushMode to Commit &lt;/li&gt;&lt;/ul&gt;The solution decided upon was to change FlushMode to Commit and to also clear the session if a transaction fails and rollback is called.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-9059710440559984370?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/9059710440559984370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/9059710440559984370'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/nhibernate-flush-before-query.html' title='NHibernate Flush before Query'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-4585644905176489659</id><published>2007-03-06T15:28:00.000Z</published><updated>2007-03-06T15:32:51.053Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Error on DataBind() of DropDownList:, invalid SelectedValue</title><content type='html'>Getting error:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;dropdownlist&gt; has a SelectedValue which is invalid because it does not exist in the list of item&lt;/dropdownlist&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The SelectedValue before the databind is set to "" (i.e. blank string)&lt;br /&gt;The error occurs because the data being bound does not include a value of "" (blank string).&lt;br /&gt;&lt;br /&gt;To fix it:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Set AppendDataBoundItems=true for control&lt;/li&gt;&lt;li&gt;Clear the list prior to databind; &lt;control&gt;.Items.Clear();&lt;/li&gt;&lt;li&gt;Add a blank item: &lt;control&gt;.Items.Add(new ListItem("", ""));   &lt;/li&gt;&lt;li&gt;Call &lt;control&gt;.DataBind();&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-4585644905176489659?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4585644905176489659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/4585644905176489659'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/error-on-databind-of-dropdownlist.html' title='Error on DataBind() of DropDownList:, invalid SelectedValue'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-1543630862894064209</id><published>2007-03-05T16:11:00.000Z</published><updated>2007-03-07T09:28:53.442Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDictionary'/><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>How to map to a Generic IDictionary</title><content type='html'>Say you have a standard nHibernate Bag that maps to a IList&lt;br /&gt;&lt;br /&gt;C# Definition&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;public virtual IList&amp;lt;UserGroup&amp;gt; Groups;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;nHibernate Mapping&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;&amp;lt;bag name="UserGroups" table="UserGroup"&amp;gt;&lt;br /&gt;    &amp;lt;key column="UserID"/&amp;gt;&lt;br /&gt;    &amp;lt;one-to-many class="UserGroup"/&amp;gt;&lt;br /&gt;&amp;lt;/bag&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;You can change this to a IDictionary by changing the IList to a IDictionary in the Business Entity, then change the bag to a map,and adding a index setting to the nHibernate mapping.&lt;br /&gt;&lt;br /&gt;So the above would be changed to &lt;br /&gt;&lt;br /&gt;C# Definition&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;public virtual IDictionary&amp;lt;int,UserGroup&amp;gt; Groups;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;nHibernate Mapping&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;&amp;lt;map name="UserGroups" table="UserGroup"&amp;gt;&lt;br /&gt;    &amp;lt;key column="UserID"/&amp;gt;&lt;br /&gt;    &amp;lt;index column="GroupID" type="int"/&amp;gt;&lt;br /&gt;    &amp;lt;one-to-many class="UserGroup"/&amp;gt;&lt;br /&gt;&amp;lt;/map&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Where of course the index column is the column that you will search on, and the type is the type of the column.&lt;br /&gt;&lt;br /&gt;NOTE - The Key Column and the Index column cannot be the same, but then thinking about that it would be pointless because the key value would be the same on all the keys of the dictionary.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-1543630862894064209?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/1543630862894064209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/1543630862894064209'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/how-to-map-to-generic-idictionary.html' title='How to map to a Generic IDictionary'/><author><name>Tim</name><uri>http://www.blogger.com/profile/11427512862731521239</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-6149591887963499334</id><published>2007-03-05T12:08:00.000Z</published><updated>2007-03-05T12:10:50.161Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>NHibernate error loading class</title><content type='html'>Got the error:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;Could not load type '...Page, SalecoreContent', check that type and assembly names are correct&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Was caused by an incorrect &lt;span style="font-style:italic;"&gt;class="Page"&lt;/span&gt; reference in one of the object mapping files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-6149591887963499334?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/6149591887963499334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/6149591887963499334'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/nhibernate-error-loading-class.html' title='NHibernate error loading class'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-6823037919219086562</id><published>2007-03-02T16:07:00.000Z</published><updated>2007-03-02T16:08:06.957Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>nHibernate Get or Load?</title><content type='html'>Session.Get and Session.Load do very similar things, the difference is.&lt;br /&gt;&lt;br /&gt;.Get will return null if a record is not found.&lt;br /&gt;.Save will return an exception if a record is not found, and if it can use a proxy, it will return a proxy, so you won't get the exception until you try to actually use the object.&lt;br /&gt;&lt;br /&gt;If you are not sure that a record exists then use .Get and check that the object isn't null.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-6823037919219086562?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/6823037919219086562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/6823037919219086562'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/nhibernate-get-or-load.html' title='nHibernate Get or Load?'/><author><name>Tim</name><uri>http://www.blogger.com/profile/11427512862731521239</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-7329505819007700830</id><published>2007-03-02T15:30:00.000Z</published><updated>2007-03-02T15:39:17.396Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>NHibernate:How do I know a field is dirty?</title><content type='html'>The problem arose that I needed to know if a field had changed just prior to saving:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Presentation layer reads object/record&lt;/li&gt;&lt;li&gt;Presentation layer changes object field value&lt;/li&gt;&lt;li&gt;Presentation layer calls business layer to update the object/record&lt;/li&gt;&lt;li&gt;Business layer needs to know if a certain field has changed to perform extra processing&lt;/li&gt;&lt;/ol&gt;When the record is read (in step 4) from the database it actually comes from the (session) cache and therefore holds the values of the changed (but not yet persisted) fields.&lt;br /&gt;&lt;br /&gt;The solution seems to be either clear the cache or tell the business object that the field has changed. The clear-the-cache solution was not tried, would have been along the lines of Session.Evict(object).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-7329505819007700830?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7329505819007700830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7329505819007700830'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/03/nhibernatehow-do-i-know-field-is-dirty.html' title='NHibernate:How do I know a field is dirty?'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-2975223522788079244</id><published>2007-02-27T17:04:00.000Z</published><updated>2007-02-27T17:12:53.830Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='HQL'/><title type='text'>HQL Query - as, in errors</title><content type='html'>Tried to do a simple query:&lt;br /&gt;&lt;div class="code"&gt;from Page page&lt;/div&gt;&lt;br /&gt;returned error ..expected in...&lt;br /&gt;&lt;br /&gt;Tried &lt;br /&gt;&lt;div class="code"&gt;from Page as page&lt;/div&gt;&lt;br /&gt;return error ..unexpected token:as..&lt;br /&gt;&lt;br /&gt;After an hour of frustration realised that the object in C# was not called Page (I had renamed this to SalecorePage as it classed with the asp.net class:page).&lt;br /&gt;&lt;br /&gt;The use of the wrong name stemmed from performing the query in SQL Server then porting to HQL.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-2975223522788079244?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2975223522788079244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2975223522788079244'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/02/hql-query-as-in-errors.html' title='HQL Query - as, in errors'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-7657169709609830944</id><published>2007-02-27T10:13:00.000Z</published><updated>2007-02-27T10:15:53.693Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Configuration - unknown class</title><content type='html'>Tripped me up a couple of times, the System.Configuration must be manually added as a reference to a project otherwise the Configuration class is unknown.&lt;br /&gt;For some reason I always assume this reference is added by default then spend a while wondering why VS claims Configuration class is not part of System.Configuration!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-7657169709609830944?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7657169709609830944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7657169709609830944'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/02/configuration-unknown-class.html' title='Configuration - unknown class'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-8456172497567067482</id><published>2007-02-26T10:00:00.000Z</published><updated>2007-02-26T10:03:25.021Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Asp.Net Adding a javascript confimation message box to button click</title><content type='html'>To add a javascript confimation (message) box to the click of a button add the following to the Page_Load():&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;btnDelete.Attributes["onclick"] = "return confirm('Are you sure you want to delete this record?');";&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-8456172497567067482?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8456172497567067482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8456172497567067482'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/02/aspnet-adding-javascript-confimation.html' title='Asp.Net Adding a javascript confimation message box to button click'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-8751469380531474818</id><published>2007-02-26T09:50:00.000Z</published><updated>2007-02-26T10:00:07.551Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>NHibernate - Record re-read not showing server updates</title><content type='html'>Has an issue where re-reading a record the record did not include updates that had happened on the server:&lt;br /&gt;1. Read USER record (e.g. Name=JOHN).&lt;br /&gt;2. Update USER record on server (e.g. set Name=MIKE).&lt;br /&gt;3. Read USER record again. Name is still JOHN.&lt;br /&gt;&lt;br /&gt;This implied the record is being read from the cache.&lt;br /&gt;The problem came down to the fact that the Data-access-object was being created as a Singleton which meant the Hibernate Session was not being opened and closed.&lt;br /&gt;The record will only be re-read from the server outside of Session (i.e. Hibernate will read the record from the cache if inside the same session).&lt;br /&gt;&lt;br /&gt;Solution was to change the Spring object mapping to not create the DAO as a singleton, this meant the session was being open/closed during page life cycle.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-8751469380531474818?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8751469380531474818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8751469380531474818'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/02/nhibernate-record-re-read-not-showing.html' title='NHibernate - Record re-read not showing server updates'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-3723996510014061001</id><published>2007-02-22T09:39:00.000Z</published><updated>2007-02-22T15:15:47.072Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# Enum, enumerated types</title><content type='html'>C# Enumerated type info&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Declaration:&lt;/span&gt;&lt;br /&gt;&lt;div class="code"&gt;enum MyType&lt;br /&gt;{&lt;br /&gt;One=1,&lt;br /&gt;Two=2&lt;br /&gt;};&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Assignment:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;int myVar = (int) MyType.One;&lt;br /&gt;MyType myVar2 = MyType.Two;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Getting name of value:&lt;br /&gt;&lt;div class="code"&gt;string enumName = MyType.One.ToString();&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Getting all values as string:&lt;br /&gt;&lt;div class="code"&gt;string[] enumNames = Enum.GetNames(typeof(MyType));&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Getting an Enum value from a string:&lt;br /&gt;&lt;div class="code"&gt;MyType myVar = (MyType)Enum.Parse(typeof(MyType),"One",true)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-3723996510014061001?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/3723996510014061001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/3723996510014061001'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/02/c-enum-enumerated-types.html' title='C# Enum, enumerated types'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-91381290438871499</id><published>2007-02-21T11:21:00.000Z</published><updated>2007-02-21T11:29:04.119Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# Lazy or full boolean evaluation?</title><content type='html'>C# allows for both full and lazy evaluation. For full evaluation use the single operators for And/Or (|/&amp;), for lazy evaluation use the double operators for And/Or (&amp;amp;amp;amp;amp;&amp;amp;/||).&lt;br /&gt;e.g.&lt;br /&gt;Full Evaluation&lt;br /&gt;&lt;div class="code"&gt;if ((sName==null) | (sName="~empty~"))&lt;br /&gt;...do something&lt;/div&gt;&lt;br /&gt;will cause an exception if sName is null as the second comparions (="~empty~") will be performed.&lt;br /&gt;&lt;br /&gt;Lazy Evaluation&lt;br /&gt;&lt;div class="code"&gt;&lt;empty&gt;&lt;empty&gt;if ((sName==null) || (sName="~empty~"))&lt;br /&gt;...do something&lt;/empty&gt;&lt;/empty&gt;&lt;/div&gt;&lt;br /&gt;will not cause an exception if sName is null because as the rest of the expression is an OR the result will be true irrespective of the rest of the expression, and so the rest of the expression is ignored.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-91381290438871499?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/91381290438871499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/91381290438871499'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/02/c-lazy-or-full-boolean-evaluation.html' title='C# Lazy or full boolean evaluation?'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-8726035893392533262</id><published>2007-02-19T15:57:00.000Z</published><updated>2007-02-19T17:19:54.850Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Grid-View : Select a row without "Select link"</title><content type='html'>You can use javascript to select a row in a grid-view by setting the rows onMouse and onCLick events:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;  protected void gvSettings_RowDataBound(object sender, GridViewRowEventArgs e)&lt;br /&gt;  {&lt;br /&gt;      if (e.Row.RowType == DataControlRowType.DataRow)&lt;br /&gt;      {&lt;br /&gt;          e.Row.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.textDecoration='underline';";&lt;br /&gt;          e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';";&lt;br /&gt;          e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.gvSettings, "Select$" + e.Row.RowIndex);&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;When DataBind() is called on the grid the events will be set for each row.&lt;br /&gt;Code taken from this &lt;a href="http://www.geekzilla.co.uk/View9FC28EE6-ACB0-4F51-BFE4-38B0B10134D5.htm"&gt;Geekzilla article&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.... further to this, if 'EnableEventValidation="true"' is on , which it is by default, the postback will cause an error: &lt;span id="intelliTXT"&gt;"Invalid  postback or callback argument"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;to overcome this you need to register each PostBack event in the Render fn of the page:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;foreach (GridViewRow r in gvSettings.Rows)&lt;br /&gt;        {&lt;br /&gt;            if (r.RowType == DataControlRowType.DataRow)&lt;br /&gt;            {&lt;br /&gt;                Page.ClientScript.RegisterForEventValidation(this.gvSettings.UniqueID,"Select$" + r.RowIndex);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-8726035893392533262?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8726035893392533262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/8726035893392533262'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/02/grid-view-select-row-without-select.html' title='Grid-View : Select a row without &quot;Select link&quot;'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-1239226794919158884</id><published>2007-02-19T12:41:00.000Z</published><updated>2007-02-19T18:07:15.266Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Getting a value from a control in the Page Init</title><content type='html'>The value of a control (e.g. textbox) is not available in PreInit. &lt;br /&gt;As the value may be required (e.g to generate dynamic controls, set theme) it can be retrieved by accessing Http Request:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;string selectedValue ;&lt;br /&gt;if (Request.Form["txtNoOfRooms"] != null)&lt;br /&gt; selectedValue = Request.Form["txtNoOfRooms"].ToString();&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Uses name of control to retrieve  value. Not each control only has 1 value.&lt;br /&gt;&lt;br /&gt;Example taken from this &lt;a href="http://www.codeproject.com/useritems/lifecycle.asp"&gt;article in Code Project&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-1239226794919158884?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/1239226794919158884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/1239226794919158884'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/02/getting-value-from-control-in-page-init.html' title='Getting a value from a control in the Page Init'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-7338659469797763420</id><published>2007-02-16T12:58:00.000Z</published><updated>2007-02-16T13:02:57.101Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>Setting a Page Theme</title><content type='html'>Setting a page theme programmatically can be troublesome as the theme can only be set in the Page PreInit. If the theme value is coming from a control on the page then the controls value is not available in the PreInit.&lt;br /&gt;The following solution was taken from : &lt;a href="http://odetocode.com/Blogs/scott/archive/2006/03/12/3091.aspx"&gt;(K.Scott Allen's) OdetoCode.Com&lt;/a&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;protected&lt;/span&gt;&lt;span style="color:black;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;span style="color:black;"&gt; Page_PreInit(&lt;/span&gt;&lt;span style="color:blue;"&gt;object&lt;/span&gt;&lt;span style="color:black;"&gt; sender, &lt;/span&gt;&lt;span style="color:teal;"&gt;EventArgs&lt;/span&gt;&lt;span style="color:black;"&gt; e)&lt;br /&gt;{&lt;br /&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;&lt;span style="color:black;"&gt; (IsPostBack)&lt;br /&gt; {&lt;br /&gt;     &lt;/span&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&lt;span style="color:black;"&gt; uniqueID = Request[_themeListIDKey];&lt;br /&gt;&lt;br /&gt;     &lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;&lt;span style="color:black;"&gt; (uniqueID != &lt;/span&gt;&lt;span style="color:blue;"&gt;null&lt;/span&gt;&lt;span style="color:black;"&gt; &amp;&amp;amp; Request[uniqueID] != &lt;/span&gt;&lt;span style="color:blue;"&gt;null&lt;/span&gt;&lt;span style="color:black;"&gt;)&lt;br /&gt;     {&lt;br /&gt;         Theme = Request[uniqueID];&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;protected&lt;/span&gt;&lt;span style="color:black;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;span style="color:black;"&gt; Page_Load(&lt;/span&gt;&lt;span style="color:blue;"&gt;object&lt;/span&gt;&lt;span style="color:black;"&gt; sender, &lt;/span&gt;&lt;span style="color:teal;"&gt;EventArgs&lt;/span&gt;&lt;span style="color:black;"&gt; e)&lt;br /&gt;{&lt;br /&gt; ClientScript.RegisterHiddenField(&lt;br /&gt;         _themeListIDKey, _themeList.UniqueID&lt;br /&gt;     );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;const&lt;/span&gt;&lt;span style="color:black;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&lt;span style="color:black;"&gt; _themeListIDKey = &lt;/span&gt;&lt;span style="color:maroon;"&gt;"_themeListIDKey"&lt;/span&gt;&lt;span style="color:black;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-7338659469797763420?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7338659469797763420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7338659469797763420'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/02/setting-page-theme.html' title='Setting a Page Theme'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-2102421752476920267</id><published>2007-02-15T16:35:00.000Z</published><updated>2007-02-15T17:11:56.346Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>NHibernate - a couple of transaction related issues</title><content type='html'>&lt;span&gt;A couple of issues with transactional updates&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;1. Timeout expired.&lt;/span&gt;&lt;br /&gt;A timeout expired error was occurring when attempting to update the same record (and field) twice within a single transaction.&lt;br /&gt;This only occurred when the database update was being performed.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution&lt;/span&gt;: When updating a record multiple times do not perform the Update until all field values have been updated.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. Illegal attempt to associate a collection with two open sessions &lt;/span&gt;&lt;br /&gt;This error was returned when attempting to update child records of a parent record as well as updating the parent record, where the child record was being read independent of the parent record.&lt;br /&gt;e.g&lt;br /&gt;&lt;div style="margin: 20px; font-size: smaller;"&gt;Parent record links to Child1 and Child2&lt;br /&gt;Parent record read (which implicity reads Child1 &amp;amp; Child2 and puts in list Parent.Children)&lt;br /&gt;Child1 record is read independently.&lt;br /&gt;Parent record Updated.&lt;br /&gt;Child1 record Updated.&lt;/div&gt;There is no need to explicity read and update the Child1 instance. The instance (from Parent) should be updated (in memory) instead.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-2102421752476920267?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2102421752476920267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/2102421752476920267'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/02/nhibernate-couple-of-transaction.html' title='NHibernate - a couple of transaction related issues'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-7162980426151504698</id><published>2007-02-15T12:02:00.000Z</published><updated>2007-02-15T12:10:59.823Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# Generics typecasting</title><content type='html'>Error being received:&lt;br /&gt;&lt;br /&gt;cannot implicity convert type ilist&lt;mytype&gt; to list&lt;mytype&gt;&lt;br /&gt;&lt;br /&gt;The error occurs when calling a function that returns an IList.&lt;br /&gt;e.g.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;IList&lt;int&gt; myFunction();&lt;br /&gt;....&lt;br /&gt;List&lt;int&gt; myVar = new List&lt;int&gt;;&lt;br /&gt;myVar=myFunction();&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;the error occurs on the assignment of myVar=myFunction.&lt;br /&gt;The local var myVar should be declared as IList.&lt;br /&gt;In the above instance the &lt;small&gt;new List&lt;int&gt;&lt;/int&gt;&lt;/small&gt; is not required because myFunction creates the instance.&lt;br /&gt;Correct code:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;IList&lt;int&gt; myFunction();&lt;br /&gt;....&lt;br /&gt;IList&lt;int&gt; myVar;&lt;br /&gt;myVar=myFunction();&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-7162980426151504698?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7162980426151504698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/7162980426151504698'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/02/c-generics-typecasting.html' title='C# Generics typecasting'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-134726735252370370.post-265024084533618644</id><published>2007-02-14T14:45:00.001Z</published><updated>2007-02-14T15:32:35.004Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><title type='text'>NHibernate save error.</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Error: "&lt;i&gt;object references an unsaved transient instance&lt;/i&gt;...."&lt;br&gt;&lt;/br&gt;This occurred when saving a object that had a 1:M relationship that was represented by a list.&lt;br&gt;&lt;/br&gt; &lt;br&gt;&lt;/br&gt; Parent --- child1&lt;br&gt;&lt;/br&gt;    --- child2&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;To fix the error add &lt;i&gt;cascade="all" &lt;/i&gt;to the  that represents the 1:M relationship in the DB Mapping file.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/134726735252370370-265024084533618644?l=steve-fair-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/265024084533618644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/134726735252370370/posts/default/265024084533618644'/><link rel='alternate' type='text/html' href='http://steve-fair-dev.blogspot.com/2007/02/blog-started.html' title='NHibernate save error.'/><author><name>Steve</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://lh6.google.com/image/SteveFairWebAlbum/RdSg74TiRuI/AAAAAAAAAAg/pzek-fxIDVU/IMG_1417.JPG'/></author></entry></feed>
