Code 39 Mod 43 Checksum

I needed to do some work with barcodes recently, specifically I needed to handle Code 39 Mod 43 barcodes. Given a barcode string this function should return the relevant Mod 43 checksum. public class Code39     {         ///<summary>         ///Returns the expected checksum for the specified barcode         ///</summary>         ///<param name="barcode"></param>         ///<returns></returns>         public string ValidateMod43(string barcode)         {             int subtotal = 0;             const string …

3

Log4Net Custom Appender

Log4Net is an excellent logging framework which neatly separates the specifics of your logging implementation from your business logic. The upshot is that you can write code such as Log.Error("An error occured") in your code, and configure the logging somewhere else (usually app/web.config). To actually process the output you use Appenders. Log4Net has several built in appenders for logging to …

Shocking Gotcha – ASP.NET user controls not being referenced

Sometimes I just want to quit and take up kite flying or something… I was extending a feature for a site that used a user control called that had a class name of controls_searchboxui embedded in an aspx page. The new functionality meant that further user controls were to be created and only one of them would be programitcally added …

Subsonic

Just a quick recommendation to anyone fed up of writing long-winded Data Access Layers. Take a moment to check out Subsonic. Subsonic Download Page Subsonic takes a lot of the time out of Data Access development by generating a DAL for you, all you need to do is specify the connection to your database and voila you get strongly typed …

Visual Studio Hotfix rollup

If you’re using VS2008 for web development, you will probably want to download the following hotfix which fixes some performance/usability issues. See Scott Guthrie’s post for more info.

1

Nmock Gotcha about Reference Parameters

I wrote a method in a view that cause me no end of grief when testing its presenter the other day. I’ll elaborate on this a little more when I get the time but for now, here are the bones of the issue: public bool TrySetSummaryContent(string content, out Exception raisedError)         {             raisedError = null;             try             {                 webBrowser.DocumentText = content;             } …

Upgrading to Visual Studio 2008

Visual Studio 2008 allows you to work on .net 2 projects without conversion to the new .net 3.5 framework, but there are a couple of issues to look out for. When you open a 2005 solution file in Orcas Beta 2, you will find that it wants to convert the solution and project files. You can then choose whether to …

Resharper

Having used Resharper for about 2 months I can definitely recommend it. It’s a hard one to describe because as soon as you mention the words “Productivity” and “Tool” people tend to switch off. Simply put, it enhances the VS2005 IDE and makes common tasks much more straightforward. I am primarily using it with C# although VB.NET is partially supported …

Visual Studio 2008

OK, so I have no first-hand proof of this yet, but there are certainly some promising features that we can expect with VS2008. For me the main ones (for asp.net development) are: Improved design-time support for CSS Generally faster Designer LINQ Javascript Intellisense Scott Guthrie has blogged about several of these features so (as always) I recommend checking out his blog. This week …