Tuesday, June 25, 2013

The operation on computer localhost has failed -- Hyper-V manager

Problem
Opening up Hyper-V manager results in the message, "The operation on the computer 'localhost' has failed", and none of your virtual machines appear. Whoa, that's scary.

Solution
Restart Windows Management Instrumentation service

Reference
 1. http://social.technet.microsoft.com/Forums/windowsserver/en-US/74363e9d-fb91-4ca7-b8f8-fddc85dd5d31/hyperv-reports-the-operation-on-computer-localhost-failed-cannot-manage-vms

Wednesday, June 12, 2013

Format a phone number in Report Builder 3.0

Problem
I need to format a numeric phone number to the format (###) ###-#### Ext. #### on a Reporting Services report in Report Builder 3.0

Solution 

Format(Convert.ToDouble(Fields!Phone.Value), "(###) ###-####  'Ext.' ####")

reference
http://www.developmentnow.com/g/115_2013_1_0_0_646635/format-phone-numbers.htm

Wednesday, June 5, 2013

Sitemap generator

Someone wanted a sitemap for our company website. So I started out by Googling for sitemap generators. After all, this seems like a rather simple tool and there should be plenty.

I tried out a few, including Google Sitemap Generator. This ended up not really working at all. I followed the manual and everything and it just wouldn't work.

So finally I threw my hands up and said "Fuck this, i'm a programmer." Less than an hour later I had completed a simple sitemap generator that would work for my needs.

I only have ASP.NET pages, with dynamic content, but no dynamically generated pages, so all I really needed to do was traverse my website's directory structure and write out XML in the sitemap format.

I used this site to validate outputted sitemap file: http://www.xmlcheck.com/checkfile.php

Here's the code:
There was an error in this gadget