Wednesday, May 26, 2010

ILMerge v2.10.0526 Released

Mike Barnett who leads the ILMerge group at Microsoft just released an updated version of ILMerge which is a great tool for merging multiple dot net assemblies into a single assembly.

Link to ILMerge Site

Link to download

Friday, May 14, 2010

How to disable or enable all triggers in a database

I am a big fan of database triggers especially for audit records.  The problem is sometimes we need to import data into a database and don’t want the triggers firing during the migration.

These two scripts allow you to disable and enable all the triggers in a database.



This post shows a script for displaying all the triggers in a database;

How to get row counts for all tables in a database

I often need to clean out sample data from a database but need to leave static reference data.  I find this script very useful to ensure that I have removed table data that should not remain.

SELECT '[' + SCHEMA_NAME(t.schema_id) + '].[' + + ']' AS fulltable_name, SCHEMA_NAME(t.schema_id) AS schema_name, AS table_name,
FROM sys.tables AS t INNER JOIN
sys.sysindexes AS i ON t.object_id = AND i.indid < 2 order by rows desc

Thursday, May 13, 2010

Remote Desktop Manager

This is a great tool if you connect to a lot of remote workstations/servers with and without VPN’s.  This stores all your connections to RDP/VM and handles the VPN connections Microsoft, Cisco and others for you!

Remote Desktop Manager is a small application used to manage all your remote connections and virtual machines. Add, edit, delete, shared, organize and find your remote connection quickly. Compatible with Microsoft Remote Desktop, Terminal Services, VNC, LogMeIn, Team Viewer, Ftp, SSH, Telnet, Dameware, X Window, VMware, Virtual PC, PC Anywhere, Hyper-V, Citrix, Radmin, Microsoft Remote Assistance, Sun Virtual Box and more.

Windows Sysinternals

The Sysinternals web site was created in 1996 by Mark Russinovich and Bryce Cogswell to host their advanced system utilities and technical information. Microsoft acquired Sysinternals in July, 2006. Whether you’re an IT Pro or a developer, you’ll find Sysinternals utilities to help you manage, troubleshoot and diagnose your Windows systems and applications. If you have a question about a tool or how to use them, please visit the Sysinternals Forum for answers and help from other users and our moderators.

Great website that offers portable versions of applications you can run from a thumb drive.

image – Share your Code!

What is CodePaste.NET?

CodePaste.NET is a public site for pasting snippets of code and linking to them from social network sites. Post and link, post and link! Think of it like a linkable scratch pad for code snippets that provide syntax color highlighting, basic tagging and descriptions. Once posted you can link to the snippet from social network sites like Twitter and FaceBook or instant message and chat applications like Skype or Messenger.

Tweet Example Skype Example

Creating snippets is fast and easy: Simply paste your code into a textbox, add a title, choose a code syntax for the code and paste it. Done! The link is immediately available online for linking - simply pick up the Url from the address bar or use the Tweet this Snippet button to link away.

You can subscribe to various snippet lists via RSS feeds. There's a main, recent snippets feed , but you can also subscribe to a user's feed or feeds for certain keywords by utilizing the Format dropdown from most list pages to select a RSS Feed output.

It's Free
This site is open to all and free to use. Simply post a code snippet and pick up the resulting link to paste into your social network client. CodePaste.NET urls are short so they don't take up a lot of space in your Twitter tweets. Snippets can be posted anonymously or you can optionally create a user account using OpenId to keep track of your previous snippets and some basic stats. Anonymous snippets are removed after 10 days, so if you want permanent snippets please sign-in.

Please use this site for good, not evil.

MSBuildShellExtension – Build .Net projects from Windows Explorer!

MSBuildShellExtension lets you build .NET projects without ever opening Visual Studio or the command prompt. MSBuild targets can be executed from your favorite file system tool like Windows Explorer or Total Commander. The possibility to extend MSBuildShellExtension with your own targets and editors, makes it a very flexible and useful tool for all .NET developers.


Vb to C# or C# to VB Coder Converter

Here are a few sites that will convert VB and c# code back and forth.

Credit to Scott Hansleman’ss blog for these links.

Have to have utilities and software

This is a great link to “Scott Hanselman’s 2009 Ultimate Developer and power users tool list for Windows”.

How to reorganize all indexes in a database

The DBCC DBIndex command works on one table at a time.  If you need to run DBCC DBIndex on all the tables in a database you can use the script below.

USE myDatabase
DECLARE @table varchar(200)
SELECT table_name FROM information_schema.tables
WHERE table_type = 'base table'
OPEN Cursor1
DBCC DBREINDEX(@table,' ',90)
CLOSE Cursor1

While this script will work the Alter Index Reorganize|Rebuild command is the recommended method moving forward.

Dot Net Assembly Naming Guidelines

Sometime getting good guidance on certain basic topics seems harder then it should be.  Conventions and best practices for assembly names is an area that seems so simple you feel foolish asking the question.  However, what seems like a simple issue really deserves to be well thought out and grounded on sound principles and good information.

In addition to the naming of assemblies, the folder structure in which we house or development solutions and projects requires some thought and structure.

Below are some recommendations on the two topics.

Define a Common Root Folder

Define a common root folder—for example, C:\development on your file system. This acts as a container for all of your development systems and matches your toot namespace.

Beneath the common root folder, create sub folders for each sub namespace such as c:\development\Data.  Within each namespace folder create folders to house your solutions such as c:\development\Data\myCompanyData_Solution.


Use Common Names for Projects and Assemblies

Your output assembly name should always match the project name from which it is generated. For example, you should be able to assume that an assembly called MyCompany.Utilities.Data.dll is generated by a project called MyCompany.Utilities.Data.

If you change the name of an output assembly, consider changing the project name to match, and vice-versa.


Use a Common Root Namespace Name

The root namespace into which you place your types (structures, classes, interfaces, and so on) should match the project and assembly name.

For example, use MyCompany.Utilities.Data as the root namespace within the MyCompany.Utilities.Data.dll assembly.

While .NET does not require this alignment, it makes sense to synchronize names because it then becomes easy to tell which types live in which assemblies.

Use a dot separated naming convention


<Company>.<Major sub system>.dll

<Company>.<Major sub system>.<minor sub system>dll




Wednesday, May 12, 2010

Jarek Kowalski – Nlog Founder

I have been using Nlog for a number of years and find it to be a great logging component.  Today my post on loadFromRemoteSources which deals with referencing assemblies from remote network shares in VS2010 was re-tweeted by Jarek on his twitter page!


How to create a splash screen in WPF application

Creating a splash screen in WPF and VS2010 is a bit different then previous methods.  The simplest way is to add an PNG image of the splash screen you want to use.  Add it to your solutions and let the Build Action for it to SplashScreen.


Why PNG vs. BMP ?

The advantage of using a .PNG image over .BMP for your splash screen is that you will have better control on your Splash UI (for example, provide transparency if combined with UpdateLayeredWindow() API [which is not used in this sample]) and also will reduce the overall size of your app. Therefore, it will improve performance by decreasing the cold start and application deployment time.

In this sample the PNG version of the app is about 7 times smaller than the BMP one.


With VS2010 adding references to your application from a network drive such as nLog can result in this error;

Could not load file or assembly 'NLog, Version=, Culture=neutral, PublicKeyToken=5120e14c03d0593c' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

This is a result of the default loadFromRemoteSources behavior of VS2010.  This directive specifies whether assemblies from remote sources should be granted full trust.
In the .NET Framework version 3.5 and earlier versions, if you loaded an assembly from a remote location, the assembly would run partially trusted with a grant set that depended on the zone in which it was loaded. For example, if you loaded an assembly from a Web site, it was loaded into the Internet zone and granted the Internet permission set. In other words, it executed in an Internet sandbox. If you try to run that assembly in the .NET Framework version 4, an exception is thrown; you must either explicitly create a sandbox for the assembly, or run it in full trust.

The <loadFromRemoteSources> element lets you specify that the assemblies that run partially trusted in earlier versions of the .NET Framework should be run fully trusted in the .NET Framework 4.
Adding the following to your app.config and C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config will resolve the issue;

    <loadFromRemoteSources enabled="true"/>

Tuesday, May 11, 2010


This is a great website that provides free repair manuals for electronic devices. 


If you ever need to repair one of your devices this can be a great resource.

Thursday, May 06, 2010

Visio 2010

Today was the first day I have been using Visio 2010.  The only issue is I got the following screen when I was doing some cut and past of shapes. 


Office 2010

I upgraded to Office 2010 yesterday.  So far I have only used Word and Outlook but been very pleased.  I did have an issue reconnecting one of my pop accounts and was getting a unable to access data file.  I deleted the account and added it back to correct the issue.

I also cleaned out my Saved folder and started to use the categorize features to sort email and tasks with good results.

I also upgraded Visio and Project but have not used them yet.

So far I like the new interface and the performance is really good.

Wednesday, May 05, 2010

Office 2010 Upgrade

I upgraded a test laptop last night with Office 2010 Professional Plus, Visio 2010 and Project 2010.  The upgrade went pretty smooth. 

Today I will be updating my primary workstation with the new versions.

How to trap Nlog events within your application

Being able to trap nLog log events within your application allows you to provide a default msg to your users without having to have the UI code everywhere in your application. 

This post describes how to setup nLog with an additional target that will fire an event in your application that you can then capture.

First there are a few changes to the log file;


Notice that we added a new target and rule for that target.  Next we need to add a class with a shared method to capture the event;


This allows you to catch the log event.

FreeAgent® GoFlex™ Pro Ultra-portable Drive

Seagate is offering a great new portable drive.  I like the new design better then the previous slanted FreeAgent drives.  This device has not only a 7200RPM drive but support separate cables that provide USB 2.0/3.0 , Fire wire 400/800 and eSata just by swapping the cables.

There is also a NAS attachment for it.  They pro version 1TB are on preorder at Amazon and I look forward to there release. 

image image image

CradlePoint CTR500 Review

I was able to get the CradlePoint CTR500 up and running in about 10 minutes.  This included upgrading the firmware to the latest release.  I am very impressed with the performance and expansive settings on the router.  It supports several configurations and the web interface was very easy to use.

This is a definite keeper for anyone needing shared WiFi access via Verizon, Sprint & Att mobile data cards.

Tuesday, May 04, 2010

CradlePoint CTR500

I have a Verizon UM175 USB wireless card I have been using for a few years.  I really like it and get great speed from it.


I just purchased a CradlePoint CTR500 wireless access point that allows you to connect the USB device to it and share the connection.  It also allows you to connect to a wired network and setup a wireless network.

I am often working in an area with a few people and we all need internet access and the local network does not have it.  Or simply need to share a single network port across a few workstations.  Either way this seems like a great device for these situations.  I will update you on how it works for me.

image image

Link to the device manufacturer;

Here is a review;


I have not posted very much the last few days because I have been working on several priority projects.

Media Repository System, Major update to our Jail Management System, upgraded to VS2010, upgrade our source control system, build an export system for our JMS, started a service controller application to handle difference process snap-ins, a face finding assembly to control pan-tilt-zoom cameras for taking booking photos, updates to our mobile system, deployed our mobile system to a customer, deployed our JMS to two customers, over seeing a Fire House Export module from our CAD system, generated several reporting services reports, and starting back on our new Records Management System.  And that was just the last week!

The good news is that I am starting to use VS2010 and the .Net 4 framework for server side applications and have had not issues running side-by-side with VS2008!


I pre-ordered an IPAD from my wife (mothers day present) because it is the first piece of technology in over 15 years she has ever expresses any interest in.  Sure once I got her using her iPod she really liked it but I would not say that she was excited. 

She saw a demo of the device on Oprah.  That night I saw the glazing over of her eyes as she described this “wonderful” device.  I hope it lives up to her expectations.

I got the wireless keyboard and dock today and hope to receive the iPad my mothers day.  The case must be on back order.