At work, we had to do wildcard searches using regular expressions to match allowed domain names. For instance, this expression “*.madskristensen.dk” should match “www.madskristensen.dk”. So, my boss Jimmi wrote a method...
In C# 2.0 Microsoft introduces some new methods on the String class, one of them being Contains. The Contains method checks if a string in contained within another string in a case-sensitive way. It is very easy to use...
I’ve just finished a small application that does some IO work on files and directories. The application moves directories to new locations, but every time a folder or file was marked read-only it would of course throw an...
Isolated Storage is a place on the disk where your .NET application always has write permissions. That makes it ideal for applications that need to store information such as settings or XML without first asking for...
As you may know by now, I’m a big fan of Rockford Lhotka’s CSLA.NET framework and base classes. It’s packed with all sorts of cool functionality and I’ve used it for several years in various projects, but often I’ve...
Recently, I had to implement validation on business objects in an already existing project. The validation should ensure that the different classes in the business object tier would validate them selves based on business...
It’s a good rule of thumb to overload the equality operators on classes. That ensures a correct comparison between to class instances of the same type. If you don’t, .NET automatically uses reflection and that is way...
Whenever you write class libraries, custom control or just about anything else, you probably raise a lot of home made events. That’s a simple thing to do, but tedious to write over and over again. That’s why I always use...
I’m sure you’ve used a DataRow a thousand times before without noticing the quirk. I’m not talking about a bug or missing functionality. No, I’m talking about something much less important, but still very puzzling. A...
There are some features in the System.Data.DataTable class that a lot of developers don’t utilize. I base that statement on different code samples I’ve seen on blogs and article bases during the last couple of years...