Author Archives: braincrash

C# var keyword

I’m working my way through the C# 3.0 Language Enhancements videos on LearnVisualStudio.Net.  (Note:  LearnVisualStudio has many videos that are available for free from the MSDN website, but I think that you need a paid subscription to view this series.)  When I’m studying new programming concepts, I find that hearing someone talk about it helps me […]

C# “as” and “is” keywords

“Is” is exactly what I have been looking for.  You use it to check the type of an object.  For example: if(a is long) Gabe Wishnie points out that “is” is much more efficient than: if( a.GetType() == typeof(long)) “As” is a method of performing a typecast that gives you a null pointer rather than […]

.Net BackgroundWorker class

The BackgroundWorker class is an easy way to start up a thread from the GUI to run some lengthy action in the background.  Key points are: The DoWork event runs on the background thread.  You can’t interact with the GUI from there.  The ProgessChanged and RunWorkerCompleted events are raised by the background thread into the […]

NUnit and Visual Studio

Like all my “What I learned” experiences, this may not sound like much to you, but it was interesting to me. I attended a PhillyDotNet hands on lab session tonight  presented by Brian Donahue.  The lab was an avalance of Model View Presenter, Domain Driven Development, and unit testing techniques, with software tools such as Resharper, NUnit, and […]

Using regular expressions to find the text between two delimiters

I have a string like this:  “This is a [abcd] string”.  I want to find the text between the square brackets.  Looks like a job for regular expressions! This regular expression works:  “\[.*\]“.  Very straightforward (for a regular expression) – I like it! Then I saw this regular expression in some question and answer forum:  […]

Social Bookmarking

I finally joined the social bookmarking scene.  What I want is to be able to access my bookmarks from any computer. Digg – I hated it!  Digg has lots of flash and “hip” verbage on the website – it’s atrocious.  At a glance, I’m not interested in any of the articles others are submitting.  The emphasis […]

Getting a list of SQL Server databases on the network

I found this pretty easily with an Internet search.  Copying it here so I can be sure to find it next time I want it.  Courtesy of Dan Dittenhafer private static List EnumSqlServers() { System.Data.DataTable sqlInstances = System.Data.Sql.SqlDataSourceEnumerator.Instance.GetDataSources(); List listSqlServers = new List();// Loop to load the unique server names foreach (System.Data.DataColumn col in sqlInstances.Columns) […]

Adding icons to Windows Forms

I added an icon to a Windows Form, but it didn’t display.  Why not?  Because even though Visual Studio by default creates a 32x32x16 icon, you really need a 32x32x256 icon.  Right-click on the icon editor screen to select the desired format.  Thanks Jason Black.  

The Traveller’s Gift by Andy Andrews

The Traveller’s Gift is a set of 7 homilies setting life goals that will help you succeed.  The messages are things like “the buck stops here”, “seek wisdom”, “I am a person of action”, etc.  These are great goals and definately worth having impressed in your mind.  The book is easy to read, the ideas are relevant, […]

Vista, and Getting Things Done

I accomplished several useful things over the weekend.  Funny how sometimes these “to do” tasks build up and finally something happens to break the dam and I knock them off in short amount of time.   Somewhat related, The Brazen Careerist has a recent article called “Get good at finding the true barriers to getting […]