Author: Christopher Patterson

Visual Studio 2010 Publish Command from msbuild Command line

Seems like there a bunch of confusion about how to produce the “Publish” behavior provided by Visual Studio 2010 from msbuild 4 command line. The question I keep seeing over and over again is: How do I publsih the output of a web application with web.config tranformations included. This should get the job done: msbuild […]

ASP.NET MVC and Ruby on Rails Open Source Examples

Recently, I started hosting some “play” projects on GitHub. I have not had much time to write anything up on the details of these projects but I figured I would share the code anyway. First, the MyPhotos example is a jumping off point for a personal photo catalog. Second, the ShowOff project is a real […]

ASP.NET MVC Helper – Dynamic Forms based on Model

Recently, I was working with a fairly complex data model that required a simple input form. Being the lazy programmer I am, I did not feel like crunching out the HTML required to generate this form by hand. So instead, I wrote an HTML helper class to generate the form for me. Model Here is […]

How to identify slow running queries in Sql Server

Recently, I was trying to pin point the queries in an application that were causing Sql Server to spike the CPU at 100%. This query was helpful in finding the top offenders. SELECT creation_time ,last_execution_time ,total_physical_reads ,total_logical_reads ,total_logical_writes ,execution_count ,total_worker_time ,total_elapsed_time ,total_elapsed_time / execution_count avg_elapsed_time ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1 ,((CASE statement_end_offset WHEN -1 THEN DATALENGTH(st.text) […]