Wednesday, June 18, 2008

"Although I feel perfectly comfortable in a set-based world writing SQL, it has traditionally been one of my least favorite areas of coding. Besides being relatively repetitive and tedious, at least when it comes to basic CRUD operations, sprocs are much more difficult to handle when it comes to source control, versioning, debugging, and unit testing."

and

"Regardless of the approach taken, I definitely no longer believe that sprocs should play any significant role in any application."

I couldn't agree more!  Read the full article: http://www.caffeinatedcoder.com/just-say-no-to-manual-crud/

 

Barry

blogs | c# | code | SQL Server
6/18/2008 11:57:40 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, June 04, 2008

The introduction of Automatic Properties in C# 3 (VS 2008) means that the snippet for creating properties (prop) now generates a singleline of: public type Property { get; set;}
However, if you are working in .Net 2 and still want to use the old snippet, just follow the link below. (adds a propc snippet that generates the .Net 2 properties ;)

http://wpfcontrols.blogspot.com/2008/01/vs-2008-property-code-snippet.html


6/4/2008 12:45:10 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, June 02, 2008
6/2/2008 5:35:29 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, May 15, 2008
A while ago, I came across an interesting work around for getting the latitude and longitude from Google Maps. It can be quite difficult to get the lat&lon - usually you have to get the link to the page and from that get the lat&lon.

Now, there is an easier way. If you create a bookmark or a link on a bookmark toolbar pointing to:

javascript:void(prompt('',gApplication.getMap().getCenter()))

You get the current lat&lon in the popup box once you click on your bookmark ;)

5/15/2008 5:45:56 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, May 09, 2008
XHTML Strict validation - one of the things that Tsuko insisted during our work on SPT - helped me to discover an interesting behaviour of the ASP.NET with the W3.org validator.

ASP.NET 2 has a built in functionality that affects the way controls are rendered. This can be controlled by inserting a <xhtmlConformance mode="Strict|Transitional|Legacy" /> tag in the web.config - the default is Transitional. However, even though you choose the strict mode, W3.org validation fails. This is caused by the fact that the w3 validator is treated as a lesser browser.

So in order to get the validation working, you need to create a w3cvalidator.browser file in the ~/App_Browsers folder and add the following content to the file

<browsers>
<!--
Browser capability file for the w3c validator

sample UA: "W3C_Validator/1.305.2.148 libwww-perl/5.803"
-->
<browser id="w3cValidator" parentID="default">
<identification>
<userAgent match="^W3C_Validator" />
</identification>

<capture>
<userAgent match="^W3C_Validator/(?'version'(?'major'\d+)(?'minor'\.\d+)\w*).*" />
</capture>

<capabilities>
<capability name="browser" value="w3cValidator" />
<capability name="majorversion" value="${major}" />
<capability name="minorversion" value="${minor}" />
<capability name="version" value="${version}" />
<capability name="w3cdomversion" value="1.0" />
<capability name="xml" value="true" />
<capability name="tagWriter" value="System.Web.UI.HtmlTextWriter" />
</capabilities>
</browser>
</browsers>

read the whole article at http://idunno.org/archive/2005/01/01/216.aspx

5/9/2008 5:17:02 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, May 01, 2008

When you add a WMS:Lister control to the actual article template (e.g. a "News Detail" template) the lister may break.  This is because the "ItemIdentifier" attribute is repeated twice on the page!

For example: Say you have an article page that uses <!-- item --> to identify the region of the page the PatternFile refers to, if you then add an actual lister control to the page you end up with two <!-- item --> comments (see below). Once in teh new lister and once for the article!

  <ez:Lister ID="scrollingNews" runat="server" PageSize="4" 
     SortBy="Date" SortDirection="Desc" PatternFile="~/NewsPattern.txt" ItemFileExtension="*.aspx"
     ItemDirectory="~/News" PagerStyle="None" ItemIdentifier="<!-- item -->"
     CreateCacheIndex="true" FilterKey="Section" FilterValue="">
     <HeaderTemplate><span id="news_listing"></HeaderTemplate>
     <ItemTemplate>
       <a href="<%# ((ListerItem)Container.DataItem).Link %>">
        <wg:PlainText MaxLength="80" Text='<%# ((ListerItem)Container.DataItem).GetValue("text") %>' runat="server" />...
       </a>
     </ItemTemplate>
    <FooterTemplate></span></FooterTemplate>
  </ez:Lister>

The fix is simply to leave the ItemIdentifier attribute out of any Lister control.  The default value is <!-- item -->, so you only need the attribute if you need a different value.

:)

code | WMS
5/1/2008 11:57:00 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, April 30, 2008
This I have seen in so many situations and have just found the link today again.

Quite entertaining - See here

4/30/2008 5:26:22 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback

Article on:

How to Use Gmail Filters to Organize and Manage your Email Accounts

http://tinyurl.com/4zfo6d

4/30/2008 5:21:24 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback
Fun
4/30/2008 1:13:39 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, April 16, 2008
This looks really interesting, esp. as a way to quickly generate admin areas (eg easybreaks or even the Config are in the WMS?) with a lot of power/customisation.

http://www.hanselman.com/blog/PuttingASPNETDynamicDataIntoContext.aspx

This sounds (when it is released properly) like a godo replacement for (the now old) TEdit controls.


4/16/2008 10:20:16 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback