Create a Logs folder in the root of your website add this little snippy snappy snoo to your Global.asax file. This will catch all exceptions in your Asp.Net site and create a log file for you.
I'm not claiming credit for this code snippet, so if your reading this and discover I've copied some code from your blog, then you're probably right. The problem is I'm trying to keep little code snippets safe so I can refer back to them (hence, me adding this to my blog notepad) but I can't find the original source. If you are the source of this C# code then send me your link to original post and I'll credit you.
I've been doing some reading on Microsoft forums and I came across quite a lot of posts with questions about string manipulation using various Transact-Sql string manip. functions. It prompted me to start a post...
One of the questions was about extracting a portion of a string. Here's an example of how to extract a sub string from a string that has consistent seperation of parts. The following Sql will extract and print the third part (number 6717) from the string assigned to the @data variable.
I came across a problem the other day.....A developer had produced some sql for me that used the SUBSTRING function. I needed everything before a full stop (period):
e.g. I needed 1234 from 1234.efgdhyt
He programmed the method like this:
which gave me 123
Note:
Using SUBSTRING you must access the first character index using 1 not 0(zero), so the correct statement would be:
A page of useful resources for The State Software Design Pattern
About The State Design Pattern
The motivation for the State Design Pattern is to reduce code complexity by eliminating the need for complex conditional statements....
Don't pass the Context to the State
In Design Pattern, Elements of Reusable Object-Oriented Software (Gamma, Helm, Johnson, Vlissides) they write that the context obj. defines the interface of interest to the client. They also write that the context object can be passed through to the current state obj. so the state can access the context if necessary. This could be ok, but, you may want to seperate out concerns here. The context interface is defined for a client (presumably some presentation object) so we might not want the state to have access to the same interface, and at the same time, we may wish to expose other details to the state, details we don't want provide the client with. I written an article about this pattern and provided a good practical example. Take a look at Implementing The State Design Pattern in C#
Articles about The State Design Pattern
Implementing The State Design Pattern in C# by me.
This article gives motivation for use, provides useful resources and has a very good, and practical C# tutorial implementing the State Design Pattern.
The Command Design Pattern in C#The Command Software Design Pattern, also known as Transaction Script Software Design Pattern: A useful resources page...
Programming MVC2 is out with code
-
The sample code for my latest book *Programming ASP.NET MVC* (covers
version 2 and 2010) is available via the book's catalog page at Microsoft
Press site r...
Free as in Fortune Cookies
-
Trello has been out for less than two years and it’s been growing like
wildfire. We recently hit 1.5 million members, of whom about 1/3 perform
some acti...
How do you estimate on an Agile project?
-
If you’re interested in techniques for estimation, you should take a look
at this pdf ebook. It contains half-a-dozen essays on estimating in agile
proje...