Category Archives: Technical

What’s the Stack? What’s the Heap?

February 14, 2006 What’s the Stack? What’s the Heap? Those are great interview questions.
Every developer should know how to answer them, because you can’t write code correctly
without understanding the Stack and the Heap, what they do, and how they interrelate. Am I
going to explain it here? I could, but I found a terrific exposition on it. So I’ll just point you there.
C# Heap(ing) Vs Stack(ing) in .NET: Part 1 C# Heap(ing) Vs Stack(ing) in .NET: Part 2 C#
Heap(ing) Vs Stack(ing) in .NET: Part 3 C# Heap(ing) Vs Stack(ing) in .NET: Part 4 The main
implication is that value types (things Continue reading

Posted in Technical | Leave a comment

The Many Uses of "using"

February 9, 2006 The Many Uses of “using” As you probably already know, using directives
can save you a lot of typing. Consider the following: System.Collections.Specialized.
NameValueCollection col = new System.Collections.Specialized.NameValueCollection(); By
inserting this using directive, using System.Collections.Specialized; you can cut it down to this:
NameValueCollection col = new NameValueCollection(); Using “using” to Alias Namespaces
But that’s not all there is to using “using” (pun intended). With using, you can alias both
namespaces and types, which is great for distinguishing between two classes with the same
name in different namespaces. Say, for example, you have your own Console class, Continue reading

Posted in Technical | 2 Comments

To Close or Not to Close?

January 30, 2006 To Close or Not to Close? Whether tis
better to close a sql connection in a finally block or let it
automatically close with a using statement. That is the
question. I was once asked this question in an interview.
Will a Sql Server connection automatically close if it is
opened in a C# using statement? At the time, I was used
to manually closing connections in the finally section of a
try / finally block. This ensured that the connection would
always be closed, and returned to the connection pool,
even if an exception occurred after opening the
connection. Here’s an example of that technique. Continue reading

Posted in Technical | Leave a comment

Installing Components in the Visual Studio Toolbox

January 29, 2006 Installing Components in the Visual Studio Toolbox There are two parts to
this story. The first part is deals with how to interact with the Visual Studio development
environment programmatically, in order to add a tab to the toolbox and place components on
it. That can be accomplished within the confines of a simple Console application. However, in
a real-world scenario, you’d want to install your custom components by means of a Setup
project with an MSI file, which first installs the components into the Global Assembly Cache
(GAC). That’s what the second part of the story is all about: creating a setup and deployment
project that first installs Continue reading

Posted in Technical | 1 Comment

App Settings in Visual Studio 2005

January 21, 2006 App Settings in Visual Studio 2005 Everyday I’m learning new things about
Visual Studio 2005 and version 2.0 of the .Net Framework. Most of the time when I “google”
something (I like it when a company name becomes a word in the English language), I can quickly
find several examples of what I want to do, and I quickly go about my business. However, now and
then, there’s a topic for which I’m not able to find any really good examples. The new application
settings feature in Visual Studio is, I believe, a case in point. In the old days of Visual Studio 2003, Continue reading

Posted in Technical | 5 Comments

My First Technical Blog: Set Start Page

When I took my first stab at blogging about a year ago, I decided to start two blogs, one personal and the other technical. As a C# programmer I wanted a place where I could write about the technical things … Continue reading

Posted in Technical | 4 Comments