Thursday, January 24, 2008

SQL Server - Include column headers when copying or saving results

If you ever copy and paste your query results from SQL Server Management Studio into Excel or Notepad, you will definitely want to check this option under Tools - Options (Query Results - SQL Server - Results to Grid). Otherwise you will not get the column headers.

Wednesday, January 16, 2008

FontConverter.ConvertFromInvariantString - Add Italics

I didn't find the MSDN documentation very complete when it came to this. It was fairly obvious that I could feed "Verdana, 15.75pt" into the ConvertFromInvariantString method and get the right font returned, but I wasn't sure how to make that Italic. Since I am using this to skin my application, I wanted to put this string in a config file.

FontConverter fc = new FontConverter();Font headerFont = (Font)fc.ConvertFromInvariantString("Verdana, 15.75pt, style=Italic");

Monday, January 7, 2008

How to create a screenshots of modal dialogs in Windows Vista!

This is one that was bugging the hell out of me. I've been using Windows Vista for a while now and have been trying to keep the User Account Control on, but slowly tweak it so that it is usable. One of the problems I kept running into was that certain User Account Control dialogs were globally modal and prevented me from getting screenshots. The only thing they allowed you to do was click "Allow" or "Cancel." I couldn't find anything online to resolve this and even the Windows Vista Snipping Tool wouldn't work. Ultimately, I found my answer in the security options for User Account Control:
  1. Open the Start - Run menu and type secpol.msc.
  2. Navigate to Security Settings - Local Policies - Security Options.
  3. Disable "User Account Control: Switch to the secure desktop when prompting for elevation."
  4. Voila! You can now use PrtScn and Alt+PrtScn or the Windows Vista Snipping Tool like before.

Wednesday, January 2, 2008

MSDN Webcast Portal - Seven Deadly Clicks!

First let me say that if you haven't checked out the WPF Soup To Nuts Webcast Series, I highly recommend it. My only problem here is that it takes a total of seven clicks to get to the content! Come on...where's that Web 2.0 experience?! If only they could throw these on MSDN Channel9.