Articles in the ‘Code Samples’ Category

Connection Timeout Using LINQ DataContext Published August 13, 2010 by Dave under ASP.NET, Code Samples, LINQ

For a while now, I’ve had a website that was sporadically encountering the following error:

Serializing Data with System.Runtime.Serialization.DataContractSerializer Published March 6, 2010 by Dave under Cash Tracker, Code Samples

Last time we discussed Serializing Data with System.Xml.Serialization.XmlSerializer. We will be using the same sample solution for this article.

Serializing Data with System.Xml.Serialization.XmlSerializer Published March 6, 2010 by Dave under Code Samples

Serializing objects is often a useful way to save the state of an application. Let’s take a look at doing this using the XmlSerializer object.

Version Checking with System.Version Published March 4, 2010 by Dave under Code Samples

The .Net Framework makes version checking extremely simple. The framework provides a Version class that implements IComparable. Comparing two versions is as easy as the code below:

C# Method to Add an Image to a PDF Published November 16, 2009 by Dave under Code Samples

I had to write a method to put images onto PDFs generically, so I wrote this handy little method. Just get your PDF and your image into byte arrays and fire the method below. I used PDFSharp to append the image. This method could be used to do things like build a letterhead generator or any other kind of PDF document generation.

Code Sample: ASP.Net Message Control Published July 5, 2009 by Dave under Code Samples

Relaying information snippets and error messages is one of the most common tasks between web application developers. The most basic control this can be done with is the Literal. That’s great for an internal application or a school project, but in the real world information has to be both visually appealing and convey what the message is about using an icon or other form of illustration.


©2012 www.geekscrapbook.com