C# How to get a QueryString value from the UrlReferrer

To get a QueryString value from the previous pages URL (aka: the UrlReferrer) you can use HttpUtility.ParseQueryString. Like this! NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(Request.UrlReferrer.Query); string keyword = nameValueCollection["kw"]; “And that’s all I have to say about that.”...

How To: NHibernate Parent/Child Relationships

So you’re trying to setup a Parent/Child relationship using NHibernate. This is easy enough when you allow the foreign keys to be null in your database. Of course this is not desirable for data integrity so you disallow nulls. Now NHibernate is pissed because it wants to insert the child row first then update it...

Extend Visual Studio 2005 DataSet Designer Using Partial Classes

One of my favorite features of Visual Studio 2005 is the easy to use DataSet designer. If you haven’t tried using the DataSet designer to create your data access layer try it out. Brian Noyes has written a nice tutorial here. However, one issue I have with the DataSet designer is that it doesn’t give...

Tutorial on how to open and read an email using C# and POP3

For a recent project I found a great tutorial on how to read and manipulate emails using POP3 on Developer Fusion. Two things you should note when trying this code. 1) POP3 protocol won’t actually delete the email until you call the QUIT command. If your application fails before you call the Disconnect() method, no...