Being able to compare the results of two different SQL queries and verify that they match 100% is a useful ability for any database application developer. I've encountered two main reasons for wanting to compare query results in the course of development:

  1. After importing data from an older system, verifying that equivalent reports in the old system and the new one agree
  2. When refactoring a complex query, to verify that the changes made haven't altered the output

In both cases, I find it convenient to run data comparisons of queries run in SQL Server Query Analyzer by using MS Excel. The ...

The MSDN Library says this about the DataGrid.Items property:

"Only items bound to the data source are contained in the Items collection. The header, footer, and separator are not included in the collection."

So how do we get to these other items? Most people handle the ItemCommandEvent for the grid, but there is a way to access them directly.

If these items are not in the DataGrid.Items collection, then where are they? To find out, turn on tracing for your ASP.NET webpage. You will see that the grid is rendered something like this:

DataGrid
   DataGridTable
      DataGridItem
         TableCell
         TableCell
      DataGridItem
         TableCell
         LiteralControl
         Label
      DataGridItem
      ...

What ...











I love working with MS SQL Server. Oh sure, Oracle is supposedly faster and all that jazz, but when it comes to rapid development, MSSQL's ease of use just can't be beat. However, there are still some things to watch out for. Today I want to warn you all off of using UNION.

Conceptually, there's nothing wrong with UNION. It takes two result sets with congruent columns and returns them as a single result set. There are two potential performance issues, however, one of which can be quite serious.

The first problem is that the UNION operator automatically performs a DISTINCT ...

DPack is a collection of free tools that extend the VS IDE. I originally got it because of the Delphi keyboard shortcut scheme, but I've come to appreciate for many of its other features, especially Surround With, which surrounds selected code with many different kinds of code constructs, and the Code Browser, which incrementally searches code for members matching a filter expression. Get it at http://www.usysware.com/dpack/

Add vertical guidelines to Visual Studio by adding a simple registry key to this location:

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1\Text Editor]

Now, add a string value named "Guides".

Set its value to something like RGB(128,0,0) 80, 100

The setting above will draw a Red guideline in Visual Studio at column 80 and 100. You can  have up to 13 guidelines. Adjust the values as you see fit.

Giving credit where credit is due, I believe Sara Ford first blogged about this about a year ago.