Connecting Visual Studio 2013 with Git and Bitbucket

The first step you need to take is to setup Visual Studio to use the Git Provider. To do this you need to go to Tools -> Options and select the Git service provider. Then select the Open from Source Control option then under Local Git Repositories choose the Clone option and fill in your git settings for BitBucket. Now … Read More

Mike GriffithConnecting Visual Studio 2013 with Git and Bitbucket

Performance issue querying Linked Servers in SQL Server

When querying a linked server in SQL server there are basically two different ways to do it. Four Part Naming There is the four part naming method which calls the object directly while tacking on the linked server name to the table you are querying.

And this method is nice and simple, but it works by passing the full … Read More

Mike GriffithPerformance issue querying Linked Servers in SQL Server

Excluding certain fields in a SQL AVG field with a Case statement.

If you need to get an average of a field during a query, but exclude a few groups you can use a case statement inside of an AVG call to eliminate those groups from the average. All that you need to do is return a null for the value in the case statement. For example the following code will get … Read More

Mike GriffithExcluding certain fields in a SQL AVG field with a Case statement.

An elegant way to write XML with Linq

While writing out some XML to a file I found a lot nicer way to write out XML while using Linq and the XStreamingElement. The key is to use the XStreamingElement with data from a Linq datasource like so :

The above code will create the xml below (if the data is formatted correctly).:

As an added bonus … Read More

Mike GriffithAn elegant way to write XML with Linq

The importance of getting involved in your community to teach programming

Current Environment Lately there has been a lot of talk and work being done on teaching people to code. For example code.org and codecombat.com are some awesome examples that I really wish I’d had when I was growing up. But there is one thing that all of these wonderful sites can’t do and that and is to get out in … Read More

Mike GriffithThe importance of getting involved in your community to teach programming

The type initializer for ‘AutoMapper.TypeMapFactory’ threw an exception. Error with Automapper.

Recently while doing some conversions with Automapper I ran into an error while running it. I was getting the “The type initializer for ‘AutoMapper.TypeMapFactory’ threw an exception.” with an inner exception of “This type is not supported on this platform IDictionaryFactory”. After doing some debugging I finally figured out that it was due to the Automapper dll itself not being … Read More

Mike GriffithThe type initializer for ‘AutoMapper.TypeMapFactory’ threw an exception. Error with Automapper.

Replacing strings with the Filehelpers library.

While working at my current job I’ve been doing a lot of file imports and conversions, so to figure out a more efficient way to do the conversions I did some research and found the FileHelpers library. Now the FileHelpers library makes things very easy to do field conversions by creating attributes that you can connect to each record field … Read More

Mike GriffithReplacing strings with the Filehelpers library.

Building a Windows Service that periodically runs.

Here is some code I threw together to create a windows service that gets called periodically. To use it you’ll have to add this code into the Service class and create an application setting called PollingTime to contain the amount of time between calls of the process. Also note that if the process is still executing then it will block … Read More

Mike GriffithBuilding a Windows Service that periodically runs.

Setting up a Message Queue in SQL Server

Over the years I’ve had a few instances where I’ve had to set up a message queue with the broker in SQL Server and every time I come back to set up another queue I find the documentation to be very confusing. So here is my attempt to make the setup easier to follow. Please take note this has been … Read More

Mike GriffithSetting up a Message Queue in SQL Server

App.config transforms with Slow Cheetah

Recently while working on a console app that I was building for work I found myself missing the web.config transforms that are used in web projects. For those who don’t know you can build transform file that will change your web.config files depending on what build type you are running at the time. This comes in extremely useful when you … Read More

Mike GriffithApp.config transforms with Slow Cheetah