When writing queries that group and aggregate, it is not uncommon for there to be many columns in the SELECT clause that are neither in the GROUP BY clause nor being aggregated. For example, in a customer orders database, suppose you want a query that returns customer names, telephone numbers, and total order amount. A correct, but somewhat naive solution would go like this:

select c.Name, c.Phone,  sum( o.Amount )  as Amount_sum
from Customers c
join Orders o  on o.CustomerID = c.CustomerID
group  by c.Name, c.Phone

This will return the desired results, but in my experience, will not deliver ...

I was working on some code today, that was trying to find a string in a list of strings. I came up with a neat way to express it using a lambda expression.

The original code looked something like this:

public  static  void f( List<string> assemblies )
{
     // ...  if (assemblies.Contains(file.Name))
         // ...
}
Start with your master video, starting from the point after you would record your intro and ending before the point you would record your exit.  Then...
  1. In Camtasia, go to Tools -> Camtasia Audio Editor -> Create new audio file. 
  2. Record your intro and exit audio files here and save them in your project folder, the length of the recordings is not important. 
  3. Next create your intro and exit images and copy them into your project folder. 
  4. Now, in Camtasia, go to "Import Media" in the Add menu bar on the left side of the application. 
  5. Import both media files and both images....

This article presents some interesting ideas on when and when not to use AJAX.

http://dev.opera.com/articles/view/stop-using-ajax/

This week I needed a particular VisualStudio 2005 project template called "ASP.NET AJAX-enabled Web site" and I could not get it to show up.  Here is how I fixed it.  You might also find these instructions interesting if you are simply trying to use Ajax in VS2005. 

Whalla!  VisualStudio 2005 is now Ajax enabled!

As a note, I tried installing all of these things in all different orders and it never showed up.  I had to uninstall to fix ...

First of all, when discussing the three methods, you need to understand two concepts: session and scope. Session means the current connection that's executing the command. Scope means the immediate context of a command. Every stored procedure call executes in its own scope, and nested calls execute in a nested scope within the calling procedure's scope. Likewise, a SQL command executed from an application or SSMS executes in its own scope, and if that command fires any triggers, each trigger executes within its own nested scope.

Now that these two concepts are defined, here are the differences between the three ...

You can't run MSI or CAB files "As Administrator" directly from the explorer in Vista. The installer will fail when it needs to run something in elevated privileges. This is exactly what happened to me when installing Telerik Reports and it attempted to "CREATE DATABASE". There is no "Run as Administrator" context menu in this case, so the quick work around is:

  • Locate the Start Menu | All Programs | Accessories | Command Prompt. Right-click and click "Run as Administrator".
  • Now find your CAB or MSI file and run it from the command line where it will run ...

I am attending the ALT.NET open spaces conferences this weekend.  The opening was last night and was my introduction to the whole open spaces concept (see the video of the opening at Jeffery Palermo's web site).  So many of the bloggers that I follow are attending.  It was great to meet them. 

Open spaces, for those who do not know, allows anyone to propose (and lead) a topic.  So they take a sticky and write down the topic and their name (and tell everyone about their topic) and then stick it in an open time slot on the board.  ...

If you want to set the same value on a whole set of rows, you can use ActiveFocus powerful multi edit feature to save time.

First, check all the items that you want to change:

image

Next, go to the Selected Items section of the Navigation Bar - you will see the selected items:

image

Now, set whatever common values you want in the details area, and click Save

image

The change is applied to all the selected items:

image

This past weekend I finally decided to take the plunge and upgrade my Windows Vista Home Premium to Vista Ultimate on my desktop machine, mostly because I wanted to be able to use Remote Desktop, and the home versions don't include it.  I did a fair amount of research, trying to reassure myself that I wouldn't have to do a complete rebuild, but even so, I did a full system backup to my 500G external hard drive just to be sure. 

Actually, the upgrade was easier than I expected.  The Vista DVD did all the work, and, as advertised, everything ...

Today I refactored some code that has been bugging me for a while, and wanted to share the results. The change resulted in a substantial code reduction and what I felt was a more elegant solution.

The code that I was looking at had a whole suite of objects that all implemented a proprietary ITransactionHandler interface, with methods such as Process(), and properties such as TransactionType and TransactionName. It was the latter two that made for some very verbose and awkward code. I found this basic pattern repeated in each class, and there were some 40 of these:

public  class...

My name is Rachel Hagerman, and I’m yet another newbie trying out blogging here at Falafel Software.  Recently I spent a few weeks preparing for the MS70-315 Exam:  Developing and Implementing Web Applications with Microsoft Visual C#.NET and Visual Studio.  Since I had no real ASP.NET experience, nor had I ever taken a Microsoft exam, I was a little apprehensive about how to study, how to get set up to take the test, and of course the test itself.  This blog is for anyone in that same situation.  To give you a sense of the time frame here, I ...

My name is Aaron Rhodes.  I am currently setting up some internal servers for Falafel Software.  Today I was setting up our Continuous Integration server using CruiseControl.net.  We have decided to run the server in a virtual machine and in order to save space on the virtual disk we don't want to install VisualStudio.  When running a build I encountered the following error:

The imported project
"C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" was not found.


This is referring to a VS solution requirement for MSBuild.  To fix this problem, re-create the directory structure "C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications\" and copy the file "Microsoft.WebApplication.targets" from a machine ...

I think everyone will agree that code reuse is a good thing. In T-SQL, one way to write reusable code is with user-defined functions (UDFs). UDFs come in three flavors:

  1. Scalar: Returns a single value
  2. Table: Returns a table
  3. Inline: Also returns a table, but may contain only a single statement, like a view, but with parameters.

All three of these have their uses, but today's topic is all about a common mistake people make when they write UDFs, specifically scalar UDFs. Let's look at a simple example. Consider that you have a typical customer orders database, and you've decided to ...

My name is Angelo Martinez and I am new here at Falafel Software.  I have known Lino Tadros for a long time and I can assure you that this is a great place to be!  My hope is to start blogging on new ideas/tools/technologies that I discover along the way.  With that in mind...

I had a requirement to build a generic MRU (Most Recently Used) class based on a Key/Value pair.  The idea seemed simple enough:

1)      instantiate the class with a maximum capacity

2)      as items get added, they are placed at the front of ...

In many database applications, it is common to generate a set of rows based on another set of rows. For example, in a sales and billing system, one might take a customer's order and save the ordered products as rows in an order detail table, and then later generate an invoice based on that order, listing all the ordered products as invoice details.

Consider a scenario such as this, where you want to relate the invoice details to their originating order details, but perhaps a 1:1 relationship is not guaranteed, so you can't simply include the order detail PK in ...