Author: Jamie

  • SQL Server ALTER TABLE ADD Column

    This article covers SQL Server ALTER TABLE ADD Column Statement. In addition, we will learn how to add a value for the columns in the default value and update a value later in a large table. You must also add new columns to a table to be added by database developers.

    I would have thought it would be a little difficult adding columns in SQL Server databases. Occasionally, you may add the columns in SQL Server management studio itself. That’d be perfect for a smaller table that doesn’t have many transactional items to add column SQL on an existing table using structured query language.
    (more…)

  • Knockout – Uncaught ReferenceError: Unable to process binding

    If you’ve used Knockout.js in your project to process binding, at some point or another you’ve probably encountered the following error message Uncaught ReferenceError: Unable to process binding. The most likely cause is a typo somewhere or forgetting to change the context. E.g. you are within a foreach binding and forget to use $parent especially inside your jquery HTML template.

    (more…)

  • CASE Statement in SQL (Practical Examples)

    What is a SQL case statement? Well, it’s much like a switch statement in a development language. It allows you to test several different cases for a field and determine what you would like to do for each one with SQL Server.

    (more…)

  • Catching multiple exceptions with C#

    Exception handling with Try/catch blocks are a part of my everyday life. But I’m not a fan of catching all exceptions. I prefer handling only the ones I expect to be thrown in specific situations where I want to explicitly do catching multiple exceptions. Of course I can accomplish this with multiple catch blocks, but when they all do common things I would like a simpler way to avoid code duplication. Another great example would be how to use C# Convert any value to a boolean.

    (more…)

  • Updating specific fields using Entity Framework

    Entity framework does a great job of detecting when a field changes on any object that it is tracking. These changes will be automatically saved when SaveChanges is executed. As I discussed in Why the Repository Pattern I like to create an example Generic Class that is type T where T is a Model or a User in my Entity Framework Context. This example will extend upon those context query to retrieve the modified entry.

    (more…)