Justin Cooney

Web Development Tips and Examples

  • GridView Example
    GridView Example

    So what’s the simplest way to build a Web-based interface for a basic database table? In this article I’ll provide a fully working example with a minimum of code.

    This is a useful feature to be able to put together, especially when you are catering to power users who should be able to help maintain their own data without needing to call you each time. (more…)

  • SQL Server
    SQL Server

    A quirk about converting between the FLOAT and the VARCHAR data types in SQL Server is the unexpected rounding that will happen. This is specific to working with the FLOAT data type, and the rounding will not happen when casting a DECIMAL or an INTEGER. (more…)

  • iTextSharp to PDF
    iTextSharp to PDF

    When working with the iTextSharp PDF generation libraries for C#, you can use the XMLWorkerHelper object to export a Web page to PDF format. However while doing so you will run into the question of how best to serve the PDF up to your users.

    Bottom line here is that you have two ways of doing so:

    1. You can stream the PDF document directly to the client browser
    2. You can create the PDF on the Web Server’s hard-drive and then redirect the client browser to the file

    Each method has its pros and cons which you will have to weigh when deciding which technique to use.

    At the end of this article I will give the example code in C# of how to generate a PDF using each of these two techniques.

    Feel free to read some other articles I have written about using the iTextSharp PDF generation libraries with your .NET code.
    (more…)